@bicharts/chart-host 0.5.104 → 0.5.105
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.
|
@@ -3226,6 +3226,7 @@ function createChartHost(container, config) {
|
|
|
3226
3226
|
let current = null;
|
|
3227
3227
|
let activeTickEl = null;
|
|
3228
3228
|
let selectionIsPeriod = false;
|
|
3229
|
+
let selectionFromChart = false;
|
|
3229
3230
|
const subs = /* @__PURE__ */ new Set();
|
|
3230
3231
|
const ensureAffordanceStyles = () => {
|
|
3231
3232
|
try {
|
|
@@ -3305,8 +3306,9 @@ function createChartHost(container, config) {
|
|
|
3305
3306
|
} catch {
|
|
3306
3307
|
}
|
|
3307
3308
|
};
|
|
3308
|
-
const notify = (rowIdxs, source, tick) => {
|
|
3309
|
+
const notify = (rowIdxs, source, tick, fromChart = false) => {
|
|
3309
3310
|
current = rowIdxs;
|
|
3311
|
+
selectionFromChart = rowIdxs.length > 0 && fromChart;
|
|
3310
3312
|
activeTickEl = rowIdxs.length ? tick ?? null : null;
|
|
3311
3313
|
selectionIsPeriod = rowIdxs.length > 0 && periodTickSuppressesFeedback(!!tick, chartOwnsTimeline(container));
|
|
3312
3314
|
paintSelection();
|
|
@@ -3323,7 +3325,7 @@ function createChartHost(container, config) {
|
|
|
3323
3325
|
const d2 = e?.detail || {};
|
|
3324
3326
|
xfAt = Date.now();
|
|
3325
3327
|
if (d2.clear) notify([], d2.source || "chart");
|
|
3326
|
-
else if (d2.mark) notify(parseRowIdxs(d2.mark.getAttribute?.(ROW_IDX_ATTR)), d2.source || "chart", d2.mark);
|
|
3328
|
+
else if (d2.mark) notify(parseRowIdxs(d2.mark.getAttribute?.(ROW_IDX_ATTR)), d2.source || "chart", d2.mark, true);
|
|
3327
3329
|
};
|
|
3328
3330
|
const resolver = createMarkResolver({
|
|
3329
3331
|
root: container,
|
|
@@ -3340,7 +3342,7 @@ function createChartHost(container, config) {
|
|
|
3340
3342
|
if (!el) {
|
|
3341
3343
|
if (current && current.length) {
|
|
3342
3344
|
const slot = container[CONTAINER_SLOT_XF_CLEAR];
|
|
3343
|
-
if (typeof slot === "function") {
|
|
3345
|
+
if (selectionFromChart && typeof slot === "function") {
|
|
3344
3346
|
try {
|
|
3345
3347
|
slot();
|
|
3346
3348
|
} catch {
|
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.105",
|
|
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",
|