diff --git a/llms.txt b/llms.txt index b73854a..b648413 100644 --- a/llms.txt +++ b/llms.txt @@ -668,6 +668,56 @@ export function SpendChart() { } ``` +**Chart props reference (important):** + +Charts are **self-contained ECharts components**. Configure via props, NOT children: + +```tsx +// ✅ Correct: use props for customization + + + +``` + +**❌ CRITICAL: Charts do NOT accept Recharts children** + +```tsx +// ❌ WRONG - AppKit charts are NOT Recharts wrappers +import { BarChart } from "@databricks/appkit-ui/react"; +import { Bar, XAxis, YAxis, CartesianGrid } from "recharts"; + + + // ❌ This will cause TypeScript errors + // ❌ Not supported + // ❌ Not supported + + +// ✅ CORRECT - use props instead + +``` + ### SQL helpers (`sql.*`) Use these to build typed parameters (they return marker objects: `{ __sql_type, value }`): @@ -1169,6 +1219,7 @@ env: - `useMemo` wraps parameters objects - Loading/error/empty states are explicit - Charts use `format="auto"` unless you have a reason to force `"json"`/`"arrow"` + - Charts use props (`xKey`, `yKey`, `colors`) NOT children (they're ECharts-based, not Recharts) - If using tooltips: root is wrapped with `` - **Never** @@ -1176,4 +1227,5 @@ env: - Don't pass untyped raw params for annotated queries - Don't ignore `createApp()`'s promise - Don't invent UI components not listed in this file + - Don't pass Recharts children (``, ``, etc.) to AppKit chart components