@bicharts/chart-host 0.5.50 → 0.5.51
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.
- package/dist/react.mjs +2 -1
- package/dist/types/react.d.ts +10 -0
- package/package.json +1 -1
package/dist/react.mjs
CHANGED
|
@@ -49,6 +49,7 @@ function BicChart(props) {
|
|
|
49
49
|
options,
|
|
50
50
|
d3,
|
|
51
51
|
geoKind,
|
|
52
|
+
viewState,
|
|
52
53
|
id,
|
|
53
54
|
filteredBy,
|
|
54
55
|
respondsWith,
|
|
@@ -89,7 +90,7 @@ function BicChart(props) {
|
|
|
89
90
|
useLayoutEffect(() => {
|
|
90
91
|
const el = ref.current;
|
|
91
92
|
if (!el || !code && !renderFn || !data) return;
|
|
92
|
-
const host = createChartHost(el, { code, renderFn, data, options, d3, geoKind });
|
|
93
|
+
const host = createChartHost(el, { code, renderFn, data, options, d3, geoKind, viewState });
|
|
93
94
|
hostRef.current = host;
|
|
94
95
|
const off = host.selection.onChange((payloadIdxs, source) => {
|
|
95
96
|
if (source === "host") return;
|
package/dist/types/react.d.ts
CHANGED
|
@@ -15,6 +15,16 @@ export interface BicChartProps {
|
|
|
15
15
|
d3: any;
|
|
16
16
|
/** Attach the bundled geometry for this kind as options.geo (choropleth or basemap). */
|
|
17
17
|
geoKind?: string;
|
|
18
|
+
/**
|
|
19
|
+
* WHERE THIS APP KEEPS THE CHART'S RESTING VIEW-STATE - a sort, an expanded row, a 3D
|
|
20
|
+
* camera. Omit for the session store parked on the container element, which is the right
|
|
21
|
+
* answer for most pages: the chart remembers while it is mounted and forgets on reload.
|
|
22
|
+
*
|
|
23
|
+
* Supply one to outlive the page. A React app is the host that most often has somewhere
|
|
24
|
+
* better to put it - localStorage, a URL query, a user profile on the server - and no
|
|
25
|
+
* default could pick between them, which is why this is a prop rather than a flag.
|
|
26
|
+
*/
|
|
27
|
+
viewState?: ChartHostConfig["viewState"];
|
|
18
28
|
/** Identity within a <BicChartGroup> — the key other charts filter by. */
|
|
19
29
|
id?: string;
|
|
20
30
|
/** Take this group member's selection as a filter on THIS chart's rows. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.51",
|
|
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",
|