@bicharts/chart-host 0.5.101 → 0.5.102

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.
@@ -1440,7 +1440,7 @@ function Wt(n, s) {
1440
1440
  return { iso: i, unmatched: M4, matchedRows: h3, totalRows: n.length };
1441
1441
  }
1442
1442
 
1443
- // ../shape-core/dist/chunk-EZ56V64J.mjs
1443
+ // ../shape-core/dist/chunk-3IYFLQQR.mjs
1444
1444
  var import_papaparse = __toESM(require_papaparse_min(), 1);
1445
1445
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
1446
1446
  var Ae = { "north-america": "AG AI AW BB BL BM BQ BS BZ CA CR CU CW DM DO GD GL GP GT HN HT JM KN KY LC MF MQ MS MX NI PA PM PR SV SX TC TT US VC VG VI", "south-america": "AR BO BR CL CO EC FK GF GY PE PY SR UY VE", europe: "AD AL AT AX BA BE BG BY CH CY CZ DE DK EE ES FI FO FR GB GG GI GR HR HU IE IM IS IT JE LI LT LU LV MC MD ME MK MT NL NO PL PT RO RS RU SE SI SJ SK SM UA VA", africa: "AO BF BI BJ BW CD CF CG CI CM CV DJ DZ EG EH ER ET GA GH GM GN GQ GW KE KM LR LS LY MA MG ML MR MU MW MZ NA NE NG RE RW SC SD SH SL SN SO SS ST SZ TD TG TN TZ UG YT ZA ZM ZW", asia: "AE AF AM AZ BD BH BN BT CC CN CX GE HK ID IL IN IO IQ IR JO JP KG KH KP KR KW KZ LA LB LK MM MN MO MV MY NP OM PH PK PS QA SA SG SY TH TJ TL TM TR TW UZ VN YE", oceania: "AS AU CK FJ FM GU KI MH MP NC NF NR NU NZ PF PG PN PW SB TK TO TV UM VU WF WS", antarctica: "AQ BV GS HM TF" };
@@ -1456,8 +1456,8 @@ function He(n) {
1456
1456
  }
1457
1457
  }
1458
1458
  He(N);
1459
- var Ke = ["rate", "ratio", "pct", "percent", "percentage", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "z[_-]?score", "average", "avg", "mean", "median", "stddev", "variance", "gpa", "percentile", "quantile", "efficiency", "accuracy", "probability", "multiplier", "coefficient", "correlation", "occupancy", "age", "bmi", "temperature", "density", "pressure", "humidity", "ph", "velocity", "speed", "elevation", "altitude", "latency", "throughput", "bandwidth", "iops", "temperatuur", "temperatur", "temperatura", "teplota", "lampotila", "homerseklet", "sicaklik", "pression", "presion", "pressao", "pressione", "druck", "tryck", "tlak", "paine", "nyomas", "presiune", "humidite", "humedad", "umidade", "umidita", "feuchtigkeit", "vochtigheid", "kosteus", "vlhkost", "vitesse", "velocidad", "velocidade", "velocita", "geschwindigkeit", "snelheid", "hastighet", "hastighed", "rychlost", "nopeus", "sebesseg", "brzina", "predkosc", "densite", "densidad", "densidade", "densita", "dichte", "dichtheid", "hustota", "tiheys", "gustoca", "moyenne", "mediane", "promedio", "mediana", "gemiddelde", "durchschnitt", "mittelwert", "genomsnitt", "gennemsnit", "gjennomsnitt", "keskiarvo", "atlag", "ortalama", "prosjek", "srednia", "prumer", "priemer", "medie", "taux", "tasa", "taxa", "tasso", "verhaltnis", "verhouding", "aandeel", "anteil", "andel", "osuus", "podil", "udzial", "udio", "pourcentage", "porcentaje", "percentual", "prozent", "procent", "prosentti", "szazalek", "yuzde", "participacion", "participacao", "pondere", "omjer", "arany", "oran", "rata", "leeftijd", "edad", "idade", "wiek", "eletkor", "varsta", "puntuacion", "pontuacao", "punteggio", "betyg", "ocena", "indice", "indeks", "wskaznik", "puan"];
1460
- var $e = ["pct", "percent", "percentage", "rate", "ratio", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "gpa", "percentile", "quantile", "bmi", "density", "pressure", "humidity", "velocity", "efficiency", "occupancy", "latency", "throughput", "bandwidth", "iops"];
1459
+ var Ke = ["rate", "ratio", "pct", "percent", "percentage", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "z[_-]?score", "average", "avg", "mean", "median", "stddev", "variance", "gpa", "percentile", "quantile", "efficiency", "accuracy", "probability", "multiplier", "coefficient", "correlation", "occupancy", "age", "bmi", "temperature", "density", "pressure", "humidity", "ph", "velocity", "speed", "elevation", "altitude", "latency", "throughput", "bandwidth", "iops", "ppm", "ppb", "dpmo", "bps", "temperatuur", "temperatur", "temperatura", "teplota", "lampotila", "homerseklet", "sicaklik", "pression", "presion", "pressao", "pressione", "druck", "tryck", "tlak", "paine", "nyomas", "presiune", "humidite", "humedad", "umidade", "umidita", "feuchtigkeit", "vochtigheid", "kosteus", "vlhkost", "vitesse", "velocidad", "velocidade", "velocita", "geschwindigkeit", "snelheid", "hastighet", "hastighed", "rychlost", "nopeus", "sebesseg", "brzina", "predkosc", "densite", "densidad", "densidade", "densita", "dichte", "dichtheid", "hustota", "tiheys", "gustoca", "moyenne", "mediane", "promedio", "mediana", "gemiddelde", "durchschnitt", "mittelwert", "genomsnitt", "gennemsnit", "gjennomsnitt", "keskiarvo", "atlag", "ortalama", "prosjek", "srednia", "prumer", "priemer", "medie", "taux", "tasa", "taxa", "tasso", "verhaltnis", "verhouding", "aandeel", "anteil", "andel", "osuus", "podil", "udzial", "udio", "pourcentage", "porcentaje", "percentual", "prozent", "procent", "prosentti", "szazalek", "yuzde", "participacion", "participacao", "pondere", "omjer", "arany", "oran", "rata", "leeftijd", "edad", "idade", "wiek", "eletkor", "varsta", "puntuacion", "pontuacao", "punteggio", "betyg", "ocena", "indice", "indeks", "wskaznik", "puan"];
1460
+ var $e = ["pct", "percent", "percentage", "rate", "ratio", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "gpa", "percentile", "quantile", "bmi", "density", "pressure", "humidity", "velocity", "efficiency", "occupancy", "latency", "throughput", "bandwidth", "iops", "ppm", "ppb", "dpmo", "bps"];
1461
1461
  var Ze = ["latitude", "longitude"];
1462
1462
  var Xe = ["latitude", "longitude"];
1463
1463
  function j2(n) {
@@ -2926,7 +2926,7 @@ function hexToRGB(hex2) {
2926
2926
  // src/labelContrastDom.ts
2927
2927
  var LABEL_CONTRAST_DONE_ATTR = "data-lch-contrast";
2928
2928
  var LABEL_CONTRAST_CAP = 2e3;
2929
- var EMPTY5 = { rects: 0, scanned: 0, fixed: 0, pillsBoosted: 0, offFill: 0, pageMajority: 0 };
2929
+ var EMPTY5 = { rects: 0, scanned: 0, fixed: 0, pillsBoosted: 0, offFill: 0, pageMajority: 0, paintedOver: 0 };
2930
2930
  function backedSamples(el, pts) {
2931
2931
  try {
2932
2932
  const ge = el;
@@ -2948,6 +2948,20 @@ function backedSamples(el, pts) {
2948
2948
  return null;
2949
2949
  }
2950
2950
  }
2951
+ var DOC_POSITION_FOLLOWING = 4;
2952
+ function paintRoot(el, container) {
2953
+ let root = null;
2954
+ for (let n = el.parentElement; n; n = n.parentElement) {
2955
+ if (String(n.tagName || "").toLowerCase() === "svg") root = n;
2956
+ if (n === container) break;
2957
+ }
2958
+ return root;
2959
+ }
2960
+ function drawnBeneath(shape, text, textRoot) {
2961
+ if (!shape.root || shape.root !== textRoot) return true;
2962
+ if (typeof shape.el.compareDocumentPosition !== "function") return true;
2963
+ return (shape.el.compareDocumentPosition(text) & DOC_POSITION_FOLLOWING) !== 0;
2964
+ }
2951
2965
  function applyLabelContrast(container, opts = {}) {
2952
2966
  const report = { ...EMPTY5 };
2953
2967
  if (!container) {
@@ -2972,7 +2986,15 @@ function applyLabelContrast(container, opts = {}) {
2972
2986
  if (!fill || fill === "none") return;
2973
2987
  const opAttr = el.getAttribute("fill-opacity");
2974
2988
  const op = opAttr === null ? 1 : parseFloat(opAttr);
2975
- rects.push({ r, fill, op: isFinite(op) ? op : 1, area: r.width * r.height, el, ord: ord++ });
2989
+ rects.push({
2990
+ r,
2991
+ fill,
2992
+ op: isFinite(op) ? op : 1,
2993
+ area: r.width * r.height,
2994
+ el,
2995
+ ord: ord++,
2996
+ root: paintRoot(el, container)
2997
+ });
2976
2998
  };
2977
2999
  const shapeEls = container.querySelectorAll("rect, path");
2978
3000
  if (shapeEls.length === 0) {
@@ -3008,7 +3030,15 @@ function applyLabelContrast(container, opts = {}) {
3008
3030
  if (tr.width <= 0 || tr.height <= 0) continue;
3009
3031
  const ovArea = (r) => Math.max(0, Math.min(r.right, tr.right) - Math.max(r.left, tr.left)) * Math.max(0, Math.min(r.bottom, tr.bottom) - Math.max(r.top, tr.top));
3010
3032
  const glyphArea = tr.width * tr.height;
3011
- const boxed = rects.map((mk) => ({ mk, ov: ovArea(mk.r) })).filter((x3) => x3.ov > 0);
3033
+ const txRoot = paintRoot(tx, container);
3034
+ let over = 0;
3035
+ const boxed = rects.map((mk) => ({ mk, ov: ovArea(mk.r) })).filter((x3) => {
3036
+ if (!(x3.ov > 0)) return false;
3037
+ if (drawnBeneath(x3.mk, tx, txRoot)) return true;
3038
+ if (effAlpha(x3.mk) >= PILL_MIN_ALPHA) over++;
3039
+ return false;
3040
+ });
3041
+ if (over > 0) report.paintedOver++;
3012
3042
  const pts = glyphSampleGrid({ left: tr.left, top: tr.top, width: tr.width, height: tr.height });
3013
3043
  const painted = pts.map(() => false);
3014
3044
  let unmeasured = 0;
package/dist/index.mjs CHANGED
@@ -128,7 +128,7 @@ import {
128
128
  unpinScrolledAxis,
129
129
  valuePlacementFlag,
130
130
  x
131
- } from "./chunk-LJU47KQS.mjs";
131
+ } from "./chunk-LYHB5MUX.mjs";
132
132
  import "./chunk-A2GMXZP7.mjs";
133
133
  import "./chunk-GHODWOAL.mjs";
134
134
 
package/dist/react.mjs CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  createChartHost,
5
5
  geoFromCache,
6
6
  loadGeo
7
- } from "./chunk-LJU47KQS.mjs";
7
+ } from "./chunk-LYHB5MUX.mjs";
8
8
  import "./chunk-A2GMXZP7.mjs";
9
9
  import "./chunk-GHODWOAL.mjs";
10
10
 
@@ -27,6 +27,9 @@ export interface LabelContrastReport {
27
27
  offFill: number;
28
28
  /** Labels mostly over the page with one end clipping a mark - handed back to the chart. */
29
29
  pageMajority: number;
30
+ /** Labels with a painting shape over their box that was set aside because it is drawn ON TOP
31
+ * of them - an occluder, never a background. See drawnBeneath. */
32
+ paintedOver: number;
30
33
  /** Why the pass did nothing, when it did nothing. */
31
34
  skipped?: "no-container" | "no-shapes" | "too-many-shapes" | "too-many-texts" | "error";
32
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bicharts/chart-host",
3
- "version": "0.5.101",
3
+ "version": "0.5.102",
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",