@sqlrooms/vega 0.26.0 → 0.26.1-rc.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":"VegaChartToolResult.d.ts","sourceRoot":"","sources":["../src/VegaChartToolResult.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAG7C,KAAK,wBAAwB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,iBAAiB,CAAC;CACjC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,QAAQ,EACR,YAAY,GACb,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"VegaChartToolResult.d.ts","sourceRoot":"","sources":["../src/VegaChartToolResult.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAG7C,KAAK,wBAAwB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,iBAAiB,CAAC;CACjC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,QAAQ,EACR,YAAY,GACb,EAAE,wBAAwB,2CAyD1B"}
|
|
@@ -12,6 +12,6 @@ import { VegaLiteChart } from './VegaLiteChart';
|
|
|
12
12
|
export function VegaChartToolResult({ className, sqlQuery, vegaLiteSpec, }) {
|
|
13
13
|
const result = useSql({ query: sqlQuery });
|
|
14
14
|
const popoverOpen = useDisclosure();
|
|
15
|
-
return (_jsx(_Fragment, { children: vegaLiteSpec && (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(QueryToolResult, { title: "", arrowTable: result.data?.arrowTable, sqlQuery: sqlQuery }), result.error ? (_jsxs(Popover, { open: popoverOpen.isOpen, onOpenChange: popoverOpen.onToggle, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "flex items-center gap-2
|
|
15
|
+
return (_jsx(_Fragment, { children: vegaLiteSpec && (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(QueryToolResult, { title: "", arrowTable: result.data?.arrowTable, sqlQuery: sqlQuery }), result.error ? (_jsxs(Popover, { open: popoverOpen.isOpen, onOpenChange: popoverOpen.onToggle, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "flex items-center gap-2 transition-colors", "aria-label": "Show error details", children: _jsx(TriangleAlertIcon, { className: "h-4 w-4" }) }) }), _jsx(PopoverContent, { align: "start", style: { width: '600px', maxWidth: '80%' }, children: _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("div", { className: "border-b text-sm font-medium", children: "Query Error" }), _jsx("div", { className: "whitespace-pre-wrap font-mono text-sm text-red-500", children: result.error?.message })] }) })] })) : result.isLoading ? (_jsxs("div", { className: "text-muted-foreground align-center flex gap-2 px-2", children: [_jsx("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-blue-600" }), "Running query for chart data\u2026"] })) : (_jsx(VegaLiteChart.ArrowChart, { className: cn(className), aspectRatio: 16 / 9, arrowTable: result.data?.arrowTable, spec: vegaLiteSpec }))] })) }));
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=VegaChartToolResult.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VegaChartToolResult.js","sourceRoot":"","sources":["../src/VegaChartToolResult.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,EACL,EAAE,EACF,OAAO,EACP,cAAc,EAC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K,SAAS,EAAC,qBAAqB,aAClC,KAAC,eAAe,IACd,KAAK,EAAC,EAAE,EACR,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,UAAU,EACnC,QAAQ,EAAE,QAAQ,GAClB,EACD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CACd,MAAC,OAAO,IACN,IAAI,EAAE,WAAW,CAAC,MAAM,EACxB,YAAY,EAAE,WAAW,CAAC,QAAQ,aAElC,KAAC,cAAc,IAAC,OAAO,kBACrB,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,2CAA2C,gBAC1C,oBAAoB,YAE/B,KAAC,iBAAiB,IAAC,SAAS,EAAC,SAAS,GAAG,GAClC,GACM,EACjB,KAAC,cAAc,IACb,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,EAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAC,YAExC,eAAK,SAAS,EAAC,qBAAqB,aAClC,cAAK,SAAS,EAAC,8BAA8B,4BAEvC,EACN,cAAK,SAAS,EAAC,oDAAoD,YAChE,MAAM,CAAC,KAAK,EAAE,OAAO,GAClB,IACF,GACS,IACT,CACX,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CACrB,eAAK,SAAS,EAAC,oDAAoD,aACjE,cAAK,SAAS,EAAC,8EAA8E,GAAO,0CAEhG,CACP,CAAC,CAAC,CAAC,CACF,KAAC,aAAa,CAAC,UAAU,IACvB,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EACxB,WAAW,EAAE,EAAE,GAAG,CAAC,EACnB,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,UAAU,EACnC,IAAI,EAAE,YAAY,GAClB,CACH,IACG,CACP,GACA,CACJ,CAAC;AACJ,CAAC","sourcesContent":["import {QueryToolResult} from '@sqlrooms/ai';\nimport {useSql} from '@sqlrooms/duckdb';\nimport {\n cn,\n Popover,\n PopoverContent,\n PopoverTrigger,\n useDisclosure,\n} from '@sqlrooms/ui';\nimport {TriangleAlertIcon} from 'lucide-react';\nimport {VisualizationSpec} from 'react-vega';\nimport {VegaLiteChart} from './VegaLiteChart';\n\ntype VegaChartToolResultProps = {\n className?: string;\n reasoning: string;\n sqlQuery: string;\n vegaLiteSpec: VisualizationSpec;\n};\n\n/**\n * Renders a chart tool call with visualization using Vega-Lite\n * @param {VegaChartToolResultProps} props - The component props\n * @returns {JSX.Element} The rendered chart tool call\n */\nexport function VegaChartToolResult({\n className,\n sqlQuery,\n vegaLiteSpec,\n}: VegaChartToolResultProps) {\n const result = useSql({query: sqlQuery});\n const popoverOpen = useDisclosure();\n return (\n <>\n {vegaLiteSpec && (\n <div className=\"flex flex-col gap-2\">\n <QueryToolResult\n title=\"\"\n arrowTable={result.data?.arrowTable}\n sqlQuery={sqlQuery}\n />\n {result.error ? (\n <Popover\n open={popoverOpen.isOpen}\n onOpenChange={popoverOpen.onToggle}\n >\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className=\"flex items-center gap-2 transition-colors\"\n aria-label=\"Show error details\"\n >\n <TriangleAlertIcon className=\"h-4 w-4\" />\n </button>\n </PopoverTrigger>\n <PopoverContent\n align=\"start\"\n style={{width: '600px', maxWidth: '80%'}}\n >\n <div className=\"flex flex-col gap-2\">\n <div className=\"border-b text-sm font-medium\">\n Query Error\n </div>\n <div className=\"whitespace-pre-wrap font-mono text-sm text-red-500\">\n {result.error?.message}\n </div>\n </div>\n </PopoverContent>\n </Popover>\n ) : result.isLoading ? (\n <div className=\"text-muted-foreground align-center flex gap-2 px-2\">\n <div className=\"h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-blue-600\"></div>\n Running query for chart data…\n </div>\n ) : (\n <VegaLiteChart.ArrowChart\n className={cn(className)}\n aspectRatio={16 / 9}\n arrowTable={result.data?.arrowTable}\n spec={vegaLiteSpec}\n />\n )}\n </div>\n )}\n </>\n );\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqlrooms/vega",
|
|
3
|
-
"version": "0.26.0",
|
|
3
|
+
"version": "0.26.1-rc.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@openassistant/utils": "1.0.0-alpha.0",
|
|
22
|
-
"@sqlrooms/ai": "0.26.0",
|
|
23
|
-
"@sqlrooms/duckdb": "0.26.0",
|
|
24
|
-
"@sqlrooms/ui": "0.26.0",
|
|
25
|
-
"@sqlrooms/utils": "0.26.0",
|
|
26
|
-
"lucide-react": "^0.
|
|
22
|
+
"@sqlrooms/ai": "0.26.1-rc.0",
|
|
23
|
+
"@sqlrooms/duckdb": "0.26.1-rc.0",
|
|
24
|
+
"@sqlrooms/ui": "0.26.1-rc.0",
|
|
25
|
+
"@sqlrooms/utils": "0.26.1-rc.0",
|
|
26
|
+
"lucide-react": "^0.555.0",
|
|
27
27
|
"react-vega": "^7.7.1",
|
|
28
28
|
"vega": "^6.2.0",
|
|
29
29
|
"vega-lite": "^6.4.0",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"typecheck": "tsc --noEmit",
|
|
42
42
|
"typedoc": "typedoc"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "89c252c460ccd29d108cfabf7b34c4a679f85609"
|
|
45
45
|
}
|