@bicharts/chart-host 0.6.20 → 0.6.22

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.
@@ -1678,7 +1678,7 @@ function rt3(e, n, t, o, u2) {
1678
1678
  let r = m(g3), l = F3(r);
1679
1679
  l.length > 0 && l.every((d2) => X3(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 S = new Set(Object.values(i).filter(Boolean)), w3 = e.filter((r) => !S.has(r) && !r.startsWith("__"));
1681
+ let b4 = new Set(Object.values(i).filter(Boolean)), w3 = e.filter((r) => !b4.has(r) && !r.startsWith("__"));
1682
1682
  if (!i.state) {
1683
1683
  let r = null;
1684
1684
  for (let l of w3) {
@@ -1689,13 +1689,13 @@ function rt3(e, n, t, o, u2) {
1689
1689
  let _2 = K3(d2, (T3) => !!Y(T3)), ae2 = K3(d2, (T3) => !!Y(T3) && !X3(T3, o));
1690
1690
  _2 < V3 && ae2 < 1 || (!r || p2 > r.pct) && (r = { name: l, pct: p2 });
1691
1691
  }
1692
- r && (i.state = r.name, S.add(r.name), a4.push(`state=${r.name} (${r.pct}% states/provinces)`));
1692
+ r && (i.state = r.name, b4.add(r.name), a4.push(`state=${r.name} (${r.pct}% states/provinces)`));
1693
1693
  }
1694
1694
  if (!i.zip) for (let r of w3) {
1695
- if (S.has(r)) continue;
1695
+ if (b4.has(r)) continue;
1696
1696
  let l = m(r), d2 = W2(l);
1697
1697
  if (!(d2 < 95) && Z3(l, r) && !(tt2(l, (p2) => Z(p2).length > 0) < V3)) {
1698
- i.zip = r, S.add(r), a4.push(`zip=${r} (${d2}% ZIP codes)`);
1698
+ i.zip = r, b4.add(r), a4.push(`zip=${r} (${d2}% ZIP codes)`);
1699
1699
  break;
1700
1700
  }
1701
1701
  }
@@ -1703,16 +1703,16 @@ function rt3(e, n, t, o, u2) {
1703
1703
  if (!x2 || !v3(m(x2))) {
1704
1704
  let r = null;
1705
1705
  for (let l of w3) {
1706
- if (S.has(l) || !v3(m(l))) continue;
1706
+ if (b4.has(l) || !v3(m(l))) continue;
1707
1707
  let d2 = B3(m(l));
1708
1708
  (!r || d2 > r.pct) && (r = { name: l, pct: d2 });
1709
1709
  }
1710
- r && (x2 && (s.push(`country=${x2} (only ${B3(m(x2))}% of values are country identifiers; using ${r.name} instead)`), C2.country = x2), i.country = r.name, S.add(r.name), a4.push(`country=${r.name}`));
1710
+ r && (x2 && (s.push(`country=${x2} (only ${B3(m(x2))}% of values are country identifiers; using ${r.name} instead)`), C2.country = x2), i.country = r.name, b4.add(r.name), a4.push(`country=${r.name}`));
1711
1711
  }
1712
1712
  if (!i.city) {
1713
1713
  let r = null;
1714
1714
  for (let l of w3) {
1715
- if (S.has(l)) continue;
1715
+ if (b4.has(l)) continue;
1716
1716
  let d2 = m(l), p2 = nt2(d2, o);
1717
1717
  p2 < m3 || K3(d2, (_2) => p3(_2, o)) < V3 || (!r || p2 > r.pct) && (r = { name: l, pct: p2 });
1718
1718
  }
package/dist/index.mjs CHANGED
@@ -140,7 +140,7 @@ import {
140
140
  unpinScrolledAxis,
141
141
  valuePlacementFlag,
142
142
  withoutViewOnlyKeys
143
- } from "./chunk-UENREQSE.mjs";
143
+ } from "./chunk-GOZQBCDW.mjs";
144
144
  import "./chunk-A2GMXZP7.mjs";
145
145
  import "./chunk-GHODWOAL.mjs";
146
146
 
@@ -2386,7 +2386,7 @@ function reconcileChartPick(pick, offered, autoLabel) {
2386
2386
  // src/duplicateGenerateGuard.ts
2387
2387
  var DUPLICATE_GENERATE_WINDOW_MS = 2500;
2388
2388
  function sameRequest(a2, b2) {
2389
- return a2.schemaHash === b2.schemaHash && a2.gennew === b2.gennew && a2.trycnt === b2.trycnt && a2.favorStyle === b2.favorStyle;
2389
+ return a2.schemaHash === b2.schemaHash && a2.gennew === b2.gennew && a2.trycnt === b2.trycnt && a2.favorStyle === b2.favorStyle && (a2.intent ?? "") === (b2.intent ?? "") && (a2.text ?? "") === (b2.text ?? "");
2390
2390
  }
2391
2391
  function isDuplicateGenerate(prev, next, now) {
2392
2392
  if (!prev) return false;
package/dist/react.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  loadGeo,
8
8
  syncMemberSelection,
9
9
  toSourceRows
10
- } from "./chunk-UENREQSE.mjs";
10
+ } from "./chunk-GOZQBCDW.mjs";
11
11
  import "./chunk-A2GMXZP7.mjs";
12
12
  import "./chunk-GHODWOAL.mjs";
13
13
 
@@ -8,6 +8,17 @@ export interface GenerateGuardKey {
8
8
  favorStyle: string;
9
9
  /** The retry counter. Differs on every retry, so a retry is never suppressed. */
10
10
  trycnt: number;
11
+ /**
12
+ * Anything else the host's request asks for that makes it a different request - an adjustment's
13
+ * intent, a chosen projection. Absent and "" are the same. A host that keys only on the fields
14
+ * above passes none, and its guard behaves exactly as before.
15
+ */
16
+ intent?: string;
17
+ /**
18
+ * The reader's typed request text. A different text is a different request and always passes.
19
+ * Absent and "" are the same.
20
+ */
21
+ text?: string;
11
22
  }
12
23
  /** The last generate a host started, plus whether it is still running. */
13
24
  export interface GenerateGuardState extends GenerateGuardKey {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bicharts/chart-host",
3
- "version": "0.6.20",
3
+ "version": "0.6.22",
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",