@sqlrooms/vega 0.5.0 → 0.6.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.
@@ -1 +1 @@
1
- {"version":3,"file":"VegaLiteChart.js","sourceRoot":"","sources":["../src/VegaLiteChart.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,gBAAgB,EAAE,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAC,EAAE,EAAE,wBAAwB,EAAC,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAoB,MAAM,YAAY,CAAC;AAEvD,MAAM,SAAS,GAAG,aAAa,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,CAAC,MAAM,aAAa,GAOrB,CAAC,EACJ,SAAS,EACT,KAAK,GAAG,MAAM,EACd,MAAM,GAAG,MAAM,EACf,WAAW,GAAG,CAAC,GAAG,CAAC,EACnB,QAAQ,EACR,IAAI,GACL,EAAE,EAAE;IACH,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,wBAAwB,CAAC;QAC1C,YAAY;QACZ,KAAK;QACL,MAAM;QACN,WAAW;KACZ,CAAC,CAAC;IAEH,MAAM,EAAC,IAAI,EAAC,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,EAA2B,CAAC;IAE5D,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE;QAC/B,MAAM,MAAM,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC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AM,SAAS,GAAG,KAAK,IAAI,EAAE;YAC3B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC1C,OAAO,CAAC,EAAC,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAC,CAAC,CAAC;QACnD,CAAC,CAAC;QACF,SAAS,EAAE,CAAC;IACd,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,cACE,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,EAAE,CACX,mDAAmD,EACnD,SAAS,CACV,YAEA,WAAW,IAAI,IAAI,IAAI,KAAC,QAAQ,IAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,GAAI,GAC/D,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {arrowTableToJson, useDuckDb} from '@sqlrooms/duckdb';\nimport {cn, useAspectRatioDimensions} from '@sqlrooms/ui';\nimport {safeJsonParse} from '@sqlrooms/utils';\nimport {useEffect, useMemo, useRef, useState} from 'react';\nimport {VegaLite, VisualizationSpec} from 'react-vega';\n\nconst DATA_NAME = 'queryResult';\n\n/**\n * A component that renders a Vega-Lite chart with SQL data and responsive sizing.\n *\n * The chart can be sized in multiple ways:\n * - Fixed dimensions: Provide both width and height as numbers\n * - Fixed width, proportional height: Provide width as number, height as 'auto'\n * - Fixed height, proportional width: Provide height as number, width as 'auto'\n * - Fully responsive: Leave both as 'auto' (default), chart will fill container while maintaining aspect ratio\n *\n * @param props - The component props\n * @param {number | 'auto'} [props.width='auto'] - The chart width in pixels, or 'auto' to use container width\n * @param {number | 'auto'} [props.height='auto'] - The chart height in pixels, or 'auto' to calculate from aspect ratio\n * @param {number} [props.aspectRatio=3/2] - The desired width-to-height ratio when dimensions are auto-calculated\n * @param {string} props.sqlQuery - The SQL query to fetch data for the chart\n * @param {string | VisualizationSpec} props.spec - The Vega-Lite specification for the chart.\n * Can be either a JSON string or a VisualizationSpec object.\n * The data and size properties will be overridden by the component.\n *\n * @returns The rendered chart component\n *\n * @example\n * // Fixed size chart\n * <VegaLiteChart\n * width={600}\n * height={400}\n * sqlQuery=\"SELECT category, count(*) as count FROM sales GROUP BY category\"\n * spec={{\n * mark: 'bar',\n * encoding: {\n * x: {field: 'category', type: 'nominal'},\n * y: {field: 'count', type: 'quantitative'}\n * }\n * }}\n * />\n *\n * @example\n * // Responsive chart with 16:9 aspect ratio\n * <VegaLiteChart\n * className=\"max-w-[600px]\"\n * aspectRatio={16/9}\n * sqlQuery=\"SELECT date, value FROM metrics\"\n * spec={{\n * mark: 'line',\n * encoding: {\n * x: {field: 'date', type: 'temporal'},\n * y: {field: 'value', type: 'quantitative'}\n * }\n * }}\n * />\n */\nexport const VegaLiteChart: React.FC<{\n className?: string;\n width?: number | 'auto';\n height?: number | 'auto';\n aspectRatio?: number;\n sqlQuery: string;\n spec: string | VisualizationSpec;\n}> = ({\n className,\n width = 'auto',\n height = 'auto',\n aspectRatio = 3 / 2,\n sqlQuery,\n spec,\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const dimensions = useAspectRatioDimensions({\n containerRef,\n width,\n height,\n aspectRatio,\n });\n\n const {conn} = useDuckDb();\n const [data, setData] = useState<Record<string, unknown>>();\n\n const refinedSpec = useMemo(() => {\n const parsed = typeof spec === 'string' ? safeJsonParse(spec) : spec;\n if (!parsed) return null;\n return {\n ...parsed,\n data: {name: DATA_NAME},\n width: dimensions.width,\n height: dimensions.height,\n autosize: {\n type: 'fit',\n contains: 'padding',\n },\n } as VisualizationSpec;\n }, [spec, dimensions]);\n\n useEffect(() => {\n const fetchData = async () => {\n const result = await conn.query(sqlQuery);\n setData({[DATA_NAME]: arrowTableToJson(result)});\n };\n fetchData();\n }, [sqlQuery, conn]);\n\n return (\n <div\n ref={containerRef}\n className={cn(\n 'w-full h-full flex flex-col gap-2 overflow-hidden',\n className,\n )}\n >\n {refinedSpec && data && <VegaLite spec={refinedSpec} data={data} />}\n </div>\n );\n};\n"]}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC","sourcesContent":["export {VegaLiteChart} from './VegaLiteChart';\nexport type {VisualizationSpec} from 'react-vega';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sqlrooms/vega",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "module": "dist/index.js",
@@ -19,9 +19,9 @@
19
19
  "access": "public"
20
20
  },
21
21
  "dependencies": {
22
- "@sqlrooms/duckdb": "0.5.0",
23
- "@sqlrooms/ui": "0.5.0",
24
- "@sqlrooms/utils": "0.5.0",
22
+ "@sqlrooms/duckdb": "0.6.0",
23
+ "@sqlrooms/ui": "0.6.0",
24
+ "@sqlrooms/utils": "0.6.0",
25
25
  "react-vega": "^7.6.0",
26
26
  "vega": "^5.31.0",
27
27
  "vega-lite": "^5.23.0"
@@ -36,5 +36,5 @@
36
36
  "lint": "eslint .",
37
37
  "typedoc": "typedoc"
38
38
  },
39
- "gitHead": "2a27ef8a774f934c8150dce57aac22699fb6d22f"
39
+ "gitHead": "f46dfe6b5d135e1a039b49b3ba71cda7150eab0f"
40
40
  }
@@ -1,50 +0,0 @@
1
- /**
2
- * Represents the dimensions of a chart
3
- * @interface ChartDimensions
4
- * @property {number} width - The width of the chart in pixels
5
- * @property {number} height - The height of the chart in pixels
6
- */
7
- export interface ChartDimensions {
8
- width: number;
9
- height: number;
10
- }
11
- /**
12
- * Props for the useChartDimensions hook
13
- * @interface UseChartDimensionsProps
14
- * @property {number | 'auto'} width - The explicitly provided width, or 'auto' for container-based width
15
- * @property {number | 'auto'} height - The explicitly provided height, or 'auto' for aspect ratio-based height
16
- * @property {number} aspectRatio - The desired width-to-height ratio when dimensions are auto-calculated
17
- * @property {React.RefObject<HTMLElement>} containerRef - Reference to the container element
18
- */
19
- export interface UseChartDimensionsProps {
20
- width: number | 'auto';
21
- height: number | 'auto';
22
- aspectRatio: number;
23
- containerRef: React.RefObject<HTMLElement>;
24
- }
25
- /**
26
- * A hook that calculates chart dimensions based on provided values and container size
27
- *
28
- * This hook handles various combinations of width/height specifications:
29
- * - If both width and height are provided, uses those exact dimensions
30
- * - If only width is provided, calculates height using the aspect ratio
31
- * - If only height is provided, calculates width using the aspect ratio
32
- * - If both are 'auto', uses container width and calculates height using the aspect ratio
33
- *
34
- * @param {UseChartDimensionsProps} props - The input parameters for dimension calculation
35
- * @returns {ChartDimensions} The calculated width and height
36
- *
37
- * @example
38
- * ```tsx
39
- * const containerRef = useRef<HTMLDivElement>(null);
40
- * const {width, height} = useChartDimensions({
41
- * width: 'auto',
42
- * height: 'auto',
43
- * aspectRatio: 16/9,
44
- * containerRef
45
- * });
46
- * // Returns dimensions based on container size
47
- * ```
48
- */
49
- export declare function useChartDimensions({ width, height, aspectRatio, containerRef, }: UseChartDimensionsProps): ChartDimensions;
50
- //# sourceMappingURL=useChartDimensions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useChartDimensions.d.ts","sourceRoot":"","sources":["../../src/hooks/useChartDimensions.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;CAC5C;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,MAAM,EACN,WAAW,EACX,YAAY,GACb,EAAE,uBAAuB,GAAG,eAAe,CAoB3C"}
@@ -1,47 +0,0 @@
1
- import { useMemo } from 'react';
2
- import { useResizeObserver } from 'usehooks-ts';
3
- /**
4
- * A hook that calculates chart dimensions based on provided values and container size
5
- *
6
- * This hook handles various combinations of width/height specifications:
7
- * - If both width and height are provided, uses those exact dimensions
8
- * - If only width is provided, calculates height using the aspect ratio
9
- * - If only height is provided, calculates width using the aspect ratio
10
- * - If both are 'auto', uses container width and calculates height using the aspect ratio
11
- *
12
- * @param {UseChartDimensionsProps} props - The input parameters for dimension calculation
13
- * @returns {ChartDimensions} The calculated width and height
14
- *
15
- * @example
16
- * ```tsx
17
- * const containerRef = useRef<HTMLDivElement>(null);
18
- * const {width, height} = useChartDimensions({
19
- * width: 'auto',
20
- * height: 'auto',
21
- * aspectRatio: 16/9,
22
- * containerRef
23
- * });
24
- * // Returns dimensions based on container size
25
- * ```
26
- */
27
- export function useChartDimensions({ width, height, aspectRatio, containerRef, }) {
28
- const { width: containerWidth = 0 } = useResizeObserver({
29
- ref: containerRef,
30
- box: 'border-box',
31
- });
32
- return useMemo(() => {
33
- if (width !== 'auto' && height !== 'auto') {
34
- return { width, height };
35
- }
36
- if (width !== 'auto') {
37
- return { width, height: width / aspectRatio };
38
- }
39
- if (height !== 'auto') {
40
- return { width: height * aspectRatio, height };
41
- }
42
- const finalWidth = containerWidth;
43
- const finalHeight = finalWidth / aspectRatio;
44
- return { width: finalWidth, height: finalHeight };
45
- }, [containerWidth, aspectRatio, width, height]);
46
- }
47
- //# sourceMappingURL=useChartDimensions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useChartDimensions.js","sourceRoot":"","sources":["../../src/hooks/useChartDimensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAC,iBAAiB,EAAC,MAAM,aAAa,CAAC;AA4B9C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,KAAK,EACL,MAAM,EACN,WAAW,EACX,YAAY,GACY;IACxB,MAAM,EAAC,KAAK,EAAE,cAAc,GAAG,CAAC,EAAC,GAAG,iBAAiB,CAAC;QACpD,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;KAClB,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,IAAI,KAAK,KAAK,MAAM,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YAC1C,OAAO,EAAC,KAAK,EAAE,MAAM,EAAC,CAAC;QACzB,CAAC;QACD,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;YACrB,OAAO,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,WAAW,EAAC,CAAC;QAC9C,CAAC;QACD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACtB,OAAO,EAAC,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,MAAM,EAAC,CAAC;QAC/C,CAAC;QACD,MAAM,UAAU,GAAG,cAAc,CAAC;QAClC,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;QAC7C,OAAO,EAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAC,CAAC;IAClD,CAAC,EAAE,CAAC,cAAc,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AACnD,CAAC"}
@@ -1,16 +0,0 @@
1
- import { VisualizationSpec } from 'react-vega';
2
- /**
3
- * A component that renders a Vega-Lite chart.
4
- * @see Vega Lite Chart - https://vega.github.io/vega-lite/
5
- * @param props - The props for the component.
6
- * @returns The component.
7
- * @example
8
- * <VegaLiteChart sqlQuery="SELECT * FROM my_table" spec={spec} />
9
- */
10
- export declare const VegaLiteChart: React.FC<{
11
- width?: number;
12
- height?: number;
13
- sqlQuery: string;
14
- spec: string | VisualizationSpec;
15
- }>;
16
- //# sourceMappingURL=vega-lite-chart.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vega-lite-chart.d.ts","sourceRoot":"","sources":["../src/vega-lite-chart.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAW,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAIvD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC;CAClC,CAyBA,CAAC"}
@@ -1,38 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { safeJsonParse } from '@sqlrooms/utils';
3
- import { arrowTableToJson, useDuckDb } from '@sqlrooms/duckdb';
4
- import { useEffect, useMemo, useState } from 'react';
5
- import { VegaLite } from 'react-vega';
6
- const DATA_NAME = 'queryResult';
7
- /**
8
- * A component that renders a Vega-Lite chart.
9
- * @see Vega Lite Chart - https://vega.github.io/vega-lite/
10
- * @param props - The props for the component.
11
- * @returns The component.
12
- * @example
13
- * <VegaLiteChart sqlQuery="SELECT * FROM my_table" spec={spec} />
14
- */
15
- export const VegaLiteChart = ({ width, height, sqlQuery, spec }) => {
16
- const { conn } = useDuckDb();
17
- const [data, setData] = useState();
18
- const refinedSpec = useMemo(() => {
19
- const parsed = typeof spec === 'string' ? safeJsonParse(spec) : spec;
20
- if (!parsed)
21
- return null;
22
- return {
23
- ...parsed,
24
- data: { name: DATA_NAME },
25
- };
26
- }, [spec]);
27
- useEffect(() => {
28
- const fetchData = async () => {
29
- const result = await conn.query(sqlQuery);
30
- setData({ [DATA_NAME]: arrowTableToJson(result) });
31
- };
32
- fetchData();
33
- }, [sqlQuery, conn]);
34
- if (!refinedSpec || !data)
35
- return null;
36
- return (_jsx("div", { className: "w-full flex flex-col gap-2 overflow-hidden", children: _jsx(VegaLite, { spec: refinedSpec, data: data, width: width, height: height }) }));
37
- };
38
- //# sourceMappingURL=vega-lite-chart.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vega-lite-chart.js","sourceRoot":"","sources":["../src/vega-lite-chart.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,gBAAgB,EAAE,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAoB,MAAM,YAAY,CAAC;AAEvD,MAAM,SAAS,GAAG,aAAa,CAAC;AAEhC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAKrB,CAAC,EAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAC,EAAE,EAAE;IACvC,MAAM,EAAC,IAAI,EAAC,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,EAA2B,CAAC;IAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE;QAC/B,MAAM,MAAM,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACrE,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QACzB,OAAO;YACL,GAAG,MAAM;YACT,IAAI,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;SACH,CAAC;IACzB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACX,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,SAAS,GAAG,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