developing-chart-types-locally
Fungsinya
Skill ini memandu pengeditan jenis grafik kustom yang dibuat atau diunduh dengan CLI Lightdash. Skill ini untuk pengembang yang membuat komponen visual sendiri untuk Lightdash.
Kapan dipakai
- βSaat Anda ingin mengedit jenis grafik kustom yang Anda buat dengan CLI Lightdash.
- βSaat Anda perlu mengunggah jenis grafik dan memeriksa apakah ia berfungsi.
- βSaat Anda ingin melihat pratinjau jenis grafik secara lokal dengan data contoh.
Link skill
https://github.com/lightdash/lightdash/blob/main/packages/cli/src/handlers/apps/authoring/developing-chart-types-locally/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βEdit jenis grafik gelembung kustom saya agar legendanya tampil di sebelah kanan, lalu unggah dan periksa apakah berfungsi.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill menjelaskan aturan yang harus diikuti sebuah komponen grafik, misalnya mengambil data hanya dari host. Lalu skill memandu langkah unggah dan verifikasi, serta pratinjau lokal dengan data contoh (fixture).
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apakah jenis grafik bisa menjalankan kuerinya sendiri?
Tidak. Skill menyatakan bahwa jenis grafik mendapat datanya dari Lightdash dan tidak menjalankan kueri sendiri.
Bagaimana cara melihat pratinjaunya?
Skill menjelaskan pratinjau lokal yang memakai data contoh (fixture).
Bagaimana dengan API eksternal?
Permintaan eksternal melewati koneksi tertaut yang dikonfigurasi oleh admin dalam proyek.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 6.2k
- Peringkat
- #14402
- Lisensi
- β
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
breakup-pr
6.2kMembantu agent Anda memecah pull request besar menjadi irisan kecil yang bertumpuk, sehingga bisa ditinjau dan digabung satu per satu.
lightdash-agent-slack-messaging
6.2kMembantu agent Anda menulis laporan pemeliharaan dan aktivitas yang jelas dan ramah untuk admin Lightdash, hanya berdasarkan bukti yang dimilikinya.
developing-in-lightdash
6.2kMembantu agent Anda membaca, membuat, dan mengedit dasbor serta grafik Lightdash dalam bentuk JSON, termasuk pengaturan setiap jenis grafik.
filter-expressions
6.2kMembantu agent Anda menulis ekspresi filter yang benar untuk kueri metrik Lightdash, termasuk filter pada metrik kustom.
Skill serupa
angular-developer
280kMembantu agent Anda membuat kode Angular dan memberi saran struktur proyek. Berguna saat memulai proyek baru, membuat komponen, atau meningkatkan performa.
frontend-a11y
280kMembantu agent Anda membuat antarmuka web dapat diakses semua orang. Memastikan website dan aplikasi berfungsi baik dengan screen reader dan navigasi keyboard.
frontend-patterns
280kMembuat agent Anda menerapkan pola modern dalam frontend. Mengoptimalkan performa, mengelola state, dan mengikuti praktik terbaik React dan Next.js.