@databricks/appkit-ui 0.92.0 → 0.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CLAUDE.md +2 -0
  2. package/dist/cli/commands/plugin/add/add.js +398 -0
  3. package/dist/cli/commands/plugin/add/add.js.map +1 -0
  4. package/dist/cli/commands/plugin/add/plan.js +216 -0
  5. package/dist/cli/commands/plugin/add/plan.js.map +1 -0
  6. package/dist/cli/commands/plugin/add/resolve.js +45 -0
  7. package/dist/cli/commands/plugin/add/resolve.js.map +1 -0
  8. package/dist/cli/commands/plugin/index.js +4 -1
  9. package/dist/cli/commands/plugin/index.js.map +1 -1
  10. package/dist/cli/commands/registry/add.js +3 -2
  11. package/dist/cli/commands/registry/add.js.map +1 -1
  12. package/dist/cli/commands/registry/config-plan.js +1 -1
  13. package/dist/cli/commands/registry/config-plan.js.map +1 -1
  14. package/dist/cli/commands/registry/config-writer.js +77 -9
  15. package/dist/cli/commands/registry/config-writer.js.map +1 -1
  16. package/dist/cli/commands/registry/env-writer.js +1 -1
  17. package/dist/cli/commands/registry/env-writer.js.map +1 -1
  18. package/dist/cli/commands/registry/server-register.js +62 -26
  19. package/dist/cli/commands/registry/server-register.js.map +1 -1
  20. package/dist/cli/commands/registry/workspace-picker.js +1 -1
  21. package/dist/cli/deploy-config.js.map +1 -1
  22. package/dist/cli/index.js +1 -1
  23. package/dist/react/beta.d.ts +3 -1
  24. package/dist/react/beta.js +3 -1
  25. package/dist/react/charts/base.d.ts +1 -1
  26. package/dist/react/charts/base.d.ts.map +1 -1
  27. package/dist/react/charts/base.js +5 -3
  28. package/dist/react/charts/base.js.map +1 -1
  29. package/dist/react/charts/constants.js +13 -1
  30. package/dist/react/charts/constants.js.map +1 -1
  31. package/dist/react/charts/create-chart.js +1 -1
  32. package/dist/react/charts/create-chart.js.map +1 -1
  33. package/dist/react/charts/index.d.ts +1 -1
  34. package/dist/react/charts/types.d.ts +7 -3
  35. package/dist/react/charts/types.d.ts.map +1 -1
  36. package/dist/react/charts/types.js.map +1 -1
  37. package/dist/react/charts/wrapper.d.ts +1 -1
  38. package/dist/react/charts/wrapper.d.ts.map +1 -1
  39. package/dist/react/charts/wrapper.js +12 -5
  40. package/dist/react/charts/wrapper.js.map +1 -1
  41. package/dist/react/design-page.d.ts +33 -0
  42. package/dist/react/design-page.d.ts.map +1 -0
  43. package/dist/react/design-page.js +173 -0
  44. package/dist/react/design-page.js.map +1 -0
  45. package/dist/react/hooks/use-design-ready.d.ts +19 -0
  46. package/dist/react/hooks/use-design-ready.d.ts.map +1 -0
  47. package/dist/react/hooks/use-design-ready.js +33 -0
  48. package/dist/react/hooks/use-design-ready.js.map +1 -0
  49. package/dist/react/index.d.ts +2 -2
  50. package/dist/shared/src/plugin.d.ts.map +1 -1
  51. package/docs/api/appkit/Variable.design.md +6 -0
  52. package/docs/api/appkit-ui/data/AreaChart.md +2 -2
  53. package/docs/api/appkit-ui/data/BarChart.md +2 -2
  54. package/docs/api/appkit-ui/data/DonutChart.md +2 -2
  55. package/docs/api/appkit-ui/data/HeatmapChart.md +2 -2
  56. package/docs/api/appkit-ui/data/LineChart.md +2 -2
  57. package/docs/api/appkit-ui/data/PieChart.md +2 -2
  58. package/docs/api/appkit-ui/data/RadarChart.md +2 -2
  59. package/docs/api/appkit-ui/data/ScatterChart.md +2 -2
  60. package/docs/api/appkit.md +1 -0
  61. package/docs/plugins/analytics.md +8 -0
  62. package/docs/plugins/design.md +233 -0
  63. package/llms.txt +2 -0
  64. package/package.json +1 -1
  65. package/sbom.cdx.json +1 -1
@@ -0,0 +1,173 @@
1
+ import { Skeleton } from "./ui/skeleton.js";
2
+ import { useDesignReady } from "./hooks/use-design-ready.js";
3
+ import { Component, useLayoutEffect, useRef } from "react";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+
6
+ //#region src/react/design-page.tsx
7
+ /** `?theme=dark|light`, else the system setting, applied before the first paint. */
8
+ function useDesignTheme() {
9
+ useLayoutEffect(() => {
10
+ const param = new URLSearchParams(location.search).get("theme");
11
+ const media = window.matchMedia?.("(prefers-color-scheme: dark)");
12
+ const apply = () => document.documentElement.classList.toggle("dark", param ? param === "dark" : !!media?.matches);
13
+ apply();
14
+ if (param || !media) return;
15
+ media.addEventListener("change", apply);
16
+ return () => media.removeEventListener("change", apply);
17
+ }, []);
18
+ }
19
+ function capture(root) {
20
+ return {
21
+ nodes: Array.from(root.childNodes).map((n) => n.cloneNode(true)),
22
+ pixels: Array.from(root.querySelectorAll("canvas")).map((c) => {
23
+ const copy = document.createElement("canvas");
24
+ copy.width = c.width;
25
+ copy.height = c.height;
26
+ if (c.width && c.height) copy.getContext("2d")?.drawImage(c, 0, 0);
27
+ return copy;
28
+ })
29
+ };
30
+ }
31
+ function restore(holder, frame) {
32
+ if (!holder) return;
33
+ holder.replaceChildren(...frame.nodes.map((n) => n.cloneNode(true)));
34
+ holder.querySelectorAll("canvas").forEach((c, i) => {
35
+ const px = frame.pixels[i];
36
+ if (!px?.width || !px.height) return;
37
+ c.width = px.width;
38
+ c.height = px.height;
39
+ c.getContext("2d")?.drawImage(px, 0, 0);
40
+ });
41
+ }
42
+ function HoldReady() {
43
+ useDesignReady(false);
44
+ return null;
45
+ }
46
+ var LastGoodFrame = class extends Component {
47
+ state = {
48
+ error: null,
49
+ resetKey: this.props.resetKey
50
+ };
51
+ static getDerivedStateFromError(error) {
52
+ return { error };
53
+ }
54
+ static getDerivedStateFromProps(props, state) {
55
+ return props.resetKey === state.resetKey ? null : {
56
+ error: null,
57
+ resetKey: props.resetKey
58
+ };
59
+ }
60
+ componentDidCatch(error) {
61
+ this.props.onError?.(error);
62
+ }
63
+ render() {
64
+ const { error } = this.state;
65
+ if (!error) return this.props.children;
66
+ const frame = this.props.frame.current;
67
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(HoldReady, {}), frame ? /* @__PURE__ */ jsx("div", {
68
+ "data-design-last-good": "",
69
+ style: { display: "contents" },
70
+ ref: (el) => restore(el, frame)
71
+ }) : /* @__PURE__ */ jsx("div", {
72
+ "data-design-error": "",
73
+ style: { display: "contents" },
74
+ children: this.props.errorFallback(error)
75
+ })] });
76
+ }
77
+ };
78
+ const defaultErrorFallback = (error) => /* @__PURE__ */ jsxs("pre", {
79
+ className: "text-destructive p-4 whitespace-pre-wrap",
80
+ children: ["Design page failed to render: ", error.message]
81
+ });
82
+ /**
83
+ * The shell the `design()` plugin renders every `/design` page in: the app's
84
+ * theme from the first paint, and the last good frame instead of a broken one.
85
+ */
86
+ function DesignPage({ children, onError, resetKey, errorFallback = defaultErrorFallback }) {
87
+ useDesignTheme();
88
+ const root = useRef(null);
89
+ const frame = useRef(null);
90
+ useLayoutEffect(() => {
91
+ const el = root.current;
92
+ if (!el) return;
93
+ const keep = () => {
94
+ if (!el.querySelector("[data-design-last-good], [data-design-error]")) frame.current = capture(el);
95
+ };
96
+ if (el.childNodes.length > 0) keep();
97
+ let pending = false;
98
+ const observer = new MutationObserver(() => {
99
+ if (pending) return;
100
+ pending = true;
101
+ requestAnimationFrame(() => {
102
+ pending = false;
103
+ keep();
104
+ });
105
+ });
106
+ observer.observe(el, {
107
+ subtree: true,
108
+ childList: true,
109
+ characterData: true,
110
+ attributes: true
111
+ });
112
+ return () => observer.disconnect();
113
+ }, []);
114
+ return /* @__PURE__ */ jsx("div", {
115
+ ref: root,
116
+ "data-design-page": "",
117
+ className: "bg-background text-foreground min-h-screen",
118
+ children: /* @__PURE__ */ jsx(LastGoodFrame, {
119
+ frame,
120
+ resetKey,
121
+ onError,
122
+ errorFallback,
123
+ children
124
+ })
125
+ });
126
+ }
127
+ /** Skeleton the `design()` plugin shows for a component a streaming draft hasn't defined yet. */
128
+ function DraftPlaceholder({ kind = "generic" }) {
129
+ if (kind === "chart") return /* @__PURE__ */ jsx("div", {
130
+ "data-draft-placeholder": "chart",
131
+ className: "flex h-56 items-end gap-2 p-4",
132
+ children: [
133
+ 40,
134
+ 65,
135
+ 50,
136
+ 80,
137
+ 60,
138
+ 90,
139
+ 70
140
+ ].map((h) => /* @__PURE__ */ jsx(Skeleton, {
141
+ className: "flex-1",
142
+ style: { height: `${h}%` }
143
+ }, h))
144
+ });
145
+ if (kind === "table") return /* @__PURE__ */ jsxs("div", {
146
+ "data-draft-placeholder": "table",
147
+ className: "space-y-2 p-4",
148
+ children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-full" }), [
149
+ 0,
150
+ 1,
151
+ 2,
152
+ 3
153
+ ].map((r) => /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full opacity-70" }, r))]
154
+ });
155
+ if (kind === "card") return /* @__PURE__ */ jsxs("div", {
156
+ "data-draft-placeholder": "card",
157
+ className: "space-y-3 rounded-xl border p-4",
158
+ children: [
159
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/3" }),
160
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-1/2" }),
161
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-2/3" })
162
+ ]
163
+ });
164
+ return /* @__PURE__ */ jsxs("div", {
165
+ "data-draft-placeholder": "generic",
166
+ className: "space-y-2 p-2",
167
+ children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-3/4" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" })]
168
+ });
169
+ }
170
+
171
+ //#endregion
172
+ export { DesignPage, DraftPlaceholder };
173
+ //# sourceMappingURL=design-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design-page.js","names":[],"sources":["../../src/react/design-page.tsx"],"sourcesContent":["import { Component, type ReactNode, useLayoutEffect, useRef } from \"react\";\n\nimport { useDesignReady } from \"./hooks/use-design-ready\";\nimport { Skeleton } from \"./ui/skeleton\";\n\n/** `?theme=dark|light`, else the system setting, applied before the first paint. */\nfunction useDesignTheme() {\n useLayoutEffect(() => {\n const param = new URLSearchParams(location.search).get(\"theme\");\n const media = window.matchMedia?.(\"(prefers-color-scheme: dark)\");\n const apply = () =>\n document.documentElement.classList.toggle(\n \"dark\",\n param ? param === \"dark\" : !!media?.matches,\n );\n apply();\n if (param || !media) return;\n media.addEventListener(\"change\", apply);\n return () => media.removeEventListener(\"change\", apply);\n }, []);\n}\n\n/** The last good frame: the page's DOM, with chart canvases as pixels. */\ninterface Frame {\n nodes: Node[];\n pixels: HTMLCanvasElement[];\n}\n\nfunction capture(root: HTMLElement): Frame {\n return {\n nodes: Array.from(root.childNodes).map((n) => n.cloneNode(true)),\n pixels: Array.from(root.querySelectorAll(\"canvas\")).map((c) => {\n const copy = document.createElement(\"canvas\");\n copy.width = c.width;\n copy.height = c.height;\n // A canvas not laid out yet (0x0) can't be drawn from.\n if (c.width && c.height) copy.getContext(\"2d\")?.drawImage(c, 0, 0);\n return copy;\n }),\n };\n}\n\nfunction restore(holder: HTMLElement | null, frame: Frame) {\n if (!holder) return;\n holder.replaceChildren(...frame.nodes.map((n) => n.cloneNode(true)));\n holder.querySelectorAll(\"canvas\").forEach((c, i) => {\n const px = frame.pixels[i];\n if (!px?.width || !px.height) return;\n c.width = px.width;\n c.height = px.height;\n c.getContext(\"2d\")?.drawImage(px, 0, 0);\n });\n}\n\nfunction HoldReady() {\n useDesignReady(false);\n return null;\n}\n\ninterface LastGoodFrameProps {\n children: ReactNode;\n frame: { current: Frame | null };\n resetKey: unknown;\n onError?: (error: Error) => void;\n errorFallback: (error: Error) => ReactNode;\n}\n\n/** On a render error, shows the last good frame (or `errorFallback`) and holds readiness back. */\ninterface LastGoodFrameState {\n error: Error | null;\n resetKey: unknown;\n}\n\nclass LastGoodFrame extends Component<LastGoodFrameProps, LastGoodFrameState> {\n state: LastGoodFrameState = { error: null, resetKey: this.props.resetKey };\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n // A new resetKey retries: render the children again.\n static getDerivedStateFromProps(\n props: LastGoodFrameProps,\n state: LastGoodFrameState,\n ): Partial<LastGoodFrameState> | null {\n return props.resetKey === state.resetKey\n ? null\n : { error: null, resetKey: props.resetKey };\n }\n componentDidCatch(error: Error) {\n this.props.onError?.(error);\n }\n render() {\n const { error } = this.state;\n if (!error) return this.props.children;\n const frame = this.props.frame.current;\n return (\n <>\n <HoldReady />\n {frame ? (\n <div\n data-design-last-good=\"\"\n style={{ display: \"contents\" }}\n ref={(el) => restore(el, frame)}\n />\n ) : (\n <div data-design-error=\"\" style={{ display: \"contents\" }}>\n {this.props.errorFallback(error)}\n </div>\n )}\n </>\n );\n }\n}\n\nconst defaultErrorFallback = (error: Error) => (\n <pre className=\"text-destructive p-4 whitespace-pre-wrap\">\n Design page failed to render: {error.message}\n </pre>\n);\n\nexport interface DesignPageProps {\n children: ReactNode;\n /** Called with each render error the page hits. */\n onError?: (error: Error) => void;\n /** Changing it retries rendering after an error (e.g. after a hot update). */\n resetKey?: unknown;\n /** Shown for an error before anything rendered. Defaults to the message. */\n errorFallback?: (error: Error) => ReactNode;\n}\n\n/**\n * The shell the `design()` plugin renders every `/design` page in: the app's\n * theme from the first paint, and the last good frame instead of a broken one.\n */\nexport function DesignPage({\n children,\n onError,\n resetKey,\n errorFallback = defaultErrorFallback,\n}: DesignPageProps) {\n useDesignTheme();\n const root = useRef<HTMLDivElement>(null);\n const frame = useRef<Frame | null>(null);\n // Hot updates re-render the page without this component: copy every frame.\n useLayoutEffect(() => {\n const el = root.current;\n if (!el) return;\n // Only what the page rendered, not an error or a restored copy.\n const keep = () => {\n if (!el.querySelector(\"[data-design-last-good], [data-design-error]\")) {\n frame.current = capture(el);\n }\n };\n // The first frame is already in place: no mutation reports it.\n if (el.childNodes.length > 0) keep();\n let pending = false;\n const observer = new MutationObserver(() => {\n if (pending) return;\n pending = true;\n requestAnimationFrame(() => {\n pending = false;\n keep();\n });\n });\n observer.observe(el, {\n subtree: true,\n childList: true,\n characterData: true,\n attributes: true,\n });\n return () => observer.disconnect();\n }, []);\n return (\n <div\n ref={root}\n data-design-page=\"\"\n className=\"bg-background text-foreground min-h-screen\"\n >\n <LastGoodFrame\n frame={frame}\n resetKey={resetKey}\n onError={onError}\n errorFallback={errorFallback}\n >\n {children}\n </LastGoodFrame>\n </div>\n );\n}\n\nexport type DraftPlaceholderKind = \"chart\" | \"table\" | \"card\" | \"generic\";\n\n/** Skeleton the `design()` plugin shows for a component a streaming draft hasn't defined yet. */\nexport function DraftPlaceholder({\n kind = \"generic\",\n}: {\n kind?: DraftPlaceholderKind;\n}) {\n if (kind === \"chart\") {\n return (\n <div\n data-draft-placeholder=\"chart\"\n className=\"flex h-56 items-end gap-2 p-4\"\n >\n {[40, 65, 50, 80, 60, 90, 70].map((h) => (\n <Skeleton key={h} className=\"flex-1\" style={{ height: `${h}%` }} />\n ))}\n </div>\n );\n }\n if (kind === \"table\") {\n return (\n <div data-draft-placeholder=\"table\" className=\"space-y-2 p-4\">\n <Skeleton className=\"h-6 w-full\" />\n {[0, 1, 2, 3].map((r) => (\n <Skeleton key={r} className=\"h-4 w-full opacity-70\" />\n ))}\n </div>\n );\n }\n if (kind === \"card\") {\n return (\n <div\n data-draft-placeholder=\"card\"\n className=\"space-y-3 rounded-xl border p-4\"\n >\n <Skeleton className=\"h-4 w-1/3\" />\n <Skeleton className=\"h-8 w-1/2\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n );\n }\n return (\n <div data-draft-placeholder=\"generic\" className=\"space-y-2 p-2\">\n <Skeleton className=\"h-4 w-3/4\" />\n <Skeleton className=\"h-4 w-1/2\" />\n </div>\n );\n}\n"],"mappings":"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"}
@@ -0,0 +1,19 @@
1
+ //#region src/react/hooks/use-design-ready.d.ts
2
+ /**
3
+ * Holds back a page's readiness (`/design/__status`, `appkit:design-ready`,
4
+ * `appkit:app-ready`) while `ready` is `false`, for content the page can't
5
+ * detect on its own. Does nothing without the `design()` plugin's dev scripts.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * function TripsChart() {
10
+ * const { data, loading } = useAnalyticsQuery("trips_per_day", {});
11
+ * useDesignReady(!loading && data != null);
12
+ * return <LineChart data={data ?? []} />;
13
+ * }
14
+ * ```
15
+ */
16
+ declare function useDesignReady(ready?: boolean): void;
17
+ //#endregion
18
+ export { useDesignReady };
19
+ //# sourceMappingURL=use-design-ready.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-design-ready.d.ts","names":[],"sources":["../../../src/react/hooks/use-design-ready.ts"],"mappings":";;AAsBA;;;;;;;;;;;;;iBAAgB,cAAA,CAAe,KAAA"}
@@ -0,0 +1,33 @@
1
+ import { useLayoutEffect } from "react";
2
+
3
+ //#region src/react/hooks/use-design-ready.ts
4
+ /**
5
+ * Holds back a page's readiness (`/design/__status`, `appkit:design-ready`,
6
+ * `appkit:app-ready`) while `ready` is `false`, for content the page can't
7
+ * detect on its own. Does nothing without the `design()` plugin's dev scripts.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * function TripsChart() {
12
+ * const { data, loading } = useAnalyticsQuery("trips_per_day", {});
13
+ * useDesignReady(!loading && data != null);
14
+ * return <LineChart data={data ?? []} />;
15
+ * }
16
+ * ```
17
+ */
18
+ function useDesignReady(ready = true) {
19
+ useLayoutEffect(() => {
20
+ if (ready) return;
21
+ const host = window.__appkitDesign;
22
+ if (!host) return;
23
+ host.blockers++;
24
+ return () => {
25
+ host.blockers--;
26
+ host.changed?.();
27
+ };
28
+ }, [ready]);
29
+ }
30
+
31
+ //#endregion
32
+ export { useDesignReady };
33
+ //# sourceMappingURL=use-design-ready.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-design-ready.js","names":[],"sources":["../../../src/react/hooks/use-design-ready.ts"],"sourcesContent":["import { useLayoutEffect } from \"react\";\n\n/** CONTRACT: same key and shape as `window.__appkitDesign` in the design plugin's vite-plugin.ts. */\ninterface DesignHost {\n blockers: number;\n changed?: () => void;\n}\n\n/**\n * Holds back a page's readiness (`/design/__status`, `appkit:design-ready`,\n * `appkit:app-ready`) while `ready` is `false`, for content the page can't\n * detect on its own. Does nothing without the `design()` plugin's dev scripts.\n *\n * @example\n * ```tsx\n * function TripsChart() {\n * const { data, loading } = useAnalyticsQuery(\"trips_per_day\", {});\n * useDesignReady(!loading && data != null);\n * return <LineChart data={data ?? []} />;\n * }\n * ```\n */\nexport function useDesignReady(ready = true): void {\n useLayoutEffect(() => {\n if (ready) return;\n const host = (window as { __appkitDesign?: DesignHost }).__appkitDesign;\n if (!host) return;\n host.blockers++;\n return () => {\n host.blockers--;\n host.changed?.();\n };\n }, [ready]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,SAAgB,eAAe,QAAQ,MAAY;AACjD,uBAAsB;AACpB,MAAI,MAAO;EACX,MAAM,OAAQ,OAA2C;AACzD,MAAI,CAAC,KAAM;AACX,OAAK;AACL,eAAa;AACX,QAAK;AACL,QAAK,WAAW;;IAEjB,CAAC,MAAM,CAAC"}
@@ -4,7 +4,7 @@ import { MetricViewColumnDisplay } from "../shared/src/metric-metadata.js";
4
4
  import { DATE_FIELD_PATTERNS, METADATA_DATE_PATTERNS, NAME_FIELD_PATTERNS } from "../js/constants.js";
5
5
  import { formatLabel } from "../js/format/index.js";
6
6
  import { AnalyticsFormat, GrainsForSelectedTimeDims, InferDimensionKeys, InferMeasureKeys, InferMetricRow, InferResultByFormat, InferRowType, InferServingChunk, InferServingRequest, InferServingResponse, InferTimeDimensionKeys, InferTimeGrains, MetricKey, MetricRegistry, PickMetricRow, PluginRegistry, QueryRegistry, ServingAlias, ServingEndpointRegistry, TypedArrowTable, UseAnalyticsQueryOptions, UseAnalyticsQueryResult, UseMetricViewOptions, UseMetricViewResult, WarehouseState, WarehouseStatus } from "./hooks/types.js";
7
- import { AreaChartProps, AreaChartSpecificProps, BarChartProps, BarChartSpecificProps, ChartBaseProps, ChartClickDatum, ChartColorPalette, ChartData, ChartType, ChartUITokens, ChartValueFormatter, DataFormat, DataProps, DonutChartProps, HeatmapChartProps, HeatmapChartSpecificProps, LineChartProps, LineChartSpecificProps, NormalizedChartData, NormalizedChartDataBase, Orientation, PieChartProps, PieChartSpecificProps, QueryProps, RadarChartProps, RadarChartSpecificProps, ScatterChartProps, ScatterChartSpecificProps, UnifiedChartProps, isArrowTable, isDataProps, isQueryProps } from "./charts/types.js";
7
+ import { AreaChartProps, AreaChartSpecificProps, BarChartProps, BarChartSpecificProps, ChartBaseProps, ChartClickDatum, ChartColorPalette, ChartData, ChartDataInput, ChartRow, ChartType, ChartUITokens, ChartValueFormatter, DataFormat, DataProps, DonutChartProps, HeatmapChartProps, HeatmapChartSpecificProps, LineChartProps, LineChartSpecificProps, NormalizedChartData, NormalizedChartDataBase, Orientation, PieChartProps, PieChartSpecificProps, QueryProps, RadarChartProps, RadarChartSpecificProps, ScatterChartProps, ScatterChartSpecificProps, UnifiedChartProps, isArrowTable, isDataProps, isQueryProps } from "./charts/types.js";
8
8
  import { AreaChart } from "./charts/area/index.js";
9
9
  import { BarChart } from "./charts/bar/index.js";
10
10
  import { HeatmapChart } from "./charts/heatmap/index.js";
@@ -111,4 +111,4 @@ import "./ui/index.js";
111
111
  import { Variant, VariantProps } from "./ui-variants/variant.js";
112
112
  import { Variants, VariantsProps } from "./ui-variants/variants.js";
113
113
  import "./ui-variants/index.js";
114
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgentChatEvent, AggregatedResourceStatus, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnalyticsFormat, AreaChart, AreaChartProps, AreaChartSpecificProps, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, BarChart, BarChartProps, BarChartSpecificProps, BaseChart, BaseChartProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHART_COLOR_VARS, CHART_COLOR_VARS_CATEGORICAL, CHART_COLOR_VARS_DIVERGING, CHART_COLOR_VARS_SEQUENTIAL, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CartesianContext, ChartBaseProps, ChartClickDatum, ChartColorPalette, ChartData, ChartInference, ChartType, ChartUITokens, ChartValueFormatter, ChartWrapper, ChartWrapperProps, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, ColumnCategory, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DATE_FIELD_PATTERNS, DataFormat, DataProps, DataTable, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectoryEntry, DirectoryList, DirectoryListProps, DonutChart, DonutChartProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, FALLBACK_COLORS_CATEGORICAL, FALLBACK_COLORS_DIVERGING, FALLBACK_COLORS_SEQUENTIAL, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FileBreadcrumb, FileBreadcrumbProps, FileBrowserLabels, FileEntry, FileEntryProps, FilePreview, FilePreviewPanel, FilePreviewPanelProps, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GenieAttachmentResponse, GenieChat, GenieChatInput, GenieChatMessage, GenieChatMessageList, GenieChatProps, GenieChatStatus, GenieColumnMeta, GenieMessageItem, GenieMessageResponse, GenieQueryVisualization, GenieStatementResponse, GenieStreamEvent, GrainsForSelectedTimeDims, HeatmapChart, HeatmapChartProps, HeatmapChartSpecificProps, HeatmapContext, HoverCard, HoverCardContent, HoverCardTrigger, InferDimensionKeys, InferMeasureKeys, InferMetricRow, InferResultByFormat, InferRowType, InferServingChunk, InferServingRequest, InferServingResponse, InferTimeDimensionKeys, InferTimeGrains, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, Label, LineChart, LineChartProps, LineChartSpecificProps, LoadingSkeleton, METADATA_DATE_PATTERNS, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MetricFilter, MetricFilterOperatorName, MetricKey, MetricOrderBy, MetricOrderDirection, MetricPredicate, MetricRegistry, MetricViewColumnDisplay, NAME_FIELD_PATTERNS, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NewFolderInput, NewFolderInputProps, NormalizedChartData, NormalizedChartDataBase, NormalizedHeatmapData, OptionBuilderContext, Orientation, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PickMetricRow, PieChart, PieChartProps, PieChartSpecificProps, PluginRegistry, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PortalContainerContext, PortalContainerProvider, Progress, QueryProps, QueryRegistry, RadarChart, RadarChartProps, RadarChartSpecificProps, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResourceKindRenderer, ResourceSeverity, ResourceStatus, ResourceStatusFilter, ResourceStatusIndicator, ResourceStatusIndicatorProps, ResourceStatusProvider, ResourceStatusProviderProps, ResourceStatusToasterOptions, ResourceWaitingPlaceholder, ScatterChart, ScatterChartProps, ScatterChartSpecificProps, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, ServingAlias, ServingEndpointRegistry, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Spinner, Switch, TERMINAL_STATUSES, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransformedGenieData, TypedArrowTable, UnifiedChartProps, UseAgentChatOptions, UseAgentChatResult, UseAnalyticsQueryOptions, UseAnalyticsQueryResult, UseChartDataOptions, UseChartDataResult, UseGenieChatOptions, UseGenieChatReturn, UseMetricViewOptions, UseMetricViewResult, UseServingInvokeOptions, UseServingInvokeResult, UseServingStreamOptions, UseServingStreamResult, Variant, VariantProps, Variants, VariantsProps, WarehouseState, WarehouseStatus, applySelectionEmphasis, badgeVariants, buildCartesianOption, buildHeatmapOption, buildHorizontalBarOption, buildPieOption, buildRadarOption, buttonGroupVariants, buttonVariants, cn, createChart, createTimeSeriesData, formatFileSize, formatLabel, getCompatibleChartTypes, inferChartType, isArrowTable, isDataProps, isQueryProps, navigationMenuTriggerStyle, normalizeChartData, normalizeHeatmapData, sortTimeSeriesAscending, toChartArray, toChartValue, toggleVariants, transformGenieData, truncateLabel, useAgentChat, useAllThemeColors, useAnalyticsQuery, useChartData, useChartUITokens, useFormField, useGenieChat, useIsMobile, useMetricView, usePluginClientConfig, usePortalContainer, useResolvedPortalContainer, useResourceStatus, useResourceStatusPublisher, useResourceStatusToaster, useServingInvoke, useServingStream, useSidebar, useThemeColors };
114
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgentChatEvent, AggregatedResourceStatus, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnalyticsFormat, AreaChart, AreaChartProps, AreaChartSpecificProps, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, BarChart, BarChartProps, BarChartSpecificProps, BaseChart, BaseChartProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHART_COLOR_VARS, CHART_COLOR_VARS_CATEGORICAL, CHART_COLOR_VARS_DIVERGING, CHART_COLOR_VARS_SEQUENTIAL, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CartesianContext, ChartBaseProps, ChartClickDatum, ChartColorPalette, ChartData, ChartDataInput, ChartInference, ChartRow, ChartType, ChartUITokens, ChartValueFormatter, ChartWrapper, ChartWrapperProps, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, ColumnCategory, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DATE_FIELD_PATTERNS, DataFormat, DataProps, DataTable, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectoryEntry, DirectoryList, DirectoryListProps, DonutChart, DonutChartProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, FALLBACK_COLORS_CATEGORICAL, FALLBACK_COLORS_DIVERGING, FALLBACK_COLORS_SEQUENTIAL, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FileBreadcrumb, FileBreadcrumbProps, FileBrowserLabels, FileEntry, FileEntryProps, FilePreview, FilePreviewPanel, FilePreviewPanelProps, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GenieAttachmentResponse, GenieChat, GenieChatInput, GenieChatMessage, GenieChatMessageList, GenieChatProps, GenieChatStatus, GenieColumnMeta, GenieMessageItem, GenieMessageResponse, GenieQueryVisualization, GenieStatementResponse, GenieStreamEvent, GrainsForSelectedTimeDims, HeatmapChart, HeatmapChartProps, HeatmapChartSpecificProps, HeatmapContext, HoverCard, HoverCardContent, HoverCardTrigger, InferDimensionKeys, InferMeasureKeys, InferMetricRow, InferResultByFormat, InferRowType, InferServingChunk, InferServingRequest, InferServingResponse, InferTimeDimensionKeys, InferTimeGrains, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, Label, LineChart, LineChartProps, LineChartSpecificProps, LoadingSkeleton, METADATA_DATE_PATTERNS, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MetricFilter, MetricFilterOperatorName, MetricKey, MetricOrderBy, MetricOrderDirection, MetricPredicate, MetricRegistry, MetricViewColumnDisplay, NAME_FIELD_PATTERNS, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NewFolderInput, NewFolderInputProps, NormalizedChartData, NormalizedChartDataBase, NormalizedHeatmapData, OptionBuilderContext, Orientation, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PickMetricRow, PieChart, PieChartProps, PieChartSpecificProps, PluginRegistry, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PortalContainerContext, PortalContainerProvider, Progress, QueryProps, QueryRegistry, RadarChart, RadarChartProps, RadarChartSpecificProps, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResourceKindRenderer, ResourceSeverity, ResourceStatus, ResourceStatusFilter, ResourceStatusIndicator, ResourceStatusIndicatorProps, ResourceStatusProvider, ResourceStatusProviderProps, ResourceStatusToasterOptions, ResourceWaitingPlaceholder, ScatterChart, ScatterChartProps, ScatterChartSpecificProps, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, ServingAlias, ServingEndpointRegistry, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Spinner, Switch, TERMINAL_STATUSES, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransformedGenieData, TypedArrowTable, UnifiedChartProps, UseAgentChatOptions, UseAgentChatResult, UseAnalyticsQueryOptions, UseAnalyticsQueryResult, UseChartDataOptions, UseChartDataResult, UseGenieChatOptions, UseGenieChatReturn, UseMetricViewOptions, UseMetricViewResult, UseServingInvokeOptions, UseServingInvokeResult, UseServingStreamOptions, UseServingStreamResult, Variant, VariantProps, Variants, VariantsProps, WarehouseState, WarehouseStatus, applySelectionEmphasis, badgeVariants, buildCartesianOption, buildHeatmapOption, buildHorizontalBarOption, buildPieOption, buildRadarOption, buttonGroupVariants, buttonVariants, cn, createChart, createTimeSeriesData, formatFileSize, formatLabel, getCompatibleChartTypes, inferChartType, isArrowTable, isDataProps, isQueryProps, navigationMenuTriggerStyle, normalizeChartData, normalizeHeatmapData, sortTimeSeriesAscending, toChartArray, toChartValue, toggleVariants, transformGenieData, truncateLabel, useAgentChat, useAllThemeColors, useAnalyticsQuery, useChartData, useChartUITokens, useFormField, useGenieChat, useIsMobile, useMetricView, usePluginClientConfig, usePortalContainer, useResolvedPortalContainer, useResourceStatus, useResourceStatusPublisher, useResourceStatusToaster, useServingInvoke, useServingStream, useSidebar, useThemeColors };
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","names":[],"sources":["../../../../shared/src/plugin.ts"],"mappings":";;;;;;;KAgVY,iBAAA,GAAoB,MAAA;;KAGpB,eAAA,GAAkB,MAAA,SAAe,iBAAA;;KAGjC,mBAAA,GAAsB,MAAA,SAAe,MAAA"}
1
+ {"version":3,"file":"plugin.d.ts","names":[],"sources":["../../../../shared/src/plugin.ts"],"mappings":";;;;;;;KAmVY,iBAAA,GAAoB,MAAA;;KAGpB,eAAA,GAAkB,MAAA,SAAe,iBAAA;;KAGjC,mBAAA,GAAsB,MAAA,SAAe,MAAA"}
@@ -0,0 +1,6 @@
1
+ # Variable: design
2
+
3
+ ```ts
4
+ const design: ToPlugin<typeof DesignPlugin, DesignConfig | undefined, "design">;
5
+
6
+ ```
@@ -52,12 +52,12 @@ Supports both query mode (queryKey + parameters) and data mode (static data).
52
52
  | `parameters` | `Record<string, unknown>` | | - | Query parameters passed to the analytics endpoint |
53
53
  | `format` | `"auto" \| "json_array" \| "arrow_stream" \| "json" \| "arrow"` | | `"auto"` | Data format to use - "json\_array": Use JSON format (smaller payloads, simpler) - "arrow\_stream": Use Arrow format (faster for large datasets) - "auto": Automatically select based on expected data size |
54
54
  | `transformer` | `(<T>(data: T) => T)` | | - | Transform raw data before rendering |
55
- | `data` | `ChartData` | | - | Arrow Table or JSON array |
55
+ | `data` | `ChartDataInput` | | - | Arrow Table or JSON array |
56
56
  | `title` | `string` | | - | Chart title |
57
57
  | `showLegend` | `boolean` | | - | Show legend |
58
58
  | `colorPalette` | `"categorical" \| "sequential" \| "diverging"` | | - | 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 |
59
59
  | `colors` | `string[]` | | - | Custom colors for series (overrides colorPalette) |
60
- | `height` | `number` | | `300` | Chart height in pixels |
60
+ | `height` | `number` | | - | Chart height in pixels. Defaults to filling its parent (see `chartSizeStyle`). |
61
61
  | `className` | `string` | | - | Additional CSS classes |
62
62
  | `xKey` | `string` | | - | X-axis field key. Auto-detected from schema if not provided. |
63
63
  | `yKey` | `string \| string[]` | | - | Y-axis field key(s). Auto-detected from schema if not provided. |
@@ -49,12 +49,12 @@ Supports both query mode (queryKey + parameters) and data mode (static data).
49
49
  | `parameters` | `Record<string, unknown>` | | - | Query parameters passed to the analytics endpoint |
50
50
  | `format` | `"auto" \| "json_array" \| "arrow_stream" \| "json" \| "arrow"` | | `"auto"` | Data format to use - "json\_array": Use JSON format (smaller payloads, simpler) - "arrow\_stream": Use Arrow format (faster for large datasets) - "auto": Automatically select based on expected data size |
51
51
  | `transformer` | `(<T>(data: T) => T)` | | - | Transform raw data before rendering |
52
- | `data` | `ChartData` | | - | Arrow Table or JSON array |
52
+ | `data` | `ChartDataInput` | | - | Arrow Table or JSON array |
53
53
  | `title` | `string` | | - | Chart title |
54
54
  | `showLegend` | `boolean` | | - | Show legend |
55
55
  | `colorPalette` | `"categorical" \| "sequential" \| "diverging"` | | - | 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 |
56
56
  | `colors` | `string[]` | | - | Custom colors for series (overrides colorPalette) |
57
- | `height` | `number` | | `300` | Chart height in pixels |
57
+ | `height` | `number` | | - | Chart height in pixels. Defaults to filling its parent (see `chartSizeStyle`). |
58
58
  | `className` | `string` | | - | Additional CSS classes |
59
59
  | `xKey` | `string` | | - | X-axis field key. Auto-detected from schema if not provided. |
60
60
  | `yKey` | `string \| string[]` | | - | Y-axis field key(s). Auto-detected from schema if not provided. |
@@ -46,12 +46,12 @@ Supports both query mode (queryKey + parameters) and data mode (static data).
46
46
  | `parameters` | `Record<string, unknown>` | | - | Query parameters passed to the analytics endpoint |
47
47
  | `format` | `"auto" \| "json_array" \| "arrow_stream" \| "json" \| "arrow"` | | `"auto"` | Data format to use - "json\_array": Use JSON format (smaller payloads, simpler) - "arrow\_stream": Use Arrow format (faster for large datasets) - "auto": Automatically select based on expected data size |
48
48
  | `transformer` | `(<T>(data: T) => T)` | | - | Transform raw data before rendering |
49
- | `data` | `ChartData` | | - | Arrow Table or JSON array |
49
+ | `data` | `ChartDataInput` | | - | Arrow Table or JSON array |
50
50
  | `title` | `string` | | - | Chart title |
51
51
  | `showLegend` | `boolean` | | - | Show legend |
52
52
  | `colorPalette` | `"categorical" \| "sequential" \| "diverging"` | | - | 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 |
53
53
  | `colors` | `string[]` | | - | Custom colors for series (overrides colorPalette) |
54
- | `height` | `number` | | `300` | Chart height in pixels |
54
+ | `height` | `number` | | - | Chart height in pixels. Defaults to filling its parent (see `chartSizeStyle`). |
55
55
  | `className` | `string` | | - | Additional CSS classes |
56
56
  | `xKey` | `string` | | - | X-axis field key. Auto-detected from schema if not provided. |
57
57
  | `yKey` | `string \| string[]` | | - | Y-axis field key(s). Auto-detected from schema if not provided. |
@@ -64,12 +64,12 @@ Supports both query mode (queryKey + parameters) and data mode (static data).
64
64
  | `parameters` | `Record<string, unknown>` | | - | Query parameters passed to the analytics endpoint |
65
65
  | `format` | `"auto" \| "json_array" \| "arrow_stream" \| "json" \| "arrow"` | | `"auto"` | Data format to use - "json\_array": Use JSON format (smaller payloads, simpler) - "arrow\_stream": Use Arrow format (faster for large datasets) - "auto": Automatically select based on expected data size |
66
66
  | `transformer` | `(<T>(data: T) => T)` | | - | Transform raw data before rendering |
67
- | `data` | `ChartData` | | - | Arrow Table or JSON array |
67
+ | `data` | `ChartDataInput` | | - | Arrow Table or JSON array |
68
68
  | `title` | `string` | | - | Chart title |
69
69
  | `showLegend` | `boolean` | | - | Show legend |
70
70
  | `colorPalette` | `"categorical" \| "sequential" \| "diverging"` | | - | 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 |
71
71
  | `colors` | `string[]` | | - | Custom colors for series (overrides colorPalette) |
72
- | `height` | `number` | | `300` | Chart height in pixels |
72
+ | `height` | `number` | | - | Chart height in pixels. Defaults to filling its parent (see `chartSizeStyle`). |
73
73
  | `className` | `string` | | - | Additional CSS classes |
74
74
  | `xKey` | `string` | | - | X-axis field key. Auto-detected from schema if not provided. |
75
75
  | `yKey` | `string \| string[]` | | - | Y-axis field key(s). Auto-detected from schema if not provided. |
@@ -51,12 +51,12 @@ Supports both query mode (queryKey + parameters) and data mode (static data).
51
51
  | `parameters` | `Record<string, unknown>` | | - | Query parameters passed to the analytics endpoint |
52
52
  | `format` | `"auto" \| "json_array" \| "arrow_stream" \| "json" \| "arrow"` | | `"auto"` | Data format to use - "json\_array": Use JSON format (smaller payloads, simpler) - "arrow\_stream": Use Arrow format (faster for large datasets) - "auto": Automatically select based on expected data size |
53
53
  | `transformer` | `(<T>(data: T) => T)` | | - | Transform raw data before rendering |
54
- | `data` | `ChartData` | | - | Arrow Table or JSON array |
54
+ | `data` | `ChartDataInput` | | - | Arrow Table or JSON array |
55
55
  | `title` | `string` | | - | Chart title |
56
56
  | `showLegend` | `boolean` | | - | Show legend |
57
57
  | `colorPalette` | `"categorical" \| "sequential" \| "diverging"` | | - | 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 |
58
58
  | `colors` | `string[]` | | - | Custom colors for series (overrides colorPalette) |
59
- | `height` | `number` | | `300` | Chart height in pixels |
59
+ | `height` | `number` | | - | Chart height in pixels. Defaults to filling its parent (see `chartSizeStyle`). |
60
60
  | `className` | `string` | | - | Additional CSS classes |
61
61
  | `xKey` | `string` | | - | X-axis field key. Auto-detected from schema if not provided. |
62
62
  | `yKey` | `string \| string[]` | | - | Y-axis field key(s). Auto-detected from schema if not provided. |
@@ -46,12 +46,12 @@ Supports both query mode (queryKey + parameters) and data mode (static data).
46
46
  | `parameters` | `Record<string, unknown>` | | - | Query parameters passed to the analytics endpoint |
47
47
  | `format` | `"auto" \| "json_array" \| "arrow_stream" \| "json" \| "arrow"` | | `"auto"` | Data format to use - "json\_array": Use JSON format (smaller payloads, simpler) - "arrow\_stream": Use Arrow format (faster for large datasets) - "auto": Automatically select based on expected data size |
48
48
  | `transformer` | `(<T>(data: T) => T)` | | - | Transform raw data before rendering |
49
- | `data` | `ChartData` | | - | Arrow Table or JSON array |
49
+ | `data` | `ChartDataInput` | | - | Arrow Table or JSON array |
50
50
  | `title` | `string` | | - | Chart title |
51
51
  | `showLegend` | `boolean` | | - | Show legend |
52
52
  | `colorPalette` | `"categorical" \| "sequential" \| "diverging"` | | - | 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 |
53
53
  | `colors` | `string[]` | | - | Custom colors for series (overrides colorPalette) |
54
- | `height` | `number` | | `300` | Chart height in pixels |
54
+ | `height` | `number` | | - | Chart height in pixels. Defaults to filling its parent (see `chartSizeStyle`). |
55
55
  | `className` | `string` | | - | Additional CSS classes |
56
56
  | `xKey` | `string` | | - | X-axis field key. Auto-detected from schema if not provided. |
57
57
  | `yKey` | `string \| string[]` | | - | Y-axis field key(s). Auto-detected from schema if not provided. |
@@ -50,12 +50,12 @@ Supports both query mode (queryKey + parameters) and data mode (static data).
50
50
  | `parameters` | `Record<string, unknown>` | | - | Query parameters passed to the analytics endpoint |
51
51
  | `format` | `"auto" \| "json_array" \| "arrow_stream" \| "json" \| "arrow"` | | `"auto"` | Data format to use - "json\_array": Use JSON format (smaller payloads, simpler) - "arrow\_stream": Use Arrow format (faster for large datasets) - "auto": Automatically select based on expected data size |
52
52
  | `transformer` | `(<T>(data: T) => T)` | | - | Transform raw data before rendering |
53
- | `data` | `ChartData` | | - | Arrow Table or JSON array |
53
+ | `data` | `ChartDataInput` | | - | Arrow Table or JSON array |
54
54
  | `title` | `string` | | - | Chart title |
55
55
  | `showLegend` | `boolean` | | - | Show legend |
56
56
  | `colorPalette` | `"categorical" \| "sequential" \| "diverging"` | | - | 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 |
57
57
  | `colors` | `string[]` | | - | Custom colors for series (overrides colorPalette) |
58
- | `height` | `number` | | `300` | Chart height in pixels |
58
+ | `height` | `number` | | - | Chart height in pixels. Defaults to filling its parent (see `chartSizeStyle`). |
59
59
  | `className` | `string` | | - | Additional CSS classes |
60
60
  | `xKey` | `string` | | - | X-axis field key. Auto-detected from schema if not provided. |
61
61
  | `yKey` | `string \| string[]` | | - | Y-axis field key(s). Auto-detected from schema if not provided. |
@@ -52,12 +52,12 @@ Supports both query mode (queryKey + parameters) and data mode (static data).
52
52
  | `parameters` | `Record<string, unknown>` | | - | Query parameters passed to the analytics endpoint |
53
53
  | `format` | `"auto" \| "json_array" \| "arrow_stream" \| "json" \| "arrow"` | | `"auto"` | Data format to use - "json\_array": Use JSON format (smaller payloads, simpler) - "arrow\_stream": Use Arrow format (faster for large datasets) - "auto": Automatically select based on expected data size |
54
54
  | `transformer` | `(<T>(data: T) => T)` | | - | Transform raw data before rendering |
55
- | `data` | `ChartData` | | - | Arrow Table or JSON array |
55
+ | `data` | `ChartDataInput` | | - | Arrow Table or JSON array |
56
56
  | `title` | `string` | | - | Chart title |
57
57
  | `showLegend` | `boolean` | | - | Show legend |
58
58
  | `colorPalette` | `"categorical" \| "sequential" \| "diverging"` | | - | 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 |
59
59
  | `colors` | `string[]` | | - | Custom colors for series (overrides colorPalette) |
60
- | `height` | `number` | | `300` | Chart height in pixels |
60
+ | `height` | `number` | | - | Chart height in pixels. Defaults to filling its parent (see `chartSizeStyle`). |
61
61
  | `className` | `string` | | - | Additional CSS classes |
62
62
  | `xKey` | `string` | | - | X-axis field key. Auto-detected from schema if not provided. |
63
63
  | `yKey` | `string \| string[]` | | - | Y-axis field key(s). Auto-detected from schema if not provided. |
@@ -189,6 +189,7 @@ Documentation merge entry for Typedoc — combines the stable `@databricks/appki
189
189
  | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
190
190
  | [agents](./docs/api/appkit/Variable.agents.md) | Plugin factory for the agents plugin. Discovers agents from `server/agents/<id>/agent.{ts,md}` by default (markdown still in `config/agents/` is read as a deprecated fallback), resolves toolkits/tools from registered plugins, exposes the `appkit.agents.*` runtime API and mounts `POST /invocations` and `POST /responses` (aliased non-streaming invoke endpoints) plus `POST /chat` (streaming, HITL-capable). |
191
191
  | [aiSearch](./docs/api/appkit/Variable.aiSearch.md) | - |
192
+ | [design](./docs/api/appkit/Variable.design.md) | - |
192
193
  | [READ\_ACTIONS](./docs/api/appkit/Variable.READ_ACTIONS.md) | Actions that only read data. |
193
194
  | [sql](./docs/api/appkit/Variable.sql.md) | SQL helper namespace |
194
195
  | [SUPERVISOR\_EXTENSION\_KEY](./docs/api/appkit/Variable.SUPERVISOR_EXTENSION_KEY.md) | Namespace key under which the adapter reads its hosted-tool payload from [AgentInput.extensions](./docs/api/appkit/Interface.AgentInput.md#extensions). Exported so the agents plugin and standalone `runAgent` (the producers) can write under the same key the adapter reads. |
@@ -691,6 +691,14 @@ When multiple series share one value axis, its ticks use the first `yKey`; each
691
691
 
692
692
  The `selected` prop adds declarative emphasis only to bar, pie, and donut charts. Line, area, scatter, heatmap, and radar charts ignore it because category-selection semantics are not defined for those chart types.
693
693
 
694
+ **Chart size.** By default a chart fills its container's height, so it fits the card or grid cell it's placed in, and is at least 160px tall when the container's height comes from its content. In a fixed-height card, give the chart's parent the remaining space (e.g. `className="flex-1 min-h-0"` on `CardContent` in a `flex flex-col` card). Pass `height` (pixels) for an exact size instead:
695
+
696
+ ```tsx
697
+ <BarChart data={rows} xKey="city" yKey="trips" /> {/* fills its container */}
698
+ <BarChart data={rows} xKey="city" yKey="trips" height={208} /> {/* exactly 208px */}
699
+
700
+ ```
701
+
694
702
  **[Plotly](https://plotly.com/javascript/)** — pass the numeric specifier as `tickformat` and the literal currency symbol as `tickprefix`. Keeping them separate is necessary because d3's `$` marker is locale-driven and cannot represent arbitrary symbols:
695
703
 
696
704
  ```tsx