@bicharts/chart-host 0.5.99 → 0.5.100
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.
|
@@ -636,12 +636,25 @@ function censusColourSpread(container, doc) {
|
|
|
636
636
|
);
|
|
637
637
|
if (els.length === 0 || els.length > ELEMENT_CAP) return EMPTY;
|
|
638
638
|
const ownerDoc = doc ?? container.ownerDocument;
|
|
639
|
+
const painted = [];
|
|
640
|
+
for (const el of els) {
|
|
641
|
+
const rgb = toRgb(fillOf(el, styleOf(el, ownerDoc)));
|
|
642
|
+
if (rgb) painted.push({ rgb, tag: String(el.tagName || "").toLowerCase() });
|
|
643
|
+
}
|
|
644
|
+
const byTag = /* @__PURE__ */ new Map();
|
|
645
|
+
for (const p2 of painted) {
|
|
646
|
+
const g3 = byTag.get(p2.tag) ?? { fills: /* @__PURE__ */ new Set(), n: 0 };
|
|
647
|
+
g3.fills.add(p2.rgb.join(","));
|
|
648
|
+
g3.n++;
|
|
649
|
+
byTag.set(p2.tag, g3);
|
|
650
|
+
}
|
|
651
|
+
const overlays = new Set([...byTag].filter(([, g3]) => g3.fills.size === 1 && g3.n >= MIN_MARKS).map(([t]) => t));
|
|
652
|
+
const restFills = new Set([...byTag].filter(([t]) => !overlays.has(t)).flatMap(([, g3]) => [...g3.fills]));
|
|
653
|
+
const counted = restFills.size > 1 ? painted.filter((p2) => !overlays.has(p2.tag)) : painted;
|
|
639
654
|
const distinct = /* @__PURE__ */ new Set();
|
|
640
655
|
const cells = /* @__PURE__ */ new Map();
|
|
641
656
|
let marks = 0;
|
|
642
|
-
for (const
|
|
643
|
-
const rgb = toRgb(fillOf(el, styleOf(el, ownerDoc)));
|
|
644
|
-
if (!rgb) continue;
|
|
657
|
+
for (const { rgb } of counted) {
|
|
645
658
|
marks++;
|
|
646
659
|
distinct.add(rgb.join(","));
|
|
647
660
|
const k2 = cellKey(rgb);
|
package/dist/index.mjs
CHANGED
package/dist/react.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.100",
|
|
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",
|