@bicharts/chart-host 0.6.29 → 0.6.31
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.
|
@@ -211,7 +211,7 @@ var require_papaparse_min = __commonJS({
|
|
|
211
211
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
212
212
|
}
|
|
213
213
|
function E4(C2) {
|
|
214
|
-
var S = (C2 = C2 || {}).delimiter, O3 = C2.newline, x2 = C2.comments, I4 = C2.step, A2 = C2.preview,
|
|
214
|
+
var S = (C2 = C2 || {}).delimiter, O3 = C2.newline, x2 = C2.comments, I4 = C2.step, A2 = C2.preview, T4 = C2.fastMode, D3 = null, L2 = false, F3 = null == C2.quoteChar ? '"' : C2.quoteChar, j3 = F3;
|
|
215
215
|
if (void 0 !== C2.escapeChar && (j3 = C2.escapeChar), ("string" != typeof S || -1 < v4.BAD_DELIMITERS.indexOf(S)) && (S = ","), x2 === S) throw new Error("Comment character same as delimiter");
|
|
216
216
|
true === x2 ? x2 = "#" : ("string" != typeof x2 || -1 < v4.BAD_DELIMITERS.indexOf(x2)) && (x2 = false), "\n" !== O3 && "\r" !== O3 && "\r\n" !== O3 && (O3 = "\n");
|
|
217
217
|
var z4 = 0, M = false;
|
|
@@ -219,7 +219,7 @@ var require_papaparse_min = __commonJS({
|
|
|
219
219
|
if ("string" != typeof i2) throw new Error("Input must be a string");
|
|
220
220
|
var n2 = i2.length, e = S.length, s2 = O3.length, a5 = x2.length, o2 = q3(I4), h4 = [], u4 = [], d3 = [], f5 = z4 = 0;
|
|
221
221
|
if (!i2) return w3();
|
|
222
|
-
if (
|
|
222
|
+
if (T4 || false !== T4 && -1 === i2.indexOf(F3)) {
|
|
223
223
|
for (var l2 = i2.split(O3), c4 = 0; c4 < l2.length; c4++) {
|
|
224
224
|
if (d3 = l2[c4], z4 += d3.length, c4 !== l2.length - 1) z4 += O3.length;
|
|
225
225
|
else if (r2) return w3();
|
|
@@ -232,20 +232,20 @@ var require_papaparse_min = __commonJS({
|
|
|
232
232
|
}
|
|
233
233
|
return w3();
|
|
234
234
|
}
|
|
235
|
-
for (var p4 = i2.indexOf(S, z4), g4 = i2.indexOf(O3, z4), _3 = new RegExp(U4(j3) + U4(
|
|
236
|
-
if (-1 === (m2 = i2.indexOf(
|
|
237
|
-
if (m2 === n2 - 1) return E5(i2.substring(z4, m2).replace(_3,
|
|
238
|
-
if (
|
|
239
|
-
else if (
|
|
235
|
+
for (var p4 = i2.indexOf(S, z4), g4 = i2.indexOf(O3, z4), _3 = new RegExp(U4(j3) + U4(F3), "g"), m2 = i2.indexOf(F3, z4); ; ) if (i2[z4] === F3) for (m2 = z4, z4++; ; ) {
|
|
236
|
+
if (-1 === (m2 = i2.indexOf(F3, m2 + 1))) return r2 || u4.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: h4.length, index: z4 }), E5();
|
|
237
|
+
if (m2 === n2 - 1) return E5(i2.substring(z4, m2).replace(_3, F3));
|
|
238
|
+
if (F3 === j3 && i2[m2 + 1] === j3) m2++;
|
|
239
|
+
else if (F3 === j3 || 0 === m2 || i2[m2 - 1] !== j3) {
|
|
240
240
|
-1 !== p4 && p4 < m2 + 1 && (p4 = i2.indexOf(S, m2 + 1));
|
|
241
241
|
var y6 = v5(-1 === (g4 = -1 !== g4 && g4 < m2 + 1 ? i2.indexOf(O3, m2 + 1) : g4) ? p4 : Math.min(p4, g4));
|
|
242
242
|
if (i2.substr(m2 + 1 + y6, e) === S) {
|
|
243
|
-
d3.push(i2.substring(z4, m2).replace(_3,
|
|
243
|
+
d3.push(i2.substring(z4, m2).replace(_3, F3)), i2[z4 = m2 + 1 + y6 + e] !== F3 && (m2 = i2.indexOf(F3, z4)), p4 = i2.indexOf(S, z4), g4 = i2.indexOf(O3, z4);
|
|
244
244
|
break;
|
|
245
245
|
}
|
|
246
246
|
y6 = v5(g4);
|
|
247
247
|
if (i2.substring(m2 + 1 + y6, m2 + 1 + y6 + s2) === O3) {
|
|
248
|
-
if (d3.push(i2.substring(z4, m2).replace(_3,
|
|
248
|
+
if (d3.push(i2.substring(z4, m2).replace(_3, F3)), b5(m2 + 1 + y6 + s2), p4 = i2.indexOf(S, z4), m2 = i2.indexOf(F3, z4), o2 && (R2(), M)) return w3();
|
|
249
249
|
if (A2 && h4.length >= A2) return w3(true);
|
|
250
250
|
break;
|
|
251
251
|
}
|
|
@@ -549,7 +549,7 @@ function deltaE2000(c1, c2) {
|
|
|
549
549
|
else if (Math.abs(h1p - h2p) <= 180) hbarp = (h1p + h2p) / 2;
|
|
550
550
|
else if (h1p + h2p < 360) hbarp = (h1p + h2p + 360) / 2;
|
|
551
551
|
else hbarp = (h1p + h2p - 360) / 2;
|
|
552
|
-
const
|
|
552
|
+
const T4 = 1 - 0.17 * Math.cos((hbarp - 30) * RAD) + 0.24 * Math.cos(2 * hbarp * RAD) + 0.32 * Math.cos((3 * hbarp + 6) * RAD) - 0.2 * Math.cos((4 * hbarp - 63) * RAD);
|
|
553
553
|
const dTheta = 30 * Math.exp(-Math.pow((hbarp - 275) / 25, 2));
|
|
554
554
|
const Cbarp7 = Math.pow(Cbarp, 7);
|
|
555
555
|
const RC = 2 * Math.sqrt(Cbarp7 / (Cbarp7 + Math.pow(25, 7)));
|
|
@@ -557,7 +557,7 @@ function deltaE2000(c1, c2) {
|
|
|
557
557
|
const Lm50 = Math.pow(Lbarp - 50, 2);
|
|
558
558
|
const SL = 1 + 0.015 * Lm50 / Math.sqrt(20 + Lm50);
|
|
559
559
|
const SC = 1 + 0.045 * Cbarp;
|
|
560
|
-
const SH = 1 + 0.015 * Cbarp *
|
|
560
|
+
const SH = 1 + 0.015 * Cbarp * T4;
|
|
561
561
|
const tL = dLp / SL, tC = dCp / SC, tH = dHp / SH;
|
|
562
562
|
return Math.sqrt(tL * tL + tC * tC + tH * tH + RT * tC * tH);
|
|
563
563
|
}
|
|
@@ -1587,7 +1587,7 @@ var J4 = 400;
|
|
|
1587
1587
|
function B3(e) {
|
|
1588
1588
|
return !!E(e);
|
|
1589
1589
|
}
|
|
1590
|
-
function
|
|
1590
|
+
function T3(e) {
|
|
1591
1591
|
let n = /* @__PURE__ */ new Set();
|
|
1592
1592
|
for (let t of e) {
|
|
1593
1593
|
if (t == null) continue;
|
|
@@ -1597,7 +1597,7 @@ function F3(e) {
|
|
|
1597
1597
|
return Array.from(n);
|
|
1598
1598
|
}
|
|
1599
1599
|
function v3(e) {
|
|
1600
|
-
let n =
|
|
1600
|
+
let n = T3(e);
|
|
1601
1601
|
if (n.length === 0 || W2(e) < 95) return false;
|
|
1602
1602
|
let t = n.filter((u2) => B3(u2) && !Y(u2)).length, o = n.filter((u2) => !B3(u2) && !!Y(u2)).length;
|
|
1603
1603
|
return t >= 1 && t >= o;
|
|
@@ -1608,20 +1608,20 @@ function Y3(e, n) {
|
|
|
1608
1608
|
return t ? n === "world" ? true : s3.has(t) : false;
|
|
1609
1609
|
}
|
|
1610
1610
|
function W2(e) {
|
|
1611
|
-
let n =
|
|
1611
|
+
let n = T3(e);
|
|
1612
1612
|
if (n.length === 0) return 0;
|
|
1613
1613
|
let t = 0;
|
|
1614
1614
|
for (let o of n) B3(o) && t++;
|
|
1615
1615
|
return Math.round(t / n.length * 1e3) / 10;
|
|
1616
1616
|
}
|
|
1617
1617
|
function k3(e) {
|
|
1618
|
-
let n =
|
|
1618
|
+
let n = T3(e);
|
|
1619
1619
|
if (n.length === 0) return 0;
|
|
1620
1620
|
let t = 0;
|
|
1621
1621
|
for (let o of n) Y(o) && t++;
|
|
1622
1622
|
return Math.round(t / n.length * 1e3) / 10;
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1624
|
+
function $2(e) {
|
|
1625
1625
|
let n = /* @__PURE__ */ new Set();
|
|
1626
1626
|
for (let t of e) {
|
|
1627
1627
|
if (t == null) continue;
|
|
@@ -1630,18 +1630,18 @@ function U3(e) {
|
|
|
1630
1630
|
}
|
|
1631
1631
|
return Array.from(n);
|
|
1632
1632
|
}
|
|
1633
|
-
function
|
|
1634
|
-
let n =
|
|
1633
|
+
function U3(e) {
|
|
1634
|
+
let n = $2(e);
|
|
1635
1635
|
if (n.length === 0) return 0;
|
|
1636
1636
|
let t = 0;
|
|
1637
1637
|
for (let o of n) Z(o).length > 0 && t++;
|
|
1638
1638
|
return Math.round(t / n.length * 1e3) / 10;
|
|
1639
1639
|
}
|
|
1640
1640
|
function Z3(e, n) {
|
|
1641
|
-
return y4(n, rt) ? true :
|
|
1641
|
+
return y4(n, rt) ? true : $2(e).some((t) => /^\d{5}(-\d{4})?$/.test(t.replace(/\.0+$/, "")));
|
|
1642
1642
|
}
|
|
1643
1643
|
function ot(e, n) {
|
|
1644
|
-
let t =
|
|
1644
|
+
let t = T3(e);
|
|
1645
1645
|
if (t.length === 0) return 0;
|
|
1646
1646
|
let o = 0;
|
|
1647
1647
|
for (let u2 of t) p3(u2, n) && o++;
|
|
@@ -1649,12 +1649,12 @@ function ot(e, n) {
|
|
|
1649
1649
|
}
|
|
1650
1650
|
function z3(e, n) {
|
|
1651
1651
|
let t = 0;
|
|
1652
|
-
for (let o of
|
|
1652
|
+
for (let o of T3(e)) n(o) && t++;
|
|
1653
1653
|
return t;
|
|
1654
1654
|
}
|
|
1655
1655
|
function it2(e, n) {
|
|
1656
1656
|
let t = 0;
|
|
1657
|
-
for (let o of
|
|
1657
|
+
for (let o of $2(e)) n(o) && t++;
|
|
1658
1658
|
return t;
|
|
1659
1659
|
}
|
|
1660
1660
|
function st(e, n, t, o, u2) {
|
|
@@ -1670,18 +1670,18 @@ function st(e, n, t, o, u2) {
|
|
|
1670
1670
|
}
|
|
1671
1671
|
let C2 = t?.zip;
|
|
1672
1672
|
if (C2 && R2.has(C2)) {
|
|
1673
|
-
let r = f4(C2), l =
|
|
1673
|
+
let r = f4(C2), l = U3(r);
|
|
1674
1674
|
l < 95 ? s.push(`zip=${C2} (only ${l}% of values read as ZIPs)`) : Z3(r, C2) ? i.zip = C2 : s.push(`zip=${C2} (all values are 3-4 digits with nothing to say they are postal)`);
|
|
1675
1675
|
}
|
|
1676
1676
|
let g3 = t?.state;
|
|
1677
1677
|
if (g3 && R2.has(g3)) {
|
|
1678
|
-
let r = f4(g3), l =
|
|
1678
|
+
let r = f4(g3), l = T3(r);
|
|
1679
1679
|
l.length > 0 && l.every((d2) => Y3(d2, o)) ? s.push(`state=${g3} (every value is "CA", which is both Canada and California)`) : v3(r) ? (s.push(`state=${g3} (every value is a country, not a state)`), i.country || (i.country = g3)) : k3(r) < 95 ? s.push(`state=${g3} (only ${k3(r)}% of values are states/provinces)`) : i.state = g3;
|
|
1680
1680
|
}
|
|
1681
|
-
let b4 = new Set(Object.values(i).filter(Boolean)),
|
|
1681
|
+
let b4 = new Set(Object.values(i).filter(Boolean)), M = e.filter((r) => !b4.has(r) && !r.startsWith("__"));
|
|
1682
1682
|
if (!i.state) {
|
|
1683
1683
|
let r = null;
|
|
1684
|
-
for (let l of
|
|
1684
|
+
for (let l of M) {
|
|
1685
1685
|
let d2 = f4(l);
|
|
1686
1686
|
if (v3(d2)) continue;
|
|
1687
1687
|
let p2 = k3(d2);
|
|
@@ -1691,9 +1691,9 @@ function st(e, n, t, o, u2) {
|
|
|
1691
1691
|
}
|
|
1692
1692
|
r && (i.state = r.name, b4.add(r.name), a4.push(`state=${r.name} (${r.pct}% states/provinces)`));
|
|
1693
1693
|
}
|
|
1694
|
-
if (!i.zip) for (let r of
|
|
1694
|
+
if (!i.zip) for (let r of M) {
|
|
1695
1695
|
if (b4.has(r)) continue;
|
|
1696
|
-
let l = f4(r), d2 =
|
|
1696
|
+
let l = f4(r), d2 = U3(l);
|
|
1697
1697
|
if (!(d2 < 95) && Z3(l, r) && !(it2(l, (p2) => Z(p2).length > 0) < K3)) {
|
|
1698
1698
|
i.zip = r, b4.add(r), a4.push(`zip=${r} (${d2}% ZIP codes)`);
|
|
1699
1699
|
break;
|
|
@@ -1702,7 +1702,7 @@ function st(e, n, t, o, u2) {
|
|
|
1702
1702
|
let P4 = i.country;
|
|
1703
1703
|
if (!P4 || !v3(f4(P4))) {
|
|
1704
1704
|
let r = null;
|
|
1705
|
-
for (let l of
|
|
1705
|
+
for (let l of M) {
|
|
1706
1706
|
if (b4.has(l) || !v3(f4(l))) continue;
|
|
1707
1707
|
let d2 = W2(f4(l));
|
|
1708
1708
|
(!r || d2 > r.pct) && (r = { name: l, pct: d2 });
|
|
@@ -1711,7 +1711,7 @@ function st(e, n, t, o, u2) {
|
|
|
1711
1711
|
}
|
|
1712
1712
|
if (!i.city) {
|
|
1713
1713
|
let r = null;
|
|
1714
|
-
for (let l of
|
|
1714
|
+
for (let l of M) {
|
|
1715
1715
|
if (b4.has(l)) continue;
|
|
1716
1716
|
let d2 = f4(l), p2 = ot(d2, o);
|
|
1717
1717
|
p2 < m3 || z3(d2, (_2) => p3(_2, o)) < K3 || (!r || p2 > r.pct) && (r = { name: l, pct: p2 });
|
package/dist/index.mjs
CHANGED
|
@@ -140,10 +140,64 @@ import {
|
|
|
140
140
|
unpinScrolledAxis,
|
|
141
141
|
valuePlacementFlag,
|
|
142
142
|
withoutViewOnlyKeys
|
|
143
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-KONJ3DXV.mjs";
|
|
144
144
|
import "./chunk-A2GMXZP7.mjs";
|
|
145
145
|
import "./chunk-GHODWOAL.mjs";
|
|
146
146
|
|
|
147
|
+
// src/optionsVocabulary.ts
|
|
148
|
+
var MAX_MAP_POINTS_MIN = 10;
|
|
149
|
+
var MAX_MAP_POINTS_MAX = 1e5;
|
|
150
|
+
var LIMIT_COUNT_MAX = 1e4;
|
|
151
|
+
var entry = (e2) => Object.freeze({ ...e2, ...e2.values ? { values: Object.freeze([...e2.values]) } : {} });
|
|
152
|
+
var OPTIONS_VOCABULARY = Object.freeze({
|
|
153
|
+
// ---- drawn from on every render, and stated on the request so the model reasons about them ----
|
|
154
|
+
aggregation: entry({ timing: "live-and-next-generate", default: "", values: ["", "sum", "average", "median", "min", "max", "count", "distinct"], wire: "request" }),
|
|
155
|
+
colorScaleLow: entry({ timing: "live-and-next-generate", default: "", wire: "request" }),
|
|
156
|
+
colorScaleHigh: entry({ timing: "live-and-next-generate", default: "", wire: "request" }),
|
|
157
|
+
/** Blank: the host's own colours when it offers them, else the engine's. */
|
|
158
|
+
palette: entry({ timing: "live-and-next-generate", default: "", wire: "request" }),
|
|
159
|
+
/** A HARD offer gate on the server as well as a live cap on what a point map plots. */
|
|
160
|
+
maxMapPoints: entry({ timing: "live-and-next-generate", default: MAX_MAP_POINTS_DEFAULT, min: MAX_MAP_POINTS_MIN, max: MAX_MAP_POINTS_MAX, wire: "clientHints" }),
|
|
161
|
+
// ---- live only ----
|
|
162
|
+
/** 0 means no paging. */
|
|
163
|
+
pageSize: entry({ timing: "live", default: 0, min: 0 }),
|
|
164
|
+
valueAxisBaseline: entry({ timing: "live", default: VALUE_AXIS_BASELINE_DEFAULT, values: ["fit", "zero", "auto"] }),
|
|
165
|
+
seasonalMarkers: entry({ timing: "live", default: SEASONAL_MARKERS_DEFAULT, values: ["auto", "always", "never"] }),
|
|
166
|
+
animAutoPlay: entry({ timing: "live", default: false }),
|
|
167
|
+
animPlaySpeedMs: entry({ timing: "live", default: ANIM_PLAY_SPEED_DEFAULT, min: ANIM_PLAY_SPEED_MIN, max: ANIM_PLAY_SPEED_MAX }),
|
|
168
|
+
/** 0 restarts at once; no upper bound, so a very large value plays once per viewing. */
|
|
169
|
+
animLoopDelaySec: entry({ timing: "live", default: ANIM_LOOP_DELAY_DEFAULT, min: ANIM_LOOP_DELAY_MIN }),
|
|
170
|
+
animStopAtEnd: entry({ timing: "live", default: false }),
|
|
171
|
+
animMaxIdealFrames: entry({ timing: "live", default: ANIM_MAX_IDEAL_FRAMES_DEFAULT, min: ANIM_MAX_IDEAL_FRAMES_MIN, max: ANIM_MAX_IDEAL_FRAMES_MAX }),
|
|
172
|
+
/** "" chooses by the number of periods. */
|
|
173
|
+
animTimelineStyle: entry({ timing: "live", default: "", values: ["", "line", "boxes"] }),
|
|
174
|
+
filtersDuringPlay: entry({ timing: "live", default: false }),
|
|
175
|
+
// ---- the next generated chart ----
|
|
176
|
+
levelOfDetail: entry({ timing: "next-generate", default: "", values: ["", "High", "Medium", "Low"], wire: "clientHints" }),
|
|
177
|
+
favorLimitTo: entry({ timing: "next-generate", default: "", values: ["", "latest", "top / greatest", "bottom / smallest", "most common", "outliers"], wire: "clientHints" }),
|
|
178
|
+
/** 0 asks for no limit, and travels as absent (`wireLimitCount`): any value the server receives is a limit. */
|
|
179
|
+
favorLimitCount: entry({ timing: "next-generate", default: 0, min: 0, max: LIMIT_COUNT_MAX, wire: "clientHints" }),
|
|
180
|
+
/** "1" asks for a title, "0" for none, "" leaves it to the engine. */
|
|
181
|
+
favorTitle: entry({ timing: "next-generate", default: "", values: ["", "1", "0"], wire: "clientHints" }),
|
|
182
|
+
/** Data labels on the marks: "1", "0", or "" for the engine's choice. */
|
|
183
|
+
favorDPValues: entry({ timing: "next-generate", default: "", values: ["", "1", "0"], wire: "clientHints" }),
|
|
184
|
+
legendPlacement: entry({ timing: "next-generate", default: "", values: ["", "outside", "inside", "none"], wire: "clientHints" }),
|
|
185
|
+
/** Free text: the industry the data belongs to. */
|
|
186
|
+
industryContext: entry({ timing: "next-generate", default: "", wire: "clientHints" }),
|
|
187
|
+
/** Free text: a font family for the chart's own text. */
|
|
188
|
+
suggestFontFamily: entry({ timing: "next-generate", default: "", wire: "clientHints" }),
|
|
189
|
+
// ---- after a chart is drawn ----
|
|
190
|
+
visionReview: entry({ timing: "after-render", default: false }),
|
|
191
|
+
saveThumbnails: entry({ timing: "after-render", default: false })
|
|
192
|
+
});
|
|
193
|
+
var LIVE_OPTION_KEYS = Object.freeze(
|
|
194
|
+
Object.keys(OPTIONS_VOCABULARY).filter((k2) => OPTIONS_VOCABULARY[k2].timing === "live" || OPTIONS_VOCABULARY[k2].timing === "live-and-next-generate")
|
|
195
|
+
);
|
|
196
|
+
function wireLimitCount(count) {
|
|
197
|
+
const n2 = typeof count === "number" ? count : count == null || count === "" ? NaN : Number(count);
|
|
198
|
+
return Number.isFinite(n2) && n2 > 0 ? n2 : null;
|
|
199
|
+
}
|
|
200
|
+
|
|
147
201
|
// src/dateCells.ts
|
|
148
202
|
var LOCAL_DATE_METHOD = /\.(?:getFullYear|getMonth|getDate|getDay|getHours|getMinutes|setFullYear|setMonth|setDate|setHours|setMinutes|setSeconds|setMilliseconds)\s*\(/;
|
|
149
203
|
var D3_LOCAL_TIME = /\bd3\s*\.\s*(?:scaleTime|time[A-Z]\w*)\b/;
|
|
@@ -2542,14 +2596,19 @@ export {
|
|
|
2542
2596
|
LEGIBLE_LIGHTNESS,
|
|
2543
2597
|
LIFT_SELECTED_CLASS,
|
|
2544
2598
|
LIGHT_TEXT,
|
|
2599
|
+
LIMIT_COUNT_MAX,
|
|
2600
|
+
LIVE_OPTION_KEYS,
|
|
2545
2601
|
MARK_CLASS,
|
|
2546
2602
|
MARK_SELECTED_CLASS,
|
|
2547
2603
|
MAX_FRAME_GROW_FACTOR,
|
|
2548
2604
|
MAX_MAP_POINTS_DEFAULT,
|
|
2605
|
+
MAX_MAP_POINTS_MAX,
|
|
2606
|
+
MAX_MAP_POINTS_MIN,
|
|
2549
2607
|
MIN_CONTRAST,
|
|
2550
2608
|
MIN_DELTA_E,
|
|
2551
2609
|
MIN_HIT_BAND_PX,
|
|
2552
2610
|
MIN_RAMP_FILLS,
|
|
2611
|
+
OPTIONS_VOCABULARY,
|
|
2553
2612
|
PAGE_MATCH_TOLERANCE,
|
|
2554
2613
|
PENDING_RECOVERY_FAST_PHASE_MS,
|
|
2555
2614
|
PENDING_RECOVERY_FIRST_POLL_MS,
|
|
@@ -2732,5 +2791,6 @@ export {
|
|
|
2732
2791
|
updateRowHighWater,
|
|
2733
2792
|
valuePlacementFlag,
|
|
2734
2793
|
vegaSpecReadsDatesInLocalTime,
|
|
2794
|
+
wireLimitCount,
|
|
2735
2795
|
withoutViewOnlyKeys
|
|
2736
2796
|
};
|
package/dist/react.mjs
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { HOST_CONTRACT_VERSION, GEO_POINT_PRECISIONS, MARK_CLASS, LEGEND_MARK_CLASS, AXIS_FILTER_CLASS, ROW_IDX_ATTR, LIFT_SELECTED_CLASS, CONTROL_CLASS, XFILTER_REFRESH_EVENT, CONTAINER_SLOT_ANIM_STOP, CONTAINER_SLOT_XF_CLEAR, CONTAINER_SLOT_INITIAL_XF_MARK, CONTAINER_SLOT_UI_STATE, VIEW_ONLY_UI_STATE_KEYS, withoutViewOnlyKeys, HOST_CONTAINER_CLASS, SELECTION_ACTIVE_CLASS, MARK_SELECTED_CLASS, ACTIVE_TICK_CLASS, DIM_OPACITY_VAR, DIM_OPACITY_DEFAULT, chartOwnsTimeline, periodTickSuppressesFeedback, ANIM_PLAY_SPEED_DEFAULT, ANIM_PLAY_SPEED_MIN, ANIM_PLAY_SPEED_MAX, ANIM_LOOP_DELAY_DEFAULT, ANIM_LOOP_DELAY_MIN, ANIM_MAX_IDEAL_FRAMES_DEFAULT, ANIM_MAX_IDEAL_FRAMES_MIN, ANIM_MAX_IDEAL_FRAMES_MAX, ANIMATION_OPTION_KEYS, COLOR_SCALE_SELF_CLAMP_PCT_DEFAULT, COLOR_SCALE_SELF_CLAMP_PCT_MIN, COLOR_SCALE_SELF_CLAMP_PCT_MAX, FLIP_MODE_DEFAULT, APPROXIMATE_POSITIONS_DEFAULT, VALUE_AXIS_BASELINE_DEFAULT, SEASONAL_MARKERS_DEFAULT, MAX_MAP_POINTS_DEFAULT, type GeoPointPrecision, type GeoMapKind, type TimelineStyle, type FlipMode, type ApproximatePositions, type ValueAxisBaseline, type SeasonalMarkers, type ColorScaleScope, type RenderOptions, type ViewStateProvider, type ChartControlChange, } from "./contract";
|
|
2
2
|
export { resolveOptions, type ResolveOptionsInput } from "./defaults";
|
|
3
|
+
export { OPTIONS_VOCABULARY, LIVE_OPTION_KEYS, MAX_MAP_POINTS_MIN, MAX_MAP_POINTS_MAX, LIMIT_COUNT_MAX, wireLimitCount, type OptionVocabularyEntry, type OptionTiming, type OptionWire, type OptionKey, } from "./optionsVocabulary";
|
|
3
4
|
export { loadGeo, geoFromCache, registerGeo, registerGeoAsset, geoAssetFor, clearGeoCache, type GeoAssetName, } from "./geoLazy";
|
|
4
5
|
/** REPLACE the bundled city gazetteer with another packed table. Rarely needed — see the
|
|
5
6
|
* note above registerCityTable in shape-core's geoPoint.ts before using it. */
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When a change to an option takes effect.
|
|
3
|
+
* - `live`: the chart on screen repaints with it; no request, no new chart.
|
|
4
|
+
* - `next-generate`: it steers what the engine makes, so it applies to the next generated chart.
|
|
5
|
+
* - `live-and-next-generate`: both - the chart on screen repaints, and the request carries it too.
|
|
6
|
+
* - `after-render`: it governs what happens after a chart is drawn (a review, a thumbnail).
|
|
7
|
+
*/
|
|
8
|
+
export type OptionTiming = "live" | "next-generate" | "live-and-next-generate" | "after-render";
|
|
9
|
+
/** Where an option travels on a generate request: the request itself, or its client hints. */
|
|
10
|
+
export type OptionWire = "request" | "clientHints";
|
|
11
|
+
/** The shared facts about one option. */
|
|
12
|
+
export interface OptionVocabularyEntry {
|
|
13
|
+
readonly timing: OptionTiming;
|
|
14
|
+
/** What "not set" means. A host that stores blank or 0 for "the default" resolves to this. */
|
|
15
|
+
readonly default: string | number | boolean;
|
|
16
|
+
/** The least value a reader may set, for a number. */
|
|
17
|
+
readonly min?: number;
|
|
18
|
+
/** The greatest value a reader may set, for a number. Absent: no upper bound. */
|
|
19
|
+
readonly max?: number;
|
|
20
|
+
/** The values a choice accepts, "" being "leave it to the engine" where offered. */
|
|
21
|
+
readonly values?: readonly string[];
|
|
22
|
+
/** Where it travels on a generate request; absent when it never travels. */
|
|
23
|
+
readonly wire?: OptionWire;
|
|
24
|
+
}
|
|
25
|
+
/** Max Map Points: the fewest and the most points a reader may allow a point map. */
|
|
26
|
+
export declare const MAX_MAP_POINTS_MIN = 10;
|
|
27
|
+
export declare const MAX_MAP_POINTS_MAX = 100000;
|
|
28
|
+
/** Favor Limit Count: the most groups a reader may ask a chart to keep. 0 asks for no limit. */
|
|
29
|
+
export declare const LIMIT_COUNT_MAX = 10000;
|
|
30
|
+
/** The options the hosts share, keyed by wire / render-option name. */
|
|
31
|
+
export declare const OPTIONS_VOCABULARY: Readonly<{
|
|
32
|
+
aggregation: OptionVocabularyEntry;
|
|
33
|
+
colorScaleLow: OptionVocabularyEntry;
|
|
34
|
+
colorScaleHigh: OptionVocabularyEntry;
|
|
35
|
+
/** Blank: the host's own colours when it offers them, else the engine's. */
|
|
36
|
+
palette: OptionVocabularyEntry;
|
|
37
|
+
/** A HARD offer gate on the server as well as a live cap on what a point map plots. */
|
|
38
|
+
maxMapPoints: OptionVocabularyEntry;
|
|
39
|
+
/** 0 means no paging. */
|
|
40
|
+
pageSize: OptionVocabularyEntry;
|
|
41
|
+
valueAxisBaseline: OptionVocabularyEntry;
|
|
42
|
+
seasonalMarkers: OptionVocabularyEntry;
|
|
43
|
+
animAutoPlay: OptionVocabularyEntry;
|
|
44
|
+
animPlaySpeedMs: OptionVocabularyEntry;
|
|
45
|
+
/** 0 restarts at once; no upper bound, so a very large value plays once per viewing. */
|
|
46
|
+
animLoopDelaySec: OptionVocabularyEntry;
|
|
47
|
+
animStopAtEnd: OptionVocabularyEntry;
|
|
48
|
+
animMaxIdealFrames: OptionVocabularyEntry;
|
|
49
|
+
/** "" chooses by the number of periods. */
|
|
50
|
+
animTimelineStyle: OptionVocabularyEntry;
|
|
51
|
+
filtersDuringPlay: OptionVocabularyEntry;
|
|
52
|
+
levelOfDetail: OptionVocabularyEntry;
|
|
53
|
+
favorLimitTo: OptionVocabularyEntry;
|
|
54
|
+
/** 0 asks for no limit, and travels as absent (`wireLimitCount`): any value the server receives is a limit. */
|
|
55
|
+
favorLimitCount: OptionVocabularyEntry;
|
|
56
|
+
/** "1" asks for a title, "0" for none, "" leaves it to the engine. */
|
|
57
|
+
favorTitle: OptionVocabularyEntry;
|
|
58
|
+
/** Data labels on the marks: "1", "0", or "" for the engine's choice. */
|
|
59
|
+
favorDPValues: OptionVocabularyEntry;
|
|
60
|
+
legendPlacement: OptionVocabularyEntry;
|
|
61
|
+
/** Free text: the industry the data belongs to. */
|
|
62
|
+
industryContext: OptionVocabularyEntry;
|
|
63
|
+
/** Free text: a font family for the chart's own text. */
|
|
64
|
+
suggestFontFamily: OptionVocabularyEntry;
|
|
65
|
+
visionReview: OptionVocabularyEntry;
|
|
66
|
+
saveThumbnails: OptionVocabularyEntry;
|
|
67
|
+
}>;
|
|
68
|
+
/** A shared option's key. */
|
|
69
|
+
export type OptionKey = keyof typeof OPTIONS_VOCABULARY;
|
|
70
|
+
/** The keys whose change repaints the chart on screen, in table order. */
|
|
71
|
+
export declare const LIVE_OPTION_KEYS: readonly OptionKey[];
|
|
72
|
+
/**
|
|
73
|
+
* THE LIMIT COUNT A REQUEST CARRIES: a positive count, or null - never 0. The server reads any value it
|
|
74
|
+
* receives as the reader's own limit (and 0 as a limit of zero), so "no limit" must arrive as no value.
|
|
75
|
+
* A host places null where it always has; one that omits blank fields maps it to absent.
|
|
76
|
+
*/
|
|
77
|
+
export declare function wireLimitCount(count: unknown): number | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.31",
|
|
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",
|