@opendata-ai/openchart-vanilla 8.0.0-rc.6 → 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.
@@ -867,7 +867,7 @@ function renderMapSVG(layout, opts) {
867
867
  const cameraGroup = createSVGElement2("g");
868
868
  cameraGroup.setAttribute("class", "oc-map-camera");
869
869
  cameraGroup.setAttribute("data-oc-map-camera", "");
870
- const focusIdSet = layout.focus ? new Set(layout.focus.ids.map(String)) : void 0;
870
+ const focusIdSet = layout.focus && layout.focus.ids.length > 0 ? new Set(layout.focus.ids.map(String)) : void 0;
871
871
  renderFeatures(
872
872
  cameraGroup,
873
873
  features,
@@ -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
- for (const p of paths) {
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: () => {
@@ -1859,6 +1875,10 @@ function createMap(container, spec, options) {
1859
1875
  pendingResize = true;
1860
1876
  return;
1861
1877
  }
1878
+ if (cameraTween) {
1879
+ cameraTween.cancel();
1880
+ cameraTween = null;
1881
+ }
1862
1882
  currentLayout = compile();
1863
1883
  render();
1864
1884
  if (currentFocusIds && currentFocusIds.length > 0) {
@@ -6676,4 +6696,4 @@ export {
6676
6696
  createYouDrawIt,
6677
6697
  createChart
6678
6698
  };
6679
- //# sourceMappingURL=chunk-XZZGLZDA.js.map
6699
+ //# sourceMappingURL=chunk-UZ7J3NOF.js.map