@bicharts/chart-host 0.6.49 → 0.6.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.
|
@@ -4373,6 +4373,7 @@ function createChartGroup(columns, rows, opts = {}) {
|
|
|
4373
4373
|
let table = rows;
|
|
4374
4374
|
let geo = opts.geo ?? null;
|
|
4375
4375
|
let point = opts.point ?? null;
|
|
4376
|
+
let destination = opts.destination ?? null;
|
|
4376
4377
|
let selection = EMPTY6;
|
|
4377
4378
|
const subs = /* @__PURE__ */ new Set();
|
|
4378
4379
|
const members = /* @__PURE__ */ new Set();
|
|
@@ -4388,7 +4389,13 @@ function createChartGroup(columns, rows, opts = {}) {
|
|
|
4388
4389
|
const payloadFor = (sourceRowIdxs) => {
|
|
4389
4390
|
const idxs = sourceRowIdxs ? sourceRowIdxs.slice() : table.map((_4, i) => i);
|
|
4390
4391
|
const subset = idxs.map((i) => table[i]);
|
|
4391
|
-
const payload = buildRenderPayload(
|
|
4392
|
+
const payload = buildRenderPayload(
|
|
4393
|
+
cols,
|
|
4394
|
+
subset,
|
|
4395
|
+
geo ?? void 0,
|
|
4396
|
+
point ?? void 0,
|
|
4397
|
+
destination ?? void 0
|
|
4398
|
+
);
|
|
4392
4399
|
return { payload, rowMap: idxs };
|
|
4393
4400
|
};
|
|
4394
4401
|
const memberPayload = (id, o4 = {}) => payloadFor(o4.respondsWith === "highlight" ? null : incomingFor(id, o4.filteredBy));
|
|
@@ -4418,6 +4425,7 @@ function createChartGroup(columns, rows, opts = {}) {
|
|
|
4418
4425
|
table = nextRows;
|
|
4419
4426
|
geo = o4.geo ?? null;
|
|
4420
4427
|
point = o4.point ?? null;
|
|
4428
|
+
destination = o4.destination ?? null;
|
|
4421
4429
|
notify("source");
|
|
4422
4430
|
},
|
|
4423
4431
|
onChange(cb) {
|
package/dist/index.mjs
CHANGED
package/dist/react.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
loadGeo,
|
|
8
8
|
syncMemberSelection,
|
|
9
9
|
toSourceRows
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-P4FOCNAX.mjs";
|
|
11
11
|
import "./chunk-A2GMXZP7.mjs";
|
|
12
12
|
import "./chunk-GHODWOAL.mjs";
|
|
13
13
|
|
|
@@ -23,15 +23,15 @@ function useBicSelection() {
|
|
|
23
23
|
clear: () => g?.group.clear()
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function BicChartGroup({ rows, columns, geo, point, children }) {
|
|
26
|
+
function BicChartGroup({ rows, columns, geo, point, destination, children }) {
|
|
27
27
|
const groupRef = useRef(null);
|
|
28
|
-
if (!groupRef.current) groupRef.current = createChartGroup(columns, rows, { geo, point });
|
|
28
|
+
if (!groupRef.current) groupRef.current = createChartGroup(columns, rows, { geo, point, destination });
|
|
29
29
|
const group = groupRef.current;
|
|
30
30
|
const [sel, setSel] = useState(group.selection);
|
|
31
31
|
const source = useMemo(() => {
|
|
32
|
-
group.setSource(columns, rows, { geo, point });
|
|
32
|
+
group.setSource(columns, rows, { geo, point, destination });
|
|
33
33
|
return {};
|
|
34
|
-
}, [group, rows, columns, geo, point]);
|
|
34
|
+
}, [group, rows, columns, geo, point, destination]);
|
|
35
35
|
useEffect(() => group.onChange((s, change) => {
|
|
36
36
|
if (change !== "source") setSel(s);
|
|
37
37
|
}), [group]);
|
package/dist/types/group.d.ts
CHANGED
|
@@ -14,6 +14,12 @@ export interface ChartGroupSourceOptions {
|
|
|
14
14
|
} | null;
|
|
15
15
|
/** Point-map geocoding binding (city/state/zip/lat/lon column names). */
|
|
16
16
|
point?: GeoPointBinding | null;
|
|
17
|
+
/**
|
|
18
|
+
* A route's far end (an origin-destination flow map): `point` is then the origin. The same
|
|
19
|
+
* binding buildRenderPayload takes, so the group builds the destination columns too instead of
|
|
20
|
+
* leaving a hosted flow map with one end.
|
|
21
|
+
*/
|
|
22
|
+
destination?: GeoPointBinding | null;
|
|
17
23
|
}
|
|
18
24
|
/** How one member takes part in the group. */
|
|
19
25
|
export interface ChartGroupMemberOptions {
|
package/dist/types/react.d.ts
CHANGED
|
@@ -81,6 +81,8 @@ export interface BicChartGroupProps {
|
|
|
81
81
|
} | null;
|
|
82
82
|
/** Point-map geocoding binding (city/state/zip/lat/lon column names). */
|
|
83
83
|
point?: GeoPointBinding | null;
|
|
84
|
+
/** A route's far end (an origin-destination flow map); `point` is then the origin. */
|
|
85
|
+
destination?: GeoPointBinding | null;
|
|
84
86
|
children: ReactNode;
|
|
85
87
|
}
|
|
86
88
|
/**
|
|
@@ -88,7 +90,7 @@ export interface BicChartGroupProps {
|
|
|
88
90
|
* `filteredBy`; the group re-derives the filtered member's payload and translates row
|
|
89
91
|
* indices in both directions, so a click in one chart filters another CORRECTLY.
|
|
90
92
|
*/
|
|
91
|
-
export declare function BicChartGroup({ rows, columns, geo, point, children }: BicChartGroupProps): import("react").JSX.Element;
|
|
93
|
+
export declare function BicChartGroup({ rows, columns, geo, point, destination, children }: BicChartGroupProps): import("react").JSX.Element;
|
|
92
94
|
export declare function BicChart(props: BicChartProps): import("react").JSX.Element;
|
|
93
95
|
/**
|
|
94
96
|
* THE SIZE A CHART SHOULD DRAW AT: the element's measured box, kept current as it resizes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.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",
|