developing-chart-types-locally
ما الذي تفعله
توجه هذه المهارة تحرير نوع مخطط مخصص أنشأته أو نزّلته بأداة سطر أوامر Lightdash. وهي للمطورين الذين يبنون مكوناتهم المرئية الخاصة لـ Lightdash.
متى تستخدمها
- ✓عندما تريد تحرير نوع مخطط مخصص أنشأته بأداة سطر أوامر 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 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تشرح المهارة القواعد التي يجب أن يتبعها مكون المخطط، مثل أخذ البيانات من المضيف فقط. ثم ترشد خطوات الرفع والتحقق والمعاينة المحلية ببيانات تركيبية.
المحتوى التقني (ملف 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 ولا يشغّل استعلامه الخاص.
كيف أعاينه؟
تصف المهارة معاينة محلية تستخدم بيانات نموذجية.
ماذا عن الواجهات الخارجية؟
تمر الطلبات الخارجية عبر اتصال مرتبط يضبطه المسؤول في المشروع.
التفاصيل
الوصف الأصلي من المؤلف
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
- الترخيص
- —
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
breakup-pr
6.2kيساعد وكيلك على تقسيم طلب سحب كبير إلى شرائح أصغر متراكمة يمكن مراجعة كل منها ودمجها على حدة.
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.