@sqlrooms/mosaic 0.27.0-rc.0 → 0.27.0-rc.2
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":"VgPlotChart.d.ts","sourceRoot":"","sources":["../src/VgPlotChart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,IAAI,EAAC,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAC,EAAE,EAAoB,MAAM,OAAO,CAAC;AAE5C,KAAK,SAAS,GAAG;IAAC,IAAI,EAAE,IAAI,CAAA;CAAC,CAAC;AAC9B,KAAK,SAAS,GAAG;IAAC,IAAI,EAAE,WAAW,GAAG,aAAa,CAAA;CAAC,CAAC;AACrD,KAAK,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC;AAE9C,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,KAAK,IAAI,SAAS,CAEvE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,KAAK,IAAI,SAAS,CAEvE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"VgPlotChart.d.ts","sourceRoot":"","sources":["../src/VgPlotChart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,IAAI,EAAC,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAC,EAAE,EAAoB,MAAM,OAAO,CAAC;AAE5C,KAAK,SAAS,GAAG;IAAC,IAAI,EAAE,IAAI,CAAA;CAAC,CAAC;AAC9B,KAAK,SAAS,GAAG;IAAC,IAAI,EAAE,WAAW,GAAG,aAAa,CAAA;CAAC,CAAC;AACrD,KAAK,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC;AAE9C,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,KAAK,IAAI,SAAS,CAEvE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,KAAK,IAAI,SAAS,CAEvE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAqB5C,CAAC"}
|
package/dist/VgPlotChart.js
CHANGED
package/dist/VgPlotChart.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VgPlotChart.js","sourceRoot":"","sources":["../src/VgPlotChart.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAO,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAK,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAM5C,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,OAAO,MAAM,IAAI,KAAK,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,OAAO,MAAM,IAAI,KAAK,CAAC;AACzB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,KAAK,EAAE,EAAE;IACzD,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,SAAS,CAAC,GAAG,EAAE;QACb,CAAC,KAAK,IAAI,EAAE;YACV,
|
|
1
|
+
{"version":3,"file":"VgPlotChart.js","sourceRoot":"","sources":["../src/VgPlotChart.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAO,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAK,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAM5C,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,OAAO,MAAM,IAAI,KAAK,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,OAAO,MAAM,IAAI,KAAK,CAAC;AACzB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,KAAK,EAAE,EAAE;IACzD,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,SAAS,CAAC,GAAG,EAAE;QACb,CAAC,KAAK,IAAI,EAAE;YACV,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;gBACzB,IAAI,OAAoC,CAAC;gBACzC,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;oBACvB,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC;gBACvB,CAAC;qBAAM,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;oBAC9B,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;oBACxC,OAAO,GAAG,CAAC,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;gBAC1C,CAAC;qBAAM,CAAC;oBACN,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;oBACxC,OAAO,CAAC,SAAS,GAAG,8CAA8C,CAAC;gBACrE,CAAC;gBACD,YAAY,CAAC,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;YACjD,CAAC;QACH,CAAC,CAAC,EAAE,CAAC;IACP,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;IAE1B,OAAO,cAAK,GAAG,EAAE,YAAY,GAAI,CAAC;AACpC,CAAC,CAAC","sourcesContent":["import {astToDOM, parseSpec, Spec} from '@uwdata/mosaic-spec';\nimport {FC, useEffect, useRef} from 'react';\n\ntype SpecProps = {spec: Spec};\ntype PlotProps = {plot: HTMLElement | SVGSVGElement};\ntype VgPlotChartProps = SpecProps | PlotProps;\n\nexport function isSpecProps(props: VgPlotChartProps): props is SpecProps {\n return 'spec' in props;\n}\n\nexport function isPlotProps(props: VgPlotChartProps): props is PlotProps {\n return 'plot' in props;\n}\n\n/**\n * Renders a Vega-Lite chart using the Mosaic library.\n *\n * @param {VgPlotChartProps} props - The component props.\n * @param {Spec} props.spec - The Vega-Lite specification for the chart.\n * @returns {React.ReactElement} The rendered chart component.\n */\nexport const VgPlotChart: FC<VgPlotChartProps> = (props) => {\n const containerRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n (async () => {\n if (containerRef.current) {\n let element: HTMLElement | SVGSVGElement;\n if (isPlotProps(props)) {\n element = props.plot;\n } else if (isSpecProps(props)) {\n const ast = await parseSpec(props.spec);\n element = (await astToDOM(ast)).element;\n } else {\n element = document.createElement('div');\n element.innerHTML = 'Error: Invalid props provided to VgPlotChart';\n }\n containerRef.current?.replaceChildren(element);\n }\n })();\n }, [props, containerRef]);\n\n return <div ref={containerRef} />;\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqlrooms/mosaic",
|
|
3
|
-
"version": "0.27.0-rc.
|
|
3
|
+
"version": "0.27.0-rc.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@paralleldrive/cuid2": "^3.0.0",
|
|
23
|
-
"@sqlrooms/duckdb": "0.27.0-rc.
|
|
24
|
-
"@sqlrooms/room-shell": "0.27.0-rc.
|
|
23
|
+
"@sqlrooms/duckdb": "0.27.0-rc.2",
|
|
24
|
+
"@sqlrooms/room-shell": "0.27.0-rc.2",
|
|
25
25
|
"@uwdata/mosaic-core": "^0.21.0",
|
|
26
26
|
"@uwdata/mosaic-spec": "^0.21.0",
|
|
27
27
|
"@uwdata/mosaic-sql": "^0.21.0",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"typecheck": "tsc --noEmit",
|
|
41
41
|
"typedoc": "typedoc"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "eec06537352a9e760de21d7bcc77d9aa2db2a5ec"
|
|
44
44
|
}
|