Skip to content

Commit fd6ad60

Browse files
keugenekclaude
andcommitted
Fix AppKit template docs: chart children warning and import fixes
- Clarify that AppKit charts do NOT accept children (Recharts pattern) - Fix import path typo: app-kit-ui -> appkit-ui - Add sql import for parameter helpers - Remove incorrect generic type usage on useAnalyticsQuery Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9072fbc commit fd6ad60

2 files changed

Lines changed: 14 additions & 15 deletions

File tree

experimental/aitools/templates/appkit/template/{{.project_name}}/docs/appkit-sdk.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ Use cases:
4545
- Data that needs transformation before display
4646

4747
```typescript
48-
import { useAnalyticsQuery, Skeleton } from '@databricks/app-kit-ui/react';
49-
50-
interface QueryResult { column_name: string; value: number; }
48+
import { useAnalyticsQuery, Skeleton } from '@databricks/appkit-ui/react';
49+
import { sql } from '@databricks/appkit-ui/js';
5150

5251
function CustomDisplay() {
53-
const { data, loading, error } = useAnalyticsQuery<QueryResult[]>('query_name', {
52+
const { data, loading, error } = useAnalyticsQuery('query_name', {
5453
start_date: sql.date(Date.now()),
5554
category: sql.string("tools")
5655
});

experimental/aitools/templates/appkit/template/{{.project_name}}/docs/frontend.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ function MyDashboard() {
3535

3636
Components automatically fetch data, show loading states, display errors, and render with sensible defaults.
3737

38-
**Custom Visualization (Recharts):**
38+
**⚠️ CRITICAL: AppKit charts do NOT support children**
3939

4040
```typescript
41+
// ❌ WRONG - AppKit charts don't accept Recharts children
4142
import { BarChart } from '@databricks/appkit-ui/react';
42-
import { Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend } from 'recharts';
43-
44-
<BarChart queryKey="sales_by_region" parameters={{}}>
45-
<CartesianGrid strokeDasharray="3 3" />
46-
<XAxis dataKey="region" />
47-
<YAxis />
48-
<Tooltip />
49-
<Legend />
50-
<Bar dataKey="revenue" fill="#40d1f5" />
51-
<Bar dataKey="expenses" fill="#4462c9" />
43+
import { Bar, XAxis, YAxis } from 'recharts';
44+
<BarChart queryKey="sales" parameters={{}}>
45+
<XAxis dataKey="region" /> // TypeScript error!
46+
<Bar dataKey="revenue" /> // TypeScript error!
5247
</BarChart>
48+
49+
// ✅ CORRECT - Use simple self-closing syntax
50+
<BarChart queryKey="sales" parameters={{}} />
5351
```
5452

53+
AppKit charts auto-configure axes, tooltips, and styling. Do NOT import Recharts components.
54+
5555
Databricks brand colors: `['#40d1f5', '#4462c9', '#EB1600', '#0B2026', '#4A4A4A', '#353a4a']`
5656

5757
**❌ Don't double-fetch:**

0 commit comments

Comments
 (0)