본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)6.2k · #14402

developing-chart-types-locally

하는 일

이 스킬은 Lightdash CLI로 만들거나 내려받은 맞춤 차트 종류의 편집을 안내합니다. Lightdash용 시각 구성 요소를 직접 만드는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Lightdash CLI로 만든 맞춤 차트 종류를 편집하고 싶을 때.
  • ✓차트 종류를 업로드하고 작동하는지 확인해야 할 때.
  • ✓샘플 데이터로 차트 종류를 로컬에서 미리 보고 싶을 때.

스킬 링크

https://github.com/lightdash/lightdash/blob/main/packages/cli/src/handlers/apps/authoring/developing-chart-types-locally/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/lightdash/lightdash/blob/main/packages/cli/src/handlers/apps/authoring/developing-chart-types-locally/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“내 맞춤 버블 차트 종류가 범례를 오른쪽에 표시하도록 편집한 뒤, 업로드하고 작동하는지 확인해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 차트 구성 요소가 따라야 할 규칙, 예를 들어 데이터는 호스트에서만 가져온다는 규칙을 설명합니다. 그다음 업로드와 검증 단계, 그리고 픽스처 데이터로 하는 로컬 미리보기를 안내합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Developing Lightdash Custom Chart Types Locally

You are editing a Lightdash custom chart type (a reusable visualization, the data_app_viz template) that was created or downloaded with the Lightdash CLI. It is ONE chart component that Lightdash hands data and settings to — not a data app.

The contract is the reusable-visualization skill

Read the reusable-visualization skill before editing. It defines everything the component may do: useVizContext() is the only channel to the host for data, options and resolved colours; the component runs no query and owns no explore. App-level query APIs (query builder, useLightdash, filters) do not apply here and must not be introduced.

Never hand-build a data-point action menu when useVizContext().pointMenu.enabled — call pointMenu.open({ x, y, row, metric }) and let Lightdash render it; an in-viz menu is only the fallback for hosts that predate the capability.

External HTTP APIs go through linked connections

A chart type's rows always come from useVizContext(). Anything else it needs from outside Lightdash, such as reference data from a third-party API or images from a URL, goes through an external connection, the same way it does for data apps.

  • The one sanctioned path to a third-party API is client.externalFetch('<alias>', ...), with the client from useLightdashClient(), against an external connection a project admin configured and linked to this chart type. Do not add direct fetch or REST calls; the sandbox blocks them.
  • Images load only from a linked connection that has public images enabled, from its exact origin. Never put Lightdash data in an image URL.
  • Links are declared in this folder's lightdash-app.yml under externalConnections (- alias: stripe / connectionSlug: stripe-api). When the key is present, upload reconciles the chart type's links to match it exactly, so to link a connection that already exists in the project, add its {alias, connectionSlug} entry and upload. Do not remove entries casually: an entry removed from the list (or an empty list) unlinks on upload, and a manifest without the key leaves links unchanged.
  • Watch the upload output: a connectionSlug that doesn't exist in the target project is skipped with a warning (the chart type uploads, but externalFetch on that alias fails at runtime). If a link is skipped or forbidden, report it to the user instead of retrying.
  • If the chart type needs an API with no existing connection, stop and say so. An admin must create the connection first; then it can be linked via the manifest as above.
  • Connections are not emulated by the local fixture preview. Test them after upload, in the explorer.

The declaration lives in lightdash-app.yml — keep it in lockstep

In the in-product builder the declaration is emitted by the generation run; locally it is the vizSchema block in this folder's lightdash-app.yml, and upload round-trips it to the server (without it the chart type never appears in the explorer's chart type picker).

The correspondence must be exact in both directions: every key the component reads from fieldMapping or options is declared in vizSchema, and everything declared there is read by the component. When an edit changes what the component reads — a new field, a renamed option, a removed control — update vizSchema in the same edit. A declared option nothing reads is a dead control; a read key nothing declares never receives a value.

The edit → validate → upload → verify loop

Run these commands from this folder under chart-types/<slug>/. The upload path ../.. selects the Lightdash content root.

  1. Edit files under src/ (and vizSchema when the declaration changes).
  2. lightdash apps validate checks source and manifest (including that vizSchema parses); lightdash apps validate --build adds the Cloud-parity Vite production build. A build failure is a validation error with the Vite output.
  3. lightdash upload --chart-types <slug> --path ../.. (the slug from lightdash-app.yml) — the server rebuilds and serves it.
  4. Verify in Lightdash: open any explore, run a query with at least the required fields' shapes (e.g. a dimension and a metric), pick this chart type in the chart type picker, and map its fields. Check every config option you declared actually changes the chart.

Saved charts already using this chart type may pin a version; unpinned charts move to the newly uploaded version right away. W

자주 묻는 질문

차트 종류가 자체 쿼리를 실행할 수 있나요?

아니요, 차트 종류는 Lightdash에서 데이터를 받으며 자체 쿼리를 실행하지 않는다고 스킬에 나와 있습니다.

어떻게 미리 보나요?

샘플 픽스처 데이터를 사용하는 로컬 미리보기가 설명되어 있습니다.

외부 API는 어떻게 되나요?

외부 요청은 프로젝트에서 관리자가 설정하는 연결된 연결을 통해 이루어집니다.

상세 정보

작성자의 원본 설명

Use when editing a locally created or downloaded Lightdash custom chart type (data_app_viz) — the vizSchema/component lockstep contract, the upload-and-verify loop, the local fixture preview, and how a chart type reaches the official registry.

repo: lightdash/lightdash

인기도

GitHub 스타
6.2k
순위
#14402
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬