@bicharts/chart-host 0.5.20 → 0.5.21
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.
|
@@ -32,6 +32,7 @@ var ANIM_MAX_IDEAL_FRAMES_MAX = 500;
|
|
|
32
32
|
var COLOR_SCALE_SELF_CLAMP_PCT_DEFAULT = 95;
|
|
33
33
|
var COLOR_SCALE_SELF_CLAMP_PCT_MIN = 50;
|
|
34
34
|
var COLOR_SCALE_SELF_CLAMP_PCT_MAX = 100;
|
|
35
|
+
var FLIP_MODE_DEFAULT = "both";
|
|
35
36
|
|
|
36
37
|
// src/defaults.ts
|
|
37
38
|
var clamp = (n, lo, hi) => Math.max(lo, Math.min(hi, n));
|
|
@@ -102,11 +103,34 @@ function resolveOptions(p2) {
|
|
|
102
103
|
// value as "independent" and hand every deck twelve control strips. Absent means
|
|
103
104
|
// synced; only an explicit false switches it.
|
|
104
105
|
flipSync: p2.flipSync === void 0 || p2.flipSync === null ? true : !!p2.flipSync,
|
|
106
|
+
// WHERE the controls live, which is a different question from whether the cards move
|
|
107
|
+
// together (Joel 2026-08-13: "the ability to flip individual cards shouldn't necessarily
|
|
108
|
+
// stop being able to flip all together too"). Resolution order matters and is the whole
|
|
109
|
+
// back-compat story:
|
|
110
|
+
// 1. an explicit, recognised flipMode wins;
|
|
111
|
+
// 2. otherwise DERIVE from flipSync, so a chart generated before this option existed
|
|
112
|
+
// behaves exactly as it did - true -> "all", false -> "single";
|
|
113
|
+
// 3. and a caller that sends neither gets the default.
|
|
114
|
+
// Deriving rather than defaulting is the point: a cached chart must not change behaviour
|
|
115
|
+
// because a newer client shipped, and "both" would have done exactly that to every deck
|
|
116
|
+
// already in a report.
|
|
117
|
+
flipMode: (() => {
|
|
118
|
+
const m2 = (p2.flipMode == null ? "" : String(p2.flipMode)).toLowerCase();
|
|
119
|
+
if (m2 === "single" || m2 === "all" || m2 === "both") return m2;
|
|
120
|
+
if (p2.flipSync === false) return "single";
|
|
121
|
+
if (p2.flipSync === true) return "all";
|
|
122
|
+
return FLIP_MODE_DEFAULT;
|
|
123
|
+
})(),
|
|
105
124
|
// 0 is MEANINGFUL here (manual only) and is the default, so numberOr — not
|
|
106
125
|
// `|| DEFAULT` — for the same reason animLoopDelaySec uses it. Clamping stays
|
|
107
126
|
// chart-side: the archetype already clamps 500..120000 and two clamps in two
|
|
108
127
|
// repositories is how they end up disagreeing.
|
|
109
|
-
flipIntervalMs: Math.max(0, numberOr(p2.flipIntervalMs, 0))
|
|
128
|
+
flipIntervalMs: Math.max(0, numberOr(p2.flipIntervalMs, 0)),
|
|
129
|
+
// `raw || undefined`, the same idiom as the colour-scale endpoints and the map fills:
|
|
130
|
+
// blank must arrive as ABSENT, not as an empty string, because the chart's fallback is
|
|
131
|
+
// `options.cardBackgroundColor || <its own choice>` and "" would satisfy a truthiness
|
|
132
|
+
// test in some hands while painting nothing in others.
|
|
133
|
+
cardBackgroundColor: p2.cardBackgroundColor || void 0
|
|
110
134
|
};
|
|
111
135
|
}
|
|
112
136
|
|
|
@@ -1248,6 +1272,7 @@ export {
|
|
|
1248
1272
|
COLOR_SCALE_SELF_CLAMP_PCT_DEFAULT,
|
|
1249
1273
|
COLOR_SCALE_SELF_CLAMP_PCT_MIN,
|
|
1250
1274
|
COLOR_SCALE_SELF_CLAMP_PCT_MAX,
|
|
1275
|
+
FLIP_MODE_DEFAULT,
|
|
1251
1276
|
resolveOptions,
|
|
1252
1277
|
geoAssetFor,
|
|
1253
1278
|
loadGeo,
|
package/dist/index.mjs
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
CONTAINER_SLOT_XF_CLEAR,
|
|
18
18
|
DIM_OPACITY_DEFAULT,
|
|
19
19
|
DIM_OPACITY_VAR,
|
|
20
|
+
FLIP_MODE_DEFAULT,
|
|
20
21
|
GEO_POINT_PRECISIONS,
|
|
21
22
|
HOST_CONTAINER_CLASS,
|
|
22
23
|
HOST_CONTRACT_VERSION,
|
|
@@ -41,7 +42,7 @@ import {
|
|
|
41
42
|
requiredD3Plugins,
|
|
42
43
|
resolveOptions,
|
|
43
44
|
stripEsmExports
|
|
44
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-QIF3TAVP.mjs";
|
|
45
46
|
import "./chunk-A2GMXZP7.mjs";
|
|
46
47
|
|
|
47
48
|
// src/trivial.ts
|
|
@@ -338,6 +339,7 @@ export {
|
|
|
338
339
|
CONTAINER_SLOT_XF_CLEAR,
|
|
339
340
|
DIM_OPACITY_DEFAULT,
|
|
340
341
|
DIM_OPACITY_VAR,
|
|
342
|
+
FLIP_MODE_DEFAULT,
|
|
341
343
|
GEO_POINT_PRECISIONS,
|
|
342
344
|
HOST_CONTAINER_CLASS,
|
|
343
345
|
HOST_CONTRACT_VERSION,
|
package/dist/react.mjs
CHANGED
package/dist/types/contract.d.ts
CHANGED
|
@@ -32,6 +32,8 @@ export declare const COLOR_SCALE_SELF_CLAMP_PCT_DEFAULT = 95;
|
|
|
32
32
|
export declare const COLOR_SCALE_SELF_CLAMP_PCT_MIN = 50;
|
|
33
33
|
export declare const COLOR_SCALE_SELF_CLAMP_PCT_MAX = 100;
|
|
34
34
|
export type TimelineStyle = "" | "line" | "boxes";
|
|
35
|
+
export type FlipMode = "" | "single" | "all" | "both";
|
|
36
|
+
export declare const FLIP_MODE_DEFAULT: FlipMode;
|
|
35
37
|
export type ColorScaleScope = "" | "frame" | "self";
|
|
36
38
|
export interface RenderOptions {
|
|
37
39
|
width: number;
|
|
@@ -79,5 +81,7 @@ export interface RenderOptions {
|
|
|
79
81
|
animTimelineStyle?: TimelineStyle;
|
|
80
82
|
flipSync?: boolean;
|
|
81
83
|
flipIntervalMs?: number;
|
|
84
|
+
flipMode?: FlipMode;
|
|
85
|
+
cardBackgroundColor?: string;
|
|
82
86
|
onSelect?: (rowIdxs: number[]) => void;
|
|
83
87
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.21",
|
|
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",
|