@opendata-ai/openchart-vanilla 8.0.0-rc.7 → 8.0.0-rc.8
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.
- package/dist/{chunk-WLAVOZKD.js → chunk-UZ7J3NOF.js} +19 -3
- package/dist/chunk-UZ7J3NOF.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/story/index.js +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +3 -3
- package/src/map-transition.ts +19 -3
- package/dist/chunk-WLAVOZKD.js.map +0 -1
|
@@ -1370,12 +1370,18 @@ function captureFeatureFills(svg) {
|
|
|
1370
1370
|
const fill = p.getAttribute("fill");
|
|
1371
1371
|
if (key && fill) fills.set(key, fill);
|
|
1372
1372
|
}
|
|
1373
|
+
const points = svg.querySelectorAll(".oc-map-point[data-point-key]");
|
|
1374
|
+
for (const p of points) {
|
|
1375
|
+
const key = `pt:${p.getAttribute("data-point-key")}`;
|
|
1376
|
+
const fill = p.getAttribute("fill");
|
|
1377
|
+
if (fill) fills.set(key, fill);
|
|
1378
|
+
}
|
|
1373
1379
|
return fills;
|
|
1374
1380
|
}
|
|
1375
1381
|
function runMapFillTransition(svg, prevFills, opts) {
|
|
1376
|
-
const paths = svg.querySelectorAll(".oc-map-feature[data-key]");
|
|
1377
1382
|
const tweens = [];
|
|
1378
|
-
|
|
1383
|
+
const features = svg.querySelectorAll(".oc-map-feature[data-key]");
|
|
1384
|
+
for (const p of features) {
|
|
1379
1385
|
const key = p.getAttribute("data-key");
|
|
1380
1386
|
const to = p.getAttribute("fill");
|
|
1381
1387
|
const from = key ? prevFills.get(key) : null;
|
|
@@ -1384,6 +1390,16 @@ function runMapFillTransition(svg, prevFills, opts) {
|
|
|
1384
1390
|
p.setAttribute("fill", from);
|
|
1385
1391
|
}
|
|
1386
1392
|
}
|
|
1393
|
+
const points = svg.querySelectorAll(".oc-map-point[data-point-key]");
|
|
1394
|
+
for (const p of points) {
|
|
1395
|
+
const key = `pt:${p.getAttribute("data-point-key")}`;
|
|
1396
|
+
const to = p.getAttribute("fill");
|
|
1397
|
+
const from = prevFills.get(key);
|
|
1398
|
+
if (from && to && from !== to) {
|
|
1399
|
+
tweens.push({ el: p, from, to, interp: rgb_default(from, to) });
|
|
1400
|
+
p.setAttribute("fill", from);
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1387
1403
|
if (tweens.length === 0 || opts.duration <= 0) {
|
|
1388
1404
|
for (const tw of tweens) tw.el.setAttribute("fill", tw.to);
|
|
1389
1405
|
return { cancel: () => {
|
|
@@ -6680,4 +6696,4 @@ export {
|
|
|
6680
6696
|
createYouDrawIt,
|
|
6681
6697
|
createChart
|
|
6682
6698
|
};
|
|
6683
|
-
//# sourceMappingURL=chunk-
|
|
6699
|
+
//# sourceMappingURL=chunk-UZ7J3NOF.js.map
|