developing-chart-types-locally
Что он делает
Этот скилл направляет редактирование пользовательского типа графика, созданного или скачанного с помощью CLI Lightdash. Он нужен разработчикам, которые создают собственные визуальные компоненты для Lightdash.
Когда использовать
- ✓Когда вы хотите отредактировать свой тип графика, созданный через CLI Lightdash.
- ✓Когда нужно загрузить тип графика и проверить, что он работает.
- ✓Когда вы хотите посмотреть тип графика локально на примерных данных.
Ссылка на скилл
https://github.com/lightdash/lightdash/blob/main/packages/cli/src/handlers/apps/authoring/developing-chart-types-locally/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Измени мой пользовательский тип графика «пузырьковая диаграмма» так, чтобы легенда была справа, затем загрузи его и проверь, что он работает.”
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 fromuseLightdashClient(), against an external connection a project admin configured and linked to this chart type. Do not add directfetchor 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.ymlunderexternalConnections(- 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
connectionSlugthat doesn't exist in the target project is skipped with a warning (the chart type uploads, butexternalFetchon 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.
- Edit files under
src/(andvizSchemawhen the declaration changes). lightdash apps validatechecks source and manifest (including thatvizSchemaparses);lightdash apps validate --buildadds the Cloud-parity Vite production build. A build failure is a validation error with the Vite output.lightdash upload --chart-types <slug> --path ../..(theslugfromlightdash-app.yml) — the server rebuilds and serves it.- 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
- Лицензия
- —
- Обновлён
- 02.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
breakup-pr
6.2kПомогает агенту разбить большой pull request на меньшие части, выстроенные цепочкой, которые можно проверять по одной.
lightdash-agent-slack-messaging
6.2kПомогает агенту писать короткие и понятные отчёты о работе для администраторов Lightdash, опираясь только на имеющиеся факты.
developing-in-lightdash
6.2kПомогает агенту читать, создавать и менять дашборды и графики Lightdash в виде JSON, включая настройки каждого типа графика.
filter-expressions
6.2kПомогает агенту писать правильные выражения фильтров для запросов метрик Lightdash, включая фильтры по своим метрикам.
Похожие скиллы
angular-developer
280kПомогает агенту писать код на Angular и советовать по структуре проекта. Полезен для новых проектов, создания частей кода и улучшения производительности.
frontend-a11y
280kПомогает агенту делать веб-интерфейсы доступными для всех, чтобы сайты и приложения работали с программами чтения с экрана и клавиатурой.
frontend-patterns
280kАгент применяет современные паттерны фронтенд-разработки: оптимизирует производительность, управляет состоянием и следует практикам React и Next.js.