@bicharts/chart-host 0.6.96 → 0.6.98
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/README.md +3 -0
- package/dist/card.mjs +2 -2
- package/dist/{chunk-6KACC7XH.mjs → chunk-B6BLSIID.mjs} +26 -0
- package/dist/{chunk-NQFJHNMC.mjs → chunk-KFU44UEN.mjs} +346 -316
- package/dist/{chunk-CJ4IG6G5.mjs → chunk-P6VCB6SF.mjs} +19 -19
- package/dist/{chunk-JPJSWL2H.mjs → chunk-SFDKACWG.mjs} +51 -21
- package/dist/{chunk-LFC5S4Z7.mjs → chunk-WSNDXS3Z.mjs} +1 -1
- package/dist/index.mjs +5 -5
- package/dist/page.mjs +2 -2
- package/dist/react.mjs +13 -9
- package/dist/types/lasso.d.ts +10 -0
- package/dist/types/payload.d.ts +5 -0
- package/dist/zoom-memory.mjs +3 -3
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/*! @bicharts/chart-host — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; Natural Earth and US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "./chunk-
|
|
3
|
+
It,
|
|
4
|
+
Nt,
|
|
5
|
+
j,
|
|
6
|
+
mi,
|
|
7
|
+
u,
|
|
8
|
+
ui
|
|
9
|
+
} from "./chunk-KFU44UEN.mjs";
|
|
10
10
|
|
|
11
11
|
// src/sourceDateFormat.ts
|
|
12
12
|
function formatSourceDate(raw, opts = {}) {
|
|
13
13
|
const d = toDate(raw);
|
|
14
14
|
if (!d) return null;
|
|
15
|
-
const dayFrame =
|
|
15
|
+
const dayFrame = u(d);
|
|
16
16
|
const frame = dayFrame ?? (opts.dialect === "dotnet" ? "local" : "utc");
|
|
17
17
|
const p = partsIn(d, frame);
|
|
18
18
|
const format = cleanFormat(opts.format, opts.dialect);
|
|
@@ -33,7 +33,7 @@ var ISO_LIKE_RE = /^\s*\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(
|
|
|
33
33
|
function toDate(raw) {
|
|
34
34
|
if (raw instanceof Date) return isNaN(raw.getTime()) ? null : raw;
|
|
35
35
|
if (typeof raw !== "string" || !ISO_LIKE_RE.test(raw)) return null;
|
|
36
|
-
const d =
|
|
36
|
+
const d = j(raw.trim());
|
|
37
37
|
return d && !isNaN(d.getTime()) ? d : null;
|
|
38
38
|
}
|
|
39
39
|
function partsIn(d, frame) {
|
|
@@ -225,15 +225,15 @@ function resolveAmbiguousM(tokens) {
|
|
|
225
225
|
if (t.kind !== "mAmbiguous1" && t.kind !== "mAmbiguous2") continue;
|
|
226
226
|
const two = t.kind === "mAmbiguous2";
|
|
227
227
|
let minute = false;
|
|
228
|
-
for (let
|
|
229
|
-
if (tokens[
|
|
230
|
-
minute = isHour(tokens[
|
|
228
|
+
for (let j2 = i - 1; j2 >= 0; j2--) {
|
|
229
|
+
if (tokens[j2].kind === "literal") continue;
|
|
230
|
+
minute = isHour(tokens[j2]);
|
|
231
231
|
break;
|
|
232
232
|
}
|
|
233
233
|
if (!minute) {
|
|
234
|
-
for (let
|
|
235
|
-
if (tokens[
|
|
236
|
-
minute = isSecond(tokens[
|
|
234
|
+
for (let j2 = i + 1; j2 < tokens.length; j2++) {
|
|
235
|
+
if (tokens[j2].kind === "literal") continue;
|
|
236
|
+
minute = isSecond(tokens[j2]);
|
|
237
237
|
break;
|
|
238
238
|
}
|
|
239
239
|
}
|
|
@@ -435,15 +435,15 @@ function displayText(col, raw, opts) {
|
|
|
435
435
|
return String(raw);
|
|
436
436
|
}
|
|
437
437
|
function isSuppressed(col) {
|
|
438
|
-
return
|
|
438
|
+
return It(col).suppressed;
|
|
439
439
|
}
|
|
440
440
|
function resolveAgg(col, requested, auto) {
|
|
441
441
|
const fallback = () => {
|
|
442
|
-
const d =
|
|
442
|
+
const d = ui(col);
|
|
443
443
|
return d === "first" ? "count" : d;
|
|
444
444
|
};
|
|
445
445
|
if (auto) return fallback();
|
|
446
|
-
return
|
|
446
|
+
return Nt(col).indexOf(requested) >= 0 ? requested : fallback();
|
|
447
447
|
}
|
|
448
448
|
function toNumber(v) {
|
|
449
449
|
if (v == null || v === "") return null;
|
|
@@ -546,7 +546,7 @@ function computeSelectionCard(payload, selectedRowIdxs, opts = {}) {
|
|
|
546
546
|
}
|
|
547
547
|
const value = reduce(selVals, colAgg, selRaw);
|
|
548
548
|
let sharePct = null;
|
|
549
|
-
if (
|
|
549
|
+
if (mi(col, colAgg) && value != null) {
|
|
550
550
|
const allVals = [];
|
|
551
551
|
const allRaw = [];
|
|
552
552
|
for (let r = 0; r < rows.length; r++) {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/*! @bicharts/chart-host — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; Natural Earth and US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
2
|
import {
|
|
3
3
|
LASSO_OUTLINE_CLASS,
|
|
4
|
+
claimParkedLasso,
|
|
4
5
|
installLasso,
|
|
5
6
|
lassoEffect
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-B6BLSIID.mjs";
|
|
7
8
|
import {
|
|
8
9
|
censusHitBands,
|
|
9
10
|
ensureCrossfilterHitTargets
|
|
@@ -35,10 +36,11 @@ import {
|
|
|
35
36
|
import {
|
|
36
37
|
Fn,
|
|
37
38
|
J3,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
Q,
|
|
40
|
+
Yn,
|
|
41
|
+
or,
|
|
42
|
+
tt
|
|
43
|
+
} from "./chunk-KFU44UEN.mjs";
|
|
42
44
|
import {
|
|
43
45
|
NA_ISO3,
|
|
44
46
|
NA_LAT_MAX,
|
|
@@ -266,10 +268,10 @@ function f(t) {
|
|
|
266
268
|
}
|
|
267
269
|
function rgbToLab(r, g, b) {
|
|
268
270
|
const R = linearise(r), G = linearise(g), B = linearise(b);
|
|
269
|
-
const
|
|
271
|
+
const X = 0.4124564 * R + 0.3575761 * G + 0.1804375 * B;
|
|
270
272
|
const Y = 0.2126729 * R + 0.7151522 * G + 0.072175 * B;
|
|
271
273
|
const Z = 0.0193339 * R + 0.119192 * G + 0.9503041 * B;
|
|
272
|
-
const fx = f(
|
|
274
|
+
const fx = f(X / Xn), fy = f(Y / Yn2), fz = f(Z / Zn);
|
|
273
275
|
return { L: 116 * fy - 16, a: 500 * (fx - fy), b: 200 * (fy - fz) };
|
|
274
276
|
}
|
|
275
277
|
function hexToLab(hex2) {
|
|
@@ -324,13 +326,13 @@ function labToHex(lab) {
|
|
|
324
326
|
return t3 > EPS ? t3 : (116 * t - 16) / KAPPA;
|
|
325
327
|
};
|
|
326
328
|
const fy = (lab.L + 16) / 116, fx = fy + lab.a / 500, fz = fy - lab.b / 200;
|
|
327
|
-
const
|
|
329
|
+
const X = Xn * finv(fx);
|
|
328
330
|
const Y = Yn2 * (lab.L > KAPPA * EPS ? fy * fy * fy : lab.L / KAPPA);
|
|
329
331
|
const Z = Zn * finv(fz);
|
|
330
332
|
const lin = [
|
|
331
|
-
3.2404542 *
|
|
332
|
-
-0.969266 *
|
|
333
|
-
0.0556434 *
|
|
333
|
+
3.2404542 * X - 1.5371385 * Y - 0.4985314 * Z,
|
|
334
|
+
-0.969266 * X + 1.8760108 * Y + 0.041556 * Z,
|
|
335
|
+
0.0556434 * X - 0.2040259 * Y + 1.0572252 * Z
|
|
334
336
|
];
|
|
335
337
|
return "#" + lin.map((v) => {
|
|
336
338
|
const c = Math.max(0, Math.min(1, v));
|
|
@@ -852,7 +854,7 @@ function resolvePointChannel(cols, rowObjs, point) {
|
|
|
852
854
|
let labelCol;
|
|
853
855
|
if (bind) {
|
|
854
856
|
const dims = cols.filter((c) => !c.isMeasure).map((c) => c.name);
|
|
855
|
-
const res =
|
|
857
|
+
const res = or(dims, rowObjs, bind, point?.mapKind, cols.map((c) => c.name));
|
|
856
858
|
bind = res.bind;
|
|
857
859
|
rolesBackfilled = res.backfilled;
|
|
858
860
|
rolesRefused = res.refused;
|
|
@@ -900,10 +902,16 @@ function buildRenderPayload(cols, rowObjs, geo, point, destination, opts) {
|
|
|
900
902
|
cols = cols.filter((c) => c.name !== ROW_IDX_COLUMN);
|
|
901
903
|
let utcDayColumns = null;
|
|
902
904
|
if (opts?.utcDays) {
|
|
903
|
-
const norm =
|
|
905
|
+
const norm = Q(cols, rowObjs);
|
|
904
906
|
rowObjs = norm.rows;
|
|
905
907
|
utcDayColumns = norm.columns;
|
|
906
908
|
}
|
|
909
|
+
let utcWallClockColumns = null;
|
|
910
|
+
if (opts?.localWallClock) {
|
|
911
|
+
const wall = tt(cols, rowObjs);
|
|
912
|
+
rowObjs = wall.rows;
|
|
913
|
+
utcWallClockColumns = wall.columns;
|
|
914
|
+
}
|
|
907
915
|
const o = resolvePointChannel(cols, rowObjs, point);
|
|
908
916
|
const d = resolvePointChannel(cols, rowObjs, destination);
|
|
909
917
|
const pLat = o.lat, pLon = o.lon, pPrec = o.prec;
|
|
@@ -994,7 +1002,8 @@ function buildRenderPayload(cols, rowObjs, geo, point, destination, opts) {
|
|
|
994
1002
|
// Survives a refusal that placed nothing — see geoPointRefused. Omitted when empty so
|
|
995
1003
|
// the ordinary case adds no bytes.
|
|
996
1004
|
...rolesRefused.length ? { geoPointRefused: rolesRefused } : {},
|
|
997
|
-
...utcDayColumns ? { dateCellsAreUtcDays: true, utcDayColumns } : {}
|
|
1005
|
+
...utcDayColumns ? { dateCellsAreUtcDays: true, utcDayColumns } : {},
|
|
1006
|
+
...utcWallClockColumns ? { dateCellsAreUtcWallClock: true, utcWallClockColumns } : {}
|
|
998
1007
|
};
|
|
999
1008
|
}
|
|
1000
1009
|
|
|
@@ -2037,6 +2046,12 @@ function compileRenderFn(code, win, doc, d3) {
|
|
|
2037
2046
|
var ASYNC_RENDER_TIMEOUT_MS = 15e3;
|
|
2038
2047
|
var isThenable = (v) => !!v && (typeof v === "object" || typeof v === "function") && typeof v.then === "function";
|
|
2039
2048
|
var dimVarPage = /* @__PURE__ */ new WeakMap();
|
|
2049
|
+
var readDimVar = (el) => {
|
|
2050
|
+
const s = el.style;
|
|
2051
|
+
if (!s || typeof s.getPropertyValue !== "function") return null;
|
|
2052
|
+
return { value: s.getPropertyValue(DIM_OPACITY_VAR) ?? "", priority: typeof s.getPropertyPriority === "function" ? s.getPropertyPriority(DIM_OPACITY_VAR) ?? "" : "" };
|
|
2053
|
+
};
|
|
2054
|
+
var sameDimVar = (a, b) => !!b && a.value === b.value && a.priority === b.priority;
|
|
2040
2055
|
function createChartHost(container, config) {
|
|
2041
2056
|
const doc = container.ownerDocument;
|
|
2042
2057
|
const win = doc?.defaultView ?? globalThis;
|
|
@@ -2056,6 +2071,15 @@ function createChartHost(container, config) {
|
|
|
2056
2071
|
}
|
|
2057
2072
|
}
|
|
2058
2073
|
let raw = { ...config.options ?? {} };
|
|
2074
|
+
let lassoKey = config.code;
|
|
2075
|
+
if (!lassoKey && typeof config.renderFn === "function") {
|
|
2076
|
+
try {
|
|
2077
|
+
lassoKey = Function.prototype.toString.call(config.renderFn);
|
|
2078
|
+
} catch {
|
|
2079
|
+
lassoKey = config.renderFn;
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
let lassoClaimed = false;
|
|
2059
2083
|
if (typeof raw.setUiState !== "function") {
|
|
2060
2084
|
const provider = config.viewState ?? sessionViewStateProvider(container);
|
|
2061
2085
|
let bag;
|
|
@@ -2064,6 +2088,8 @@ function createChartHost(container, config) {
|
|
|
2064
2088
|
} catch {
|
|
2065
2089
|
bag = {};
|
|
2066
2090
|
}
|
|
2091
|
+
claimParkedLasso(container, lassoKey, config.viewState ? null : bag);
|
|
2092
|
+
lassoClaimed = true;
|
|
2067
2093
|
if (raw.uiState && typeof raw.uiState === "object" && Object.keys(bag).length === 0)
|
|
2068
2094
|
Object.assign(bag, raw.uiState);
|
|
2069
2095
|
raw.uiState = bag;
|
|
@@ -2079,6 +2105,7 @@ function createChartHost(container, config) {
|
|
|
2079
2105
|
const out = resolveOptions(input);
|
|
2080
2106
|
return out.allowTooltips == null ? { ...out, allowTooltips: true } : out;
|
|
2081
2107
|
};
|
|
2108
|
+
if (!lassoClaimed) claimParkedLasso(container, lassoKey);
|
|
2082
2109
|
let resolved = resolveForHost(raw);
|
|
2083
2110
|
let renderFn = config.renderFn ?? null;
|
|
2084
2111
|
let destroyed = false;
|
|
@@ -2112,7 +2139,8 @@ function createChartHost(container, config) {
|
|
|
2112
2139
|
if (!page || --page.holders > 0) return;
|
|
2113
2140
|
dimVarPage.delete(container);
|
|
2114
2141
|
try {
|
|
2115
|
-
|
|
2142
|
+
const now = readDimVar(container);
|
|
2143
|
+
if (now && !sameDimVar(now, page.wrote)) return;
|
|
2116
2144
|
if (page.was) container.style?.setProperty(DIM_OPACITY_VAR, page.was.value, page.was.priority);
|
|
2117
2145
|
else container.style?.removeProperty(DIM_OPACITY_VAR);
|
|
2118
2146
|
} catch {
|
|
@@ -2200,16 +2228,18 @@ function createChartHost(container, config) {
|
|
|
2200
2228
|
if (typeof want === "number") {
|
|
2201
2229
|
const level = String(want);
|
|
2202
2230
|
let page = dimVarPage.get(container);
|
|
2231
|
+
const now = readDimVar(container);
|
|
2232
|
+
if (!page) {
|
|
2233
|
+
page = { was: now?.value ? now : null, holders: 0, wrote: null };
|
|
2234
|
+
dimVarPage.set(container, page);
|
|
2235
|
+
} else if (now && page.wrote && !sameDimVar(now, page.wrote)) {
|
|
2236
|
+
page.was = now.value ? now : null;
|
|
2237
|
+
}
|
|
2203
2238
|
if (!dimVarSet) {
|
|
2204
|
-
if (!page) {
|
|
2205
|
-
const value = container.style?.getPropertyValue?.(DIM_OPACITY_VAR) ?? "";
|
|
2206
|
-
page = { was: value ? { value, priority: container.style?.getPropertyPriority?.(DIM_OPACITY_VAR) ?? "" } : null, holders: 0, wrote: level };
|
|
2207
|
-
dimVarPage.set(container, page);
|
|
2208
|
-
}
|
|
2209
2239
|
page.holders++;
|
|
2210
2240
|
dimVarSet = true;
|
|
2211
2241
|
}
|
|
2212
|
-
|
|
2242
|
+
page.wrote = { value: level, priority: "" };
|
|
2213
2243
|
container.style?.setProperty(DIM_OPACITY_VAR, level);
|
|
2214
2244
|
} else releaseDimVar();
|
|
2215
2245
|
const lit = container.querySelectorAll(`.${ACTIVE_TICK_CLASS}`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! @bicharts/chart-host — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; Natural Earth and US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
2
|
import {
|
|
3
3
|
LASSO_KNOB_KEY
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-B6BLSIID.mjs";
|
|
5
5
|
|
|
6
6
|
// src/filterScope.ts
|
|
7
7
|
function viewToken(view) {
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
formatSourceDateFor,
|
|
6
6
|
isExcelDateFormat,
|
|
7
7
|
normaliseAggregation
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-P6VCB6SF.mjs";
|
|
9
9
|
import {
|
|
10
10
|
captureSvgSnapshot,
|
|
11
11
|
chartSvgOf,
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
toRGBA,
|
|
98
98
|
toSourceRows,
|
|
99
99
|
valuePlacementFlag
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-SFDKACWG.mjs";
|
|
101
101
|
import {
|
|
102
102
|
LASSO_AXES_SLOT,
|
|
103
103
|
LASSO_COUNT_CLASS,
|
|
@@ -124,7 +124,7 @@ import {
|
|
|
124
124
|
lassoVerdict,
|
|
125
125
|
pointInShape,
|
|
126
126
|
registerLassoAction
|
|
127
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-B6BLSIID.mjs";
|
|
128
128
|
import {
|
|
129
129
|
MIN_HIT_BAND_PX,
|
|
130
130
|
censusHitBands,
|
|
@@ -189,7 +189,7 @@ import {
|
|
|
189
189
|
_3,
|
|
190
190
|
l,
|
|
191
191
|
o
|
|
192
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-KFU44UEN.mjs";
|
|
193
193
|
import "./chunk-A2GMXZP7.mjs";
|
|
194
194
|
import {
|
|
195
195
|
ACTIVE_TICK_CLASS,
|
|
@@ -1096,7 +1096,7 @@ function filterQualifyRows(rows, term, read, style = DEFAULT_FILTER_MATCH_STYLE)
|
|
|
1096
1096
|
continue;
|
|
1097
1097
|
}
|
|
1098
1098
|
const desc = normalizeFilterTerm(f2.description);
|
|
1099
|
-
if (desc
|
|
1099
|
+
if (startsAWord(desc, t2) || loose && startsALooseWord(looseFormWithWordStarts(desc), loose)) byDesc.push(row);
|
|
1100
1100
|
}
|
|
1101
1101
|
if (atWordStart.length > 0) return { rows: atWordStart, tier: "name", term: t2 };
|
|
1102
1102
|
if (midWord.length > 0) return { rows: midWord, tier: "namePart", term: t2 };
|
package/dist/page.mjs
CHANGED
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
readControls,
|
|
15
15
|
viewFromToken,
|
|
16
16
|
viewToken
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-WSNDXS3Z.mjs";
|
|
18
|
+
import "./chunk-B6BLSIID.mjs";
|
|
19
19
|
import "./chunk-5OCL4EFM.mjs";
|
|
20
20
|
import "./chunk-M7MBTLDP.mjs";
|
|
21
21
|
import "./chunk-GHODWOAL.mjs";
|
package/dist/react.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
payloadRowReader,
|
|
14
14
|
viewFromToken,
|
|
15
15
|
viewToken
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WSNDXS3Z.mjs";
|
|
17
17
|
import {
|
|
18
18
|
assembleD3,
|
|
19
19
|
createChartGroup,
|
|
@@ -22,12 +22,12 @@ import {
|
|
|
22
22
|
loadGeo,
|
|
23
23
|
syncMemberSelection,
|
|
24
24
|
toSourceRows
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-SFDKACWG.mjs";
|
|
26
|
+
import "./chunk-B6BLSIID.mjs";
|
|
27
27
|
import "./chunk-ASLRGGLV.mjs";
|
|
28
28
|
import "./chunk-5OCL4EFM.mjs";
|
|
29
29
|
import "./chunk-3JBJ2SIF.mjs";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-KFU44UEN.mjs";
|
|
31
31
|
import "./chunk-A2GMXZP7.mjs";
|
|
32
32
|
import "./chunk-M7MBTLDP.mjs";
|
|
33
33
|
import "./chunk-GHODWOAL.mjs";
|
|
@@ -113,11 +113,12 @@ function BicChart(props) {
|
|
|
113
113
|
};
|
|
114
114
|
const userSelectedRef = useRef(false);
|
|
115
115
|
const optKey = useMemo(() => JSON.stringify(options ?? {}), [options]);
|
|
116
|
-
const zoomOn = zoomMemory
|
|
117
|
-
const zoomRef = useRef(zoomMemory
|
|
116
|
+
const zoomOn = !!zoomMemory;
|
|
117
|
+
const zoomRef = useRef(zoomMemory || null);
|
|
118
118
|
useLayoutEffect(() => {
|
|
119
|
-
zoomRef.current = zoomMemory
|
|
119
|
+
zoomRef.current = zoomMemory || null;
|
|
120
120
|
});
|
|
121
|
+
const [lateData, setLateData] = useState(0);
|
|
121
122
|
const builtWithRef = useRef(null);
|
|
122
123
|
const reachRef = useRef({ selects, group, id });
|
|
123
124
|
reachRef.current = { selects, group, id };
|
|
@@ -203,7 +204,10 @@ function BicChart(props) {
|
|
|
203
204
|
host.destroy();
|
|
204
205
|
hostRef.current = null;
|
|
205
206
|
};
|
|
206
|
-
}, [code, renderFn, d3, geoKind, labelContrast, layoutPass, restoreScroll, zoomOn, controls]);
|
|
207
|
+
}, [code, renderFn, d3, geoKind, labelContrast, layoutPass, restoreScroll, zoomOn, controls, lateData]);
|
|
208
|
+
useLayoutEffect(() => {
|
|
209
|
+
if (!hostRef.current && data && ref.current && (code || renderFn)) setLateData((n) => n + 1);
|
|
210
|
+
}, [data]);
|
|
207
211
|
useLayoutEffect(() => {
|
|
208
212
|
const host = hostRef.current;
|
|
209
213
|
if (!host || !selects) return;
|
|
@@ -229,7 +233,7 @@ function BicChart(props) {
|
|
|
229
233
|
b.detach();
|
|
230
234
|
if (bindingRef.current === b) bindingRef.current = null;
|
|
231
235
|
};
|
|
232
|
-
}, [selects, code, renderFn, d3, geoKind, labelContrast, layoutPass, restoreScroll, zoomOn]);
|
|
236
|
+
}, [selects, code, renderFn, d3, geoKind, labelContrast, layoutPass, restoreScroll, zoomOn, controls, lateData]);
|
|
233
237
|
useEffect(() => {
|
|
234
238
|
if (!hostRef.current || !options) return;
|
|
235
239
|
if (builtWithRef.current?.optKey === optKey) return;
|
package/dist/types/lasso.d.ts
CHANGED
|
@@ -110,6 +110,16 @@ export type LassoAction = (ctx: LassoActionContext) => void;
|
|
|
110
110
|
* registered is skipped, so a host can carry a list ahead of the build that understands it.
|
|
111
111
|
*/
|
|
112
112
|
export declare function registerLassoAction(name: string, action: LassoAction): void;
|
|
113
|
+
/**
|
|
114
|
+
* A NEW HOST ON A CONTAINER claims the bag's lasso for its chart. The bag outlives every host on the element, so a lasso
|
|
115
|
+
* parked by another chart (a new `code` on the same element, a destroy and create) would be re-drawn on this one and then
|
|
116
|
+
* persisted with the next slider's write under this chart's state. A different chart, or a parked lasso with no record of
|
|
117
|
+
* whose it is, starts without it; the same chart built again (a host rebuilt for its config) keeps it. Only the lasso
|
|
118
|
+
* goes: a slider's value in the bag is meant to outlive a new chart. `sessionState` is the host's own session view-state
|
|
119
|
+
* on the same element (never a caller's provider, which keys its own state): its `knobs.lasso` is the same parked copy.
|
|
120
|
+
* Returns whether a parked lasso was dropped.
|
|
121
|
+
*/
|
|
122
|
+
export declare function claimParkedLasso(container: Element | null | undefined, chartKey: unknown, sessionState?: Record<string, unknown> | null): boolean;
|
|
113
123
|
/** What the host gives the lasso. The lasso never reaches into the host's selection itself. */
|
|
114
124
|
export interface LassoEnv {
|
|
115
125
|
container: HTMLElement;
|
package/dist/types/payload.d.ts
CHANGED
|
@@ -70,6 +70,10 @@ export interface RenderPayload {
|
|
|
70
70
|
/** Which columns the re-anchoring actually moved (diagnostics; empty when every date was already
|
|
71
71
|
* UTC midnight). Present only alongside dateCellsAreUtcDays. */
|
|
72
72
|
utcDayColumns?: string[];
|
|
73
|
+
/** The host re-anchored timed date cells to the UTC wall clock (opts.localWallClock). Present only when it was requested. */
|
|
74
|
+
dateCellsAreUtcWallClock?: boolean;
|
|
75
|
+
/** Which columns that moved (diagnostics). Present only alongside dateCellsAreUtcWallClock. */
|
|
76
|
+
utcWallClockColumns?: string[];
|
|
73
77
|
}
|
|
74
78
|
export declare function buildRenderPayload(cols: Array<{
|
|
75
79
|
name: string;
|
|
@@ -78,6 +82,7 @@ export declare function buildRenderPayload(cols: Array<{
|
|
|
78
82
|
kind: string;
|
|
79
83
|
} | null, point?: GeoPointBinding | null, destination?: GeoPointBinding | null, opts?: {
|
|
80
84
|
utcDays?: boolean;
|
|
85
|
+
localWallClock?: boolean;
|
|
81
86
|
aliases?: ReadonlyArray<{
|
|
82
87
|
name: string;
|
|
83
88
|
alias: string;
|
package/dist/zoom-memory.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! @bicharts/chart-host — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; Natural Earth and US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
K
|
|
4
|
+
} from "./chunk-KFU44UEN.mjs";
|
|
5
5
|
import "./chunk-GHODWOAL.mjs";
|
|
6
6
|
|
|
7
7
|
// src/zoomMemory/zoomMemory.ts
|
|
@@ -262,7 +262,7 @@ function forgetZoom(host) {
|
|
|
262
262
|
}
|
|
263
263
|
function createZoomMemoryHook(host) {
|
|
264
264
|
const hook = {
|
|
265
|
-
keyFor: (code, width, height) => zoomStateKey(
|
|
265
|
+
keyFor: (code, width, height) => zoomStateKey(K(String(code ?? "")), width, height),
|
|
266
266
|
capture: (d3) => captureZoomBehaviors(d3, host),
|
|
267
267
|
restore: (container, capture, key, d3) => {
|
|
268
268
|
const mine = adoptedContainers.get(host);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.98",
|
|
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",
|