@bicharts/chart-host 0.5.35 → 0.5.37
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.
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-A2GMXZP7.mjs";
|
|
7
7
|
|
|
8
8
|
// src/contract.ts
|
|
9
|
-
var HOST_CONTRACT_VERSION = "1.
|
|
9
|
+
var HOST_CONTRACT_VERSION = "1.5.0";
|
|
10
10
|
var GEO_POINT_PRECISIONS = ["latlon", "city", "zip3", "state", "country"];
|
|
11
11
|
var MARK_CLASS = "d3-mark";
|
|
12
12
|
var LEGEND_MARK_CLASS = "d3-legend-mark";
|
|
@@ -16,6 +16,7 @@ var XFILTER_REFRESH_EVENT = "llm-xfilter-refresh";
|
|
|
16
16
|
var CONTAINER_SLOT_ANIM_STOP = "__llmAnimStop";
|
|
17
17
|
var CONTAINER_SLOT_XF_CLEAR = "__llmXfClear";
|
|
18
18
|
var CONTAINER_SLOT_INITIAL_XF_MARK = "__llmInitialXfMark";
|
|
19
|
+
var CONTAINER_SLOT_UI_STATE = "__lchUiState";
|
|
19
20
|
var HOST_CONTAINER_CLASS = "bic-chart-host";
|
|
20
21
|
var SELECTION_ACTIVE_CLASS = "lch-has-selection";
|
|
21
22
|
var MARK_SELECTED_CLASS = "lch-mark-selected";
|
|
@@ -1082,6 +1083,19 @@ function createChartHost(container, config) {
|
|
|
1082
1083
|
}
|
|
1083
1084
|
}
|
|
1084
1085
|
let raw = { ...config.options ?? {} };
|
|
1086
|
+
if (typeof raw.setUiState !== "function") {
|
|
1087
|
+
const holder = container;
|
|
1088
|
+
const existing = holder[CONTAINER_SLOT_UI_STATE];
|
|
1089
|
+
const store = existing && typeof existing === "object" ? existing : holder[CONTAINER_SLOT_UI_STATE] = {};
|
|
1090
|
+
if (raw.uiState && typeof raw.uiState === "object" && Object.keys(store).length === 0)
|
|
1091
|
+
Object.assign(store, raw.uiState);
|
|
1092
|
+
raw.uiState = store;
|
|
1093
|
+
raw.setUiState = (s) => {
|
|
1094
|
+
if (!s || typeof s !== "object") return;
|
|
1095
|
+
for (const k2 of Object.keys(store)) delete store[k2];
|
|
1096
|
+
Object.assign(store, s);
|
|
1097
|
+
};
|
|
1098
|
+
}
|
|
1085
1099
|
let resolved = resolveOptions(raw);
|
|
1086
1100
|
let renderFn = config.renderFn ?? null;
|
|
1087
1101
|
let destroyed = false;
|
|
@@ -1285,6 +1299,7 @@ export {
|
|
|
1285
1299
|
CONTAINER_SLOT_ANIM_STOP,
|
|
1286
1300
|
CONTAINER_SLOT_XF_CLEAR,
|
|
1287
1301
|
CONTAINER_SLOT_INITIAL_XF_MARK,
|
|
1302
|
+
CONTAINER_SLOT_UI_STATE,
|
|
1288
1303
|
HOST_CONTAINER_CLASS,
|
|
1289
1304
|
SELECTION_ACTIVE_CLASS,
|
|
1290
1305
|
MARK_SELECTED_CLASS,
|
package/dist/index.mjs
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
COLOR_SCALE_SELF_CLAMP_PCT_MIN,
|
|
15
15
|
CONTAINER_SLOT_ANIM_STOP,
|
|
16
16
|
CONTAINER_SLOT_INITIAL_XF_MARK,
|
|
17
|
+
CONTAINER_SLOT_UI_STATE,
|
|
17
18
|
CONTAINER_SLOT_XF_CLEAR,
|
|
18
19
|
DIM_OPACITY_DEFAULT,
|
|
19
20
|
DIM_OPACITY_VAR,
|
|
@@ -42,7 +43,7 @@ import {
|
|
|
42
43
|
requiredD3Plugins,
|
|
43
44
|
resolveOptions,
|
|
44
45
|
stripEsmExports
|
|
45
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-KT4RNDZ3.mjs";
|
|
46
47
|
import "./chunk-A2GMXZP7.mjs";
|
|
47
48
|
|
|
48
49
|
// src/trivial.ts
|
|
@@ -752,6 +753,7 @@ export {
|
|
|
752
753
|
COLOR_SCALE_SELF_CLAMP_PCT_MIN,
|
|
753
754
|
CONTAINER_SLOT_ANIM_STOP,
|
|
754
755
|
CONTAINER_SLOT_INITIAL_XF_MARK,
|
|
756
|
+
CONTAINER_SLOT_UI_STATE,
|
|
755
757
|
CONTAINER_SLOT_XF_CLEAR,
|
|
756
758
|
DIM_OPACITY_DEFAULT,
|
|
757
759
|
DIM_OPACITY_VAR,
|
package/dist/react.mjs
CHANGED
package/dist/types/contract.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const HOST_CONTRACT_VERSION = "1.
|
|
1
|
+
export declare const HOST_CONTRACT_VERSION = "1.5.0";
|
|
2
2
|
export type GeoPointPrecision = "latlon" | "city" | "zip3" | "state" | "country";
|
|
3
3
|
/** Every valid tier, ordered most precise → coarsest. Runtime form of GeoPointPrecision. */
|
|
4
4
|
export declare const GEO_POINT_PRECISIONS: readonly GeoPointPrecision[];
|
|
@@ -15,6 +15,7 @@ export declare const XFILTER_REFRESH_EVENT = "llm-xfilter-refresh";
|
|
|
15
15
|
export declare const CONTAINER_SLOT_ANIM_STOP = "__llmAnimStop";
|
|
16
16
|
export declare const CONTAINER_SLOT_XF_CLEAR = "__llmXfClear";
|
|
17
17
|
export declare const CONTAINER_SLOT_INITIAL_XF_MARK = "__llmInitialXfMark";
|
|
18
|
+
export declare const CONTAINER_SLOT_UI_STATE = "__lchUiState";
|
|
18
19
|
export declare const HOST_CONTAINER_CLASS = "bic-chart-host";
|
|
19
20
|
export declare const SELECTION_ACTIVE_CLASS = "lch-has-selection";
|
|
20
21
|
export declare const MARK_SELECTED_CLASS = "lch-mark-selected";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.37",
|
|
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",
|