Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions docs/docs/api/appkit-ui/data/AreaChart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# AreaChart

Area Chart component for trend visualization with filled areas.


## Example

```tsx
"use client";

import { AreaChart } from "@databricks/appkit-ui/react";

export default function AreaChartExample() {
return (
<AreaChart
data={[
{ month: "Jan", visitors: 1000, revenue: 5000 },
{ month: "Feb", visitors: 1500, revenue: 7000 },
{ month: "Mar", visitors: 2000, revenue: 9000 },
{ month: "Apr", visitors: 1800, revenue: 8500 },
{ month: "May", visitors: 2200, revenue: 10000 },
{ month: "Jun", visitors: 2500, revenue: 11000 },
]}
xKey="month"
yKey={["visitors", "revenue"]}
stacked
showLegend
height={300}
/>
);
}

```


## AreaChart

Area Chart component for trend visualization with filled areas.

**Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.

**Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.

Supports both query mode (queryKey + parameters) and data mode (static data).


**Source:** [`packages/appkit-ui/src/react/charts/area/index.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/charts/area/index.tsx)


### Props

| Prop | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `queryKey` | `string` | | - | Analytics query key registered with analytics plugin |
| `parameters` | `Record<string, unknown>` | | - | Query parameters passed to the analytics endpoint |
| `format` | `enum` | | `"auto"` | Data format to use - "json": Use JSON format (smaller payloads, simpler) - "arrow": Use Arrow format (faster for large datasets) - "auto": Automatically select based on expected data size |
| `transformer` | `(<T>(data: T) => T)` | | - | Transform raw data before rendering |
| `asUser` | `boolean` | | `false` | Whether to execute the query as the current user |
| `data` | `ChartData` | | - | Arrow Table or JSON array |
| `title` | `string` | | - | Chart title |
| `showLegend` | `boolean` | | - | Show legend |
| `colorPalette` | `enum` | | - | Color palette to use. Auto-selected based on chart type if not specified. - "categorical": Distinct colors for different categories (bar, pie, line) - "sequential": Gradient for magnitude/intensity (heatmap) - "diverging": Two-tone for positive/negative values |
| `colors` | `string[]` | | - | Custom colors for series (overrides colorPalette) |
| `height` | `number` | | `300` | Chart height in pixels |
| `className` | `string` | | - | Additional CSS classes |
| `xKey` | `string` | | - | X-axis field key. Auto-detected from schema if not provided. |
| `yKey` | `string \| string[]` | | - | Y-axis field key(s). Auto-detected from schema if not provided. |
| `ariaLabel` | `string` | | - | Accessibility label for screen readers |
| `testId` | `string` | | - | Test ID for automated testing |
| `options` | `Record<string, unknown>` | | - | Additional ECharts options to merge |
| `orientation` | `enum` | | `"vertical"` | Chart orientation |
| `showSymbol` | `boolean` | | `false` | Show data point symbols |
| `smooth` | `boolean` | | `true` | Smooth line curves |
| `stacked` | `boolean` | | `false` | Stack areas |



### Usage

```tsx
import { AreaChart } from '@databricks/appkit-ui';

<AreaChart /* props */ />
```

80 changes: 80 additions & 0 deletions docs/docs/api/appkit-ui/data/BarChart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# BarChart

Bar Chart component for categorical comparisons.


## Example

```tsx
"use client";

import { BarChart } from "@databricks/appkit-ui/react";

export default function BarChartExample() {
return (
<BarChart
data={[
{ category: "Product A", value: 100 },
{ category: "Product B", value: 200 },
{ category: "Product C", value: 150 },
{ category: "Product D", value: 300 },
{ category: "Product E", value: 250 },
]}
xKey="category"
yKey="value"
height={300}
/>
);
}

```


## BarChart

Bar Chart component for categorical comparisons.

**Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.

**Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.

Supports both query mode (queryKey + parameters) and data mode (static data).


**Source:** [`packages/appkit-ui/src/react/charts/bar/index.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/charts/bar/index.tsx)


### Props

| Prop | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `queryKey` | `string` | | - | Analytics query key registered with analytics plugin |
| `parameters` | `Record<string, unknown>` | | - | Query parameters passed to the analytics endpoint |
| `format` | `enum` | | `"auto"` | Data format to use - "json": Use JSON format (smaller payloads, simpler) - "arrow": Use Arrow format (faster for large datasets) - "auto": Automatically select based on expected data size |
| `transformer` | `(<T>(data: T) => T)` | | - | Transform raw data before rendering |
| `asUser` | `boolean` | | `false` | Whether to execute the query as the current user |
| `data` | `ChartData` | | - | Arrow Table or JSON array |
| `title` | `string` | | - | Chart title |
| `showLegend` | `boolean` | | - | Show legend |
| `colorPalette` | `enum` | | - | Color palette to use. Auto-selected based on chart type if not specified. - "categorical": Distinct colors for different categories (bar, pie, line) - "sequential": Gradient for magnitude/intensity (heatmap) - "diverging": Two-tone for positive/negative values |
| `colors` | `string[]` | | - | Custom colors for series (overrides colorPalette) |
| `height` | `number` | | `300` | Chart height in pixels |
| `className` | `string` | | - | Additional CSS classes |
| `xKey` | `string` | | - | X-axis field key. Auto-detected from schema if not provided. |
| `yKey` | `string \| string[]` | | - | Y-axis field key(s). Auto-detected from schema if not provided. |
| `ariaLabel` | `string` | | - | Accessibility label for screen readers |
| `testId` | `string` | | - | Test ID for automated testing |
| `options` | `Record<string, unknown>` | | - | Additional ECharts options to merge |
| `orientation` | `enum` | | `"vertical"` | Chart orientation |
| `stacked` | `boolean` | | - | Stack bars |



### Usage

```tsx
import { BarChart } from '@databricks/appkit-ui';

<BarChart /* props */ />
```

73 changes: 73 additions & 0 deletions docs/docs/api/appkit-ui/data/DataTable.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# DataTable

Production-ready data table with automatic data fetching and state management


## Example

```tsx
"use client";

import { DataTable } from "@databricks/appkit-ui/react";

export default function DataTableExample() {
return (
<DataTable
queryKey="example_query"
parameters={{}}
filterColumn="name"
filterPlaceholder="Filter by name..."
pageSize={10}
/>
);
}

```


## DataTable

Production-ready data table with automatic data fetching and state management

Features:
- Automatic column generation from data structure
- Integrated with useAnalyticsQuery for data fetching
- Built-in loading, error, and empty states
- Dynamic filtering, sorting and pagination
- Column visibility controls
- Responsive design
- Supports opinionated mode (auto columns) and full-control mode (`children(table)`)


**Source:** [`packages/appkit-ui/src/react/table/data-table.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/table/data-table.tsx)


### Props

| Prop | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `queryKey` | `string` | ✓ | - | The query key to fetch the data |
| `parameters` | `Record<string, any>` | ✓ | - | The parameters to pass to the query |
| `filterColumn` | `string` | | - | The column to filter by |
| `filterPlaceholder` | `string` | | - | Optional placeholder for the filter input |
| `transform` | `((data: any[]) => any[])` | | - | Optional function to transform data before creating table |
| `labels` | `DataTableLabels` | | - | Optional labels for the DataTable component |
| `ariaLabel` | `string` | | - | Optional accessibility label for the DataTable component |
| `testId` | `string` | | - | Optional test ID for the DataTable component |
| `className` | `string` | | - | Optional CSS class name for the DataTable component |
| `enableRowSelection` | `boolean` | | - | Enable row selection with checkboxes |
| `onRowSelectionChange` | `((rowSelection: RowSelectionState) => void)` | | - | Callback function to handle row selection changes |
| `children` | `((table: Table<any>) => ReactNode)` | | - | Optional children for full control mode |
| `pageSize` | `number` | | - | Number of rows to display per page |
| `pageSizeOptions` | `number[]` | | - | Options for the page size selector |



### Usage

```tsx
import { DataTable } from '@databricks/appkit-ui';

<DataTable /* props */ />
```

78 changes: 78 additions & 0 deletions docs/docs/api/appkit-ui/data/DonutChart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# DonutChart

Donut Chart component (Pie chart with inner radius).


## Example

```tsx
"use client";

import { DonutChart } from "@databricks/appkit-ui/react";

export default function DonutChartExample() {
return (
<DonutChart
data={[
{ name: "Engineering", value: 450 },
{ name: "Marketing", value: 250 },
{ name: "Sales", value: 300 },
{ name: "Operations", value: 200 },
]}
height={300}
/>
);
}

```


## DonutChart

Donut Chart component (Pie chart with inner radius).

**Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.

**Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.

Supports both query mode (queryKey + parameters) and data mode (static data).


**Source:** [`packages/appkit-ui/src/react/charts/pie/index.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/charts/pie/index.tsx)


### Props

| Prop | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `queryKey` | `string` | | - | Analytics query key registered with analytics plugin |
| `parameters` | `Record<string, unknown>` | | - | Query parameters passed to the analytics endpoint |
| `format` | `enum` | | `"auto"` | Data format to use - "json": Use JSON format (smaller payloads, simpler) - "arrow": Use Arrow format (faster for large datasets) - "auto": Automatically select based on expected data size |
| `transformer` | `(<T>(data: T) => T)` | | - | Transform raw data before rendering |
| `asUser` | `boolean` | | `false` | Whether to execute the query as the current user |
| `data` | `ChartData` | | - | Arrow Table or JSON array |
| `title` | `string` | | - | Chart title |
| `showLegend` | `boolean` | | - | Show legend |
| `colorPalette` | `enum` | | - | Color palette to use. Auto-selected based on chart type if not specified. - "categorical": Distinct colors for different categories (bar, pie, line) - "sequential": Gradient for magnitude/intensity (heatmap) - "diverging": Two-tone for positive/negative values |
| `colors` | `string[]` | | - | Custom colors for series (overrides colorPalette) |
| `height` | `number` | | `300` | Chart height in pixels |
| `className` | `string` | | - | Additional CSS classes |
| `xKey` | `string` | | - | X-axis field key. Auto-detected from schema if not provided. |
| `yKey` | `string \| string[]` | | - | Y-axis field key(s). Auto-detected from schema if not provided. |
| `ariaLabel` | `string` | | - | Accessibility label for screen readers |
| `testId` | `string` | | - | Test ID for automated testing |
| `options` | `Record<string, unknown>` | | - | Additional ECharts options to merge |
| `innerRadius` | `number` | | `0` | Inner radius for donut charts (0-100%) |
| `showLabels` | `boolean` | | `true` | Show labels on slices |
| `labelPosition` | `enum` | | `"outside"` | Label position |



### Usage

```tsx
import { DonutChart } from '@databricks/appkit-ui';

<DonutChart /* props */ />
```

25 changes: 25 additions & 0 deletions docs/docs/api/appkit-ui/data/ErrorState.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ErrorState


## ErrorState


**Source:** [`packages/appkit-ui/src/react/table/error.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/table/error.tsx)


### Props

| Prop | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `error` | `string` | ✓ | - | - |



### Usage

```tsx
import { ErrorState } from '@databricks/appkit-ui';

<ErrorState /* props */ />
```

Loading