@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
@@ -42,7 +42,7 @@ import {
42
42
  requiredD3Plugins,
43
43
  resolveOptions,
44
44
  stripEsmExports
45
- } from "./chunk-QIF3TAVP.mjs";
45
+ } from "./chunk-65LTZEX6.mjs";
46
46
  import "./chunk-A2GMXZP7.mjs";
47
47
 
48
48
  // src/trivial.ts
package/dist/react.mjs CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  createChartHost,
5
5
  geoFromCache,
6
6
  loadGeo
7
- } from "./chunk-QIF3TAVP.mjs";
7
+ } from "./chunk-65LTZEX6.mjs";
8
8
  import "./chunk-A2GMXZP7.mjs";
9
9
 
10
10
  // src/react.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bicharts/chart-host",
3
- "version": "0.5.21",
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",