Developing Chart Types Locallyのロゴ

Developing Chart Types Locally

組織人気
lightdash
developing-chart-types-locally

ローカルで作成またはダウンロードしたLightdashのカスタムチャートタイプ(data_app_viz)を編集するときに使います。vizSchemaとコンポーネントの整合性に関する契約、アップロードと検証の手順、ローカルフィクスチャのプレビュー、チャートタイプが公式レジストリに登録されるまでの流れを扱います。

Add to TypingMind

概要

公開者lightdash
リポジトリlightdash
スキル名developing-chart-types-locally
スター
6.1K
フォーク
778
同梱ファイル
指示のみ
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    lightdashがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Developing Chart Types Locally」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/lightdash/lightdash/tree/main/packages/cli/src/handlers/apps/authoring/developing-chart-types-locally
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lightdash/lightdash.git /tmp/lightdash
mkdir -p .claude/skills
cp -r /tmp/lightdash/packages/cli/src/handlers/apps/authoring/developing-chart-types-locally .claude/skills/developing-chart-types-locally
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでDeveloping Chart Types Locallyを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にDeveloping Chart Types Locallyを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Developing Chart Types Locallyは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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 .claude/skills/reusable-visualization before editing. It defines everything the component may do: useVizContext() is the only channel to the host (data, options, resolved colours), the component runs no query, owns no explore, and never fetches anything itself. App-level SDK APIs (query builder, useLightdash, filters, externalFetch) do not apply here and must not be introduced.

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. While iterating in a shared project, prefer verifying on a throwaway chart.

Preview locally with a fixture (fast layout iteration)

useVizContext() normally waits for the Lightdash host to push a context, so with no host the component renders nothing. For local iteration the SDK has a dev-only fixture fallback: when the app runs top-level (not embedded) and the page URL carries ?vizFixture=<path>, it fetches that same-origin JSON file and feeds it to useVizContext() as the context.

The scaffold ships a viz-fixture.json at the folder root. To use it:

  1. lightdash apps preview (or npm run dev) to start the dev server.
  2. Open the dev URL with the param, e.g. http://localhost:5173/?vizFixture=/viz-fixture.json. The chart renders from the fixture.
  3. Edit viz-fixture.json to match your declared vizSchema — fieldMapping (input name → string id, or an ordered array of ids for multiple-field inputs), rows (each cell is { "value": { "raw": ..., "formatted": "..." } }, keyed by those ids), options (declared option name → value), colorPalette, and pivotDetails (null unless you map a series field). Reload to see changes.

For multiple-field inputs, set multiple: true on the vizSchema.fields entry and iterate the array at useVizContext().fieldMapping[name] in its existing order, narrowing with Array.isArray first. Single-field inputs continue to read a string from fieldMapping[name]. Test three metrics and multiple dimensions, remove and re-add one, then save and reopen the chart in the explorer. Verify fields follow the order they were added, with re-added fields at the end. Keep the input names stable across upgrades. Single-field inputs retain string bindings; details and examples live in the reusable-visualization skill.

This is for layout and option iteration only, and never fires in production (an embedded viz has a real host whose context always wins, and the param must be explicitly present). The fixture is fake data you hand-maintain: colors fall back to the palette (no model or shared-dashboard colors), pivotDetails must be shaped by hand, and formatting is whatever you type. The explorer with real data remains the source of truth for correctness — still run the upload → verify loop above before finishing, and verify every declared option actually changes the chart there.

Dependencies: template-deps-only, strictly

Build with the template's preinstalled set (see package.json — React, Recharts, d3 and friends). Do not add npm packages and do not vendor library source into src/. This is stricter than for data apps: the official chart registry rejects any dependency drift from its template, so a chart type that grows custom dependencies becomes unpublishable.

Root config files (vite.config.js, tsconfig.json, ...) are read-only reference — the server rebuilds against a trusted template. .npmrc sets ignore-scripts=true; never remove it or run installs with scripts enabled.

Publishing to the official registry

Once the chart type works in an instance, it can be proposed for the official chart registry (the lightdash/lightdash-library repo, served to every Lightdash deployment with the chart type library enabled):

  1. Copy this folder into that repo under charts/<slug>/.
  2. Run node scripts/prepare-chart.mjs charts/<slug> there — it prunes the local scaffold (these skills, configs, AGENTS/README), scrubs instance-side manifest fields, and shapes the folder for the registry. The folder name becomes the permanent official registry slug; pass --slug <official-slug> if the local slug isn't the identity that should ship.
  3. Add real screenshots from the in-product preview under screenshots/ (the first is the gallery thumbnail) and fill in registry.yml (version, tags, changelog). New versions default to the beta channel; releasing to customers requires an explicit channel: stable.
  4. Open a PR there. On merge, publishing is automatic; published versions are immutable — any later change needs a version bump.

Report the registry step as a suggestion to the user rather than doing it unprompted: publishing makes the chart type public.

よくある質問

AIスキル「Developing Chart Types Locally」では何ができますか?

ローカルで作成またはダウンロードしたLightdashのカスタムチャートタイプ(data_app_viz)を編集するときに使います。vizSchemaとコンポーネントの整合性に関する契約、アップロードと検証の手順、ローカルフィクスチャのプレビュー、チャートタイプが公式レジストリに登録されるまでの流れを扱います。

TypingMindでDeveloping Chart Types Locallyを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Developing Chart Types Locallyはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにDeveloping Chart Types Locallyをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/lightdash/lightdash/tree/main/packages/cli/src/handlers/apps/authoring/developing-chart-types-locallyを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Developing Chart Types Locallyを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Developing Chart Types Locallyで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもDeveloping Chart Types Locallyを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Developing Chart Types Locally」は無料ですか?

lightdashがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇