@bicharts/chart-host 0.5.21 → 0.5.22
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.
|
@@ -1020,6 +1020,11 @@ var ESM_EXPORT_DECL = /^([ \t]*)export[ \t]+(?=(?:async[ \t]+)?function\b|const\
|
|
|
1020
1020
|
function stripEsmExports(code) {
|
|
1021
1021
|
return String(code || "").replace(ESM_EXPORT_CLAUSE, "").replace(ESM_EXPORT_DECL, "$1");
|
|
1022
1022
|
}
|
|
1023
|
+
function writableD3(d3) {
|
|
1024
|
+
if (d3 == null || typeof d3 !== "object") return d3;
|
|
1025
|
+
if (Object.isExtensible(d3)) return d3;
|
|
1026
|
+
return { ...d3 };
|
|
1027
|
+
}
|
|
1023
1028
|
function compileRenderFn(code, win, doc, d3) {
|
|
1024
1029
|
const body = stripEsmExports(code) + "\n;return (typeof render === 'function') ? render : null;";
|
|
1025
1030
|
let factory;
|
|
@@ -1032,7 +1037,7 @@ function compileRenderFn(code, win, doc, d3) {
|
|
|
1032
1037
|
"[@bicharts/chart-host] the generated code could not be COMPILED, so nothing was drawn. This path evaluates the chart as a code string, which cannot contain ES-module syntax" + (modular ? " \u2014 and this code still has `import`/`export` in it after the export clause was stripped. Either request the plain form from the generator, or `import` the module yourself and pass the render function directly." : ".") + " Original error: " + msg
|
|
1033
1038
|
);
|
|
1034
1039
|
}
|
|
1035
|
-
const fn = factory.call(null, null, null, null, win, doc, d3);
|
|
1040
|
+
const fn = factory.call(null, null, null, null, win, doc, writableD3(d3));
|
|
1036
1041
|
if (typeof fn !== "function") throw new Error("generated code did not define render(container, data, options)");
|
|
1037
1042
|
return fn;
|
|
1038
1043
|
}
|
package/dist/index.mjs
CHANGED
package/dist/react.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.22",
|
|
4
4
|
"description": "Run a BIC-generated D3 chart in any web host: compiles the generated render() function, applies the shared option defaults, resolves mark clicks (through tooltip overlays), owns the selection affordance, and translates row indices between cross-filtered charts. The same contract the BIC Power BI visual implements, minus Power BI. React bindings at @bicharts/chart-host/react.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|