@d3plus/core 4.1.0 → 4.2.0

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.
Files changed (61) hide show
  1. package/README.md +686 -671
  2. package/es/src/charts/AreaPlot/index.js +2 -1
  3. package/es/src/charts/AreaPlot/index.js.map +1 -1
  4. package/es/src/charts/BarChart/index.js +3 -1
  5. package/es/src/charts/BarChart/index.js.map +1 -1
  6. package/es/src/charts/BoxWhisker/index.js +2 -1
  7. package/es/src/charts/BoxWhisker/index.js.map +1 -1
  8. package/es/src/charts/BumpChart/index.js +2 -1
  9. package/es/src/charts/BumpChart/index.js.map +1 -1
  10. package/es/src/charts/Geomap/index.js +2 -1
  11. package/es/src/charts/Geomap/index.js.map +1 -1
  12. package/es/src/charts/LinePlot/index.js +2 -1
  13. package/es/src/charts/LinePlot/index.js.map +1 -1
  14. package/es/src/charts/Matrix/index.js +1 -0
  15. package/es/src/charts/Matrix/index.js.map +1 -1
  16. package/es/src/charts/Network/index.js +2 -1
  17. package/es/src/charts/Network/index.js.map +1 -1
  18. package/es/src/charts/Pack/index.js +1 -0
  19. package/es/src/charts/Pack/index.js.map +1 -1
  20. package/es/src/charts/Pie/index.js +1 -0
  21. package/es/src/charts/Pie/index.js.map +1 -1
  22. package/es/src/charts/Plot/index.js +22 -12
  23. package/es/src/charts/Plot/index.js.map +1 -1
  24. package/es/src/charts/Plot/pipelineDomains.js +3 -3
  25. package/es/src/charts/Plot/pipelineDomains.js.map +1 -1
  26. package/es/src/charts/Plot/stackHelpers.js +128 -9
  27. package/es/src/charts/Plot/stackHelpers.js.map +1 -1
  28. package/es/src/charts/Radar/index.js +2 -1
  29. package/es/src/charts/Radar/index.js.map +1 -1
  30. package/es/src/charts/RadialMatrix/index.js +1 -0
  31. package/es/src/charts/RadialMatrix/index.js.map +1 -1
  32. package/es/src/charts/Rings/index.js +2 -1
  33. package/es/src/charts/Rings/index.js.map +1 -1
  34. package/es/src/charts/Sankey/index.js +2 -1
  35. package/es/src/charts/Sankey/index.js.map +1 -1
  36. package/es/src/charts/Tree/index.js +2 -1
  37. package/es/src/charts/Tree/index.js.map +1 -1
  38. package/es/src/charts/Treemap/index.js +1 -0
  39. package/es/src/charts/Treemap/index.js.map +1 -1
  40. package/es/src/shapes/Image.js +2 -3
  41. package/es/src/shapes/Image.js.map +1 -1
  42. package/es/src/shapes/Shape.js +35 -36
  43. package/es/src/shapes/Shape.js.map +1 -1
  44. package/es/src/shapes/sceneSort.js +304 -24
  45. package/es/src/shapes/sceneSort.js.map +1 -1
  46. package/es/src/shapes/shapeConfig.js.map +1 -1
  47. package/es/src/utils/D3plusConfig.js.map +1 -1
  48. package/package.json +9 -9
  49. package/types/src/charts/Plot/index.d.ts +22 -6
  50. package/types/src/charts/Plot/stackHelpers.d.ts +62 -4
  51. package/types/src/shapes/Image.d.ts +2 -3
  52. package/types/src/shapes/Shape.d.ts +0 -2
  53. package/types/src/shapes/sceneSort.d.ts +83 -8
  54. package/types/src/shapes/shapeConfig.d.ts +7 -0
  55. package/types/src/utils/D3plusConfig.d.ts +19 -2
  56. package/umd/d3plus-core.full.js +1581 -561
  57. package/umd/d3plus-core.full.js.map +1 -1
  58. package/umd/d3plus-core.full.min.js +1091 -927
  59. package/umd/d3plus-core.js +541 -224
  60. package/umd/d3plus-core.js.map +1 -1
  61. package/umd/d3plus-core.min.js +468 -363
@@ -1,5 +1,5 @@
1
1
  /*
2
- @d3plus/core v4.1.0
2
+ @d3plus/core v4.2.0
3
3
  Data visualization made easy. A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.
4
4
  Copyright (c) 2026 D3plus - https://d3plus.org
5
5
  @license MIT
@@ -9651,16 +9651,16 @@
9651
9651
  return newObject;
9652
9652
  }
9653
9653
 
9654
- function _array_like_to_array$g(arr, len) {
9654
+ function _array_like_to_array$i(arr, len) {
9655
9655
  if (len == null || len > arr.length) len = arr.length;
9656
9656
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
9657
9657
  return arr2;
9658
9658
  }
9659
- function _array_with_holes$d(arr) {
9659
+ function _array_with_holes$f(arr) {
9660
9660
  if (Array.isArray(arr)) return arr;
9661
9661
  }
9662
- function _array_without_holes$7(arr) {
9663
- if (Array.isArray(arr)) return _array_like_to_array$g(arr);
9662
+ function _array_without_holes$8(arr) {
9663
+ if (Array.isArray(arr)) return _array_like_to_array$i(arr);
9664
9664
  }
9665
9665
  function _instanceof$4(left, right) {
9666
9666
  "@swc/helpers - instanceof";
@@ -9670,10 +9670,10 @@
9670
9670
  return left instanceof right;
9671
9671
  }
9672
9672
  }
9673
- function _iterable_to_array$7(iter) {
9673
+ function _iterable_to_array$8(iter) {
9674
9674
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
9675
9675
  }
9676
- function _iterable_to_array_limit$d(arr, i) {
9676
+ function _iterable_to_array_limit$f(arr, i) {
9677
9677
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
9678
9678
  if (_i == null) return;
9679
9679
  var _arr = [];
@@ -9697,25 +9697,25 @@
9697
9697
  }
9698
9698
  return _arr;
9699
9699
  }
9700
- function _non_iterable_rest$d() {
9700
+ function _non_iterable_rest$f() {
9701
9701
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9702
9702
  }
9703
- function _non_iterable_spread$7() {
9703
+ function _non_iterable_spread$8() {
9704
9704
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9705
9705
  }
9706
- function _sliced_to_array$d(arr, i) {
9707
- return _array_with_holes$d(arr) || _iterable_to_array_limit$d(arr, i) || _unsupported_iterable_to_array$g(arr, i) || _non_iterable_rest$d();
9706
+ function _sliced_to_array$f(arr, i) {
9707
+ return _array_with_holes$f(arr) || _iterable_to_array_limit$f(arr, i) || _unsupported_iterable_to_array$i(arr, i) || _non_iterable_rest$f();
9708
9708
  }
9709
- function _to_consumable_array$7(arr) {
9710
- return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$g(arr) || _non_iterable_spread$7();
9709
+ function _to_consumable_array$8(arr) {
9710
+ return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$i(arr) || _non_iterable_spread$8();
9711
9711
  }
9712
- function _unsupported_iterable_to_array$g(o, minLen) {
9712
+ function _unsupported_iterable_to_array$i(o, minLen) {
9713
9713
  if (!o) return;
9714
- if (typeof o === "string") return _array_like_to_array$g(o, minLen);
9714
+ if (typeof o === "string") return _array_like_to_array$i(o, minLen);
9715
9715
  var n = Object.prototype.toString.call(o).slice(8, -1);
9716
9716
  if (n === "Object" && o.constructor) n = o.constructor.name;
9717
9717
  if (n === "Map" || n === "Set") return Array.from(n);
9718
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
9718
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$i(o, minLen);
9719
9719
  }
9720
9720
  /**
9721
9721
  @summary Extends the base behavior of d3.nest to allow for multiple depth levels.
@@ -9734,8 +9734,8 @@
9734
9734
  @param fns An array of key accessor functions, one per nesting level.
9735
9735
  */ function nestGroups(data, fns) {
9736
9736
  if (!fns.length) return data;
9737
- return _to_consumable_array$7(group(data, fns[0])).map(function(param) {
9738
- var _param = _sliced_to_array$d(param, 2), key = _param[0], values = _param[1];
9737
+ return _to_consumable_array$8(group(data, fns[0])).map(function(param) {
9738
+ var _param = _sliced_to_array$f(param, 2), key = _param[0], values = _param[1];
9739
9739
  return {
9740
9740
  key: key,
9741
9741
  values: nestGroups(values, fns.slice(1))
@@ -20540,7 +20540,7 @@
20540
20540
  }
20541
20541
  };
20542
20542
 
20543
- function _define_property$7(obj, key, value) {
20543
+ function _define_property$8(obj, key, value) {
20544
20544
  if (key in obj) {
20545
20545
  Object.defineProperty(obj, key, {
20546
20546
  value: value,
@@ -20562,7 +20562,7 @@
20562
20562
  });
20563
20563
  if (locale.location && isoLanguage) {
20564
20564
  var _obj;
20565
- locales.push((_obj = {}, _define_property$7(_obj, "name", locale.language), _define_property$7(_obj, "location", locale.location), _define_property$7(_obj, "tag", locale.tag), _define_property$7(_obj, "lcid", locale.id), _define_property$7(_obj, "iso639-2", isoCodes[isoLanguage]["iso639-2"]), _define_property$7(_obj, "iso639-1", isoCodes[isoLanguage]["iso639-1"]), _obj));
20565
+ locales.push((_obj = {}, _define_property$8(_obj, "name", locale.language), _define_property$8(_obj, "location", locale.location), _define_property$8(_obj, "tag", locale.tag), _define_property$8(_obj, "lcid", locale.id), _define_property$8(_obj, "iso639-2", isoCodes[isoLanguage]["iso639-2"]), _define_property$8(_obj, "iso639-1", isoCodes[isoLanguage]["iso639-1"]), _obj));
20566
20566
  }
20567
20567
  });
20568
20568
  var defaultLocales = {
@@ -21116,7 +21116,7 @@
21116
21116
  };
21117
21117
  return $;
21118
21118
  }
21119
- function paths() {
21119
+ function paths$1() {
21120
21120
  var width = 1;
21121
21121
  var height = 1;
21122
21122
  var size = 20;
@@ -21219,7 +21219,7 @@
21219
21219
  /* eslint import/no-anonymous-default-export: [2, {"allowObject": true}] */ var main = {
21220
21220
  circles: circles,
21221
21221
  lines: lines$1,
21222
- paths: paths
21222
+ paths: paths$1
21223
21223
  };
21224
21224
 
21225
21225
  function ownKeys$4(object, enumerableOnly) {
@@ -21894,15 +21894,15 @@
21894
21894
  };
21895
21895
  }
21896
21896
 
21897
- function _array_like_to_array$f(arr, len) {
21897
+ function _array_like_to_array$h(arr, len) {
21898
21898
  if (len == null || len > arr.length) len = arr.length;
21899
21899
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
21900
21900
  return arr2;
21901
21901
  }
21902
- function _array_with_holes$c(arr) {
21902
+ function _array_with_holes$e(arr) {
21903
21903
  if (Array.isArray(arr)) return arr;
21904
21904
  }
21905
- function _define_property$6(obj, key, value) {
21905
+ function _define_property$7(obj, key, value) {
21906
21906
  if (key in obj) {
21907
21907
  Object.defineProperty(obj, key, {
21908
21908
  value: value,
@@ -21915,7 +21915,7 @@
21915
21915
  }
21916
21916
  return obj;
21917
21917
  }
21918
- function _iterable_to_array_limit$c(arr, i) {
21918
+ function _iterable_to_array_limit$e(arr, i) {
21919
21919
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
21920
21920
  if (_i == null) return;
21921
21921
  var _arr = [];
@@ -21939,7 +21939,7 @@
21939
21939
  }
21940
21940
  return _arr;
21941
21941
  }
21942
- function _non_iterable_rest$c() {
21942
+ function _non_iterable_rest$e() {
21943
21943
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
21944
21944
  }
21945
21945
  function _object_spread$3(target) {
@@ -21952,7 +21952,7 @@
21952
21952
  }));
21953
21953
  }
21954
21954
  ownKeys.forEach(function(key) {
21955
- _define_property$6(target, key, source[key]);
21955
+ _define_property$7(target, key, source[key]);
21956
21956
  });
21957
21957
  }
21958
21958
  return target;
@@ -21976,16 +21976,16 @@
21976
21976
  }
21977
21977
  return target;
21978
21978
  }
21979
- function _sliced_to_array$c(arr, i) {
21980
- return _array_with_holes$c(arr) || _iterable_to_array_limit$c(arr, i) || _unsupported_iterable_to_array$f(arr, i) || _non_iterable_rest$c();
21979
+ function _sliced_to_array$e(arr, i) {
21980
+ return _array_with_holes$e(arr) || _iterable_to_array_limit$e(arr, i) || _unsupported_iterable_to_array$h(arr, i) || _non_iterable_rest$e();
21981
21981
  }
21982
- function _unsupported_iterable_to_array$f(o, minLen) {
21982
+ function _unsupported_iterable_to_array$h(o, minLen) {
21983
21983
  if (!o) return;
21984
- if (typeof o === "string") return _array_like_to_array$f(o, minLen);
21984
+ if (typeof o === "string") return _array_like_to_array$h(o, minLen);
21985
21985
  var n = Object.prototype.toString.call(o).slice(8, -1);
21986
21986
  if (n === "Object" && o.constructor) n = o.constructor.name;
21987
21987
  if (n === "Map" || n === "Set") return Array.from(n);
21988
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
21988
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$h(o, minLen);
21989
21989
  }
21990
21990
  /**
21991
21991
  The default easing curve, identical to d3-transition's default (cubic in-out),
@@ -22167,8 +22167,8 @@
22167
22167
  var _ref, _ref1, _ref2, _ref3, _ref4;
22168
22168
  var _to_transform, _f_transform, _n_transform, _f_transform1, _n_transform1;
22169
22169
  var baseScale = (_ref = (_to_transform = to.transform) === null || _to_transform === void 0 ? void 0 : _to_transform.scale) !== null && _ref !== void 0 ? _ref : 1;
22170
- var _textVisualCenter = _sliced_to_array$c(textVisualCenter(n), 2), nvcx = _textVisualCenter[0], nvcy = _textVisualCenter[1];
22171
- var _textVisualCenter1 = _sliced_to_array$c(textVisualCenter(f5), 2), ovcx = _textVisualCenter1[0], ovcy = _textVisualCenter1[1];
22170
+ var _textVisualCenter = _sliced_to_array$e(textVisualCenter(n), 2), nvcx = _textVisualCenter[0], nvcy = _textVisualCenter[1];
22171
+ var _textVisualCenter1 = _sliced_to_array$e(textVisualCenter(f5), 2), ovcx = _textVisualCenter1[0], ovcy = _textVisualCenter1[1];
22172
22172
  var si = lerpNum(fromSize / toSize, 1);
22173
22173
  var pxI = lerpNum(((_ref1 = (_f_transform = f5.transform) === null || _f_transform === void 0 ? void 0 : _f_transform.x) !== null && _ref1 !== void 0 ? _ref1 : 0) + ovcx, ((_ref2 = (_n_transform = n.transform) === null || _n_transform === void 0 ? void 0 : _n_transform.x) !== null && _ref2 !== void 0 ? _ref2 : 0) + nvcx);
22174
22174
  var pyI = lerpNum(((_ref3 = (_f_transform1 = f5.transform) === null || _f_transform1 === void 0 ? void 0 : _f_transform1.y) !== null && _ref3 !== void 0 ? _ref3 : 0) + ovcy, ((_ref4 = (_n_transform1 = n.transform) === null || _n_transform1 === void 0 ? void 0 : _n_transform1.y) !== null && _ref4 !== void 0 ? _ref4 : 0) + nvcy);
@@ -22259,21 +22259,21 @@
22259
22259
  }
22260
22260
  }
22261
22261
 
22262
- function _array_like_to_array$e(arr, len) {
22262
+ function _array_like_to_array$g(arr, len) {
22263
22263
  if (len == null || len > arr.length) len = arr.length;
22264
22264
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
22265
22265
  return arr2;
22266
22266
  }
22267
- function _array_with_holes$b(arr) {
22267
+ function _array_with_holes$d(arr) {
22268
22268
  if (Array.isArray(arr)) return arr;
22269
22269
  }
22270
- function _array_without_holes$6(arr) {
22271
- if (Array.isArray(arr)) return _array_like_to_array$e(arr);
22270
+ function _array_without_holes$7(arr) {
22271
+ if (Array.isArray(arr)) return _array_like_to_array$g(arr);
22272
22272
  }
22273
- function _iterable_to_array$6(iter) {
22273
+ function _iterable_to_array$7(iter) {
22274
22274
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
22275
22275
  }
22276
- function _iterable_to_array_limit$b(arr, i) {
22276
+ function _iterable_to_array_limit$d(arr, i) {
22277
22277
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
22278
22278
  if (_i == null) return;
22279
22279
  var _arr = [];
@@ -22297,25 +22297,25 @@
22297
22297
  }
22298
22298
  return _arr;
22299
22299
  }
22300
- function _non_iterable_rest$b() {
22300
+ function _non_iterable_rest$d() {
22301
22301
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
22302
22302
  }
22303
- function _non_iterable_spread$6() {
22303
+ function _non_iterable_spread$7() {
22304
22304
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
22305
22305
  }
22306
- function _sliced_to_array$b(arr, i) {
22307
- return _array_with_holes$b(arr) || _iterable_to_array_limit$b(arr, i) || _unsupported_iterable_to_array$e(arr, i) || _non_iterable_rest$b();
22306
+ function _sliced_to_array$d(arr, i) {
22307
+ return _array_with_holes$d(arr) || _iterable_to_array_limit$d(arr, i) || _unsupported_iterable_to_array$g(arr, i) || _non_iterable_rest$d();
22308
22308
  }
22309
- function _to_consumable_array$6(arr) {
22310
- return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$e(arr) || _non_iterable_spread$6();
22309
+ function _to_consumable_array$7(arr) {
22310
+ return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$g(arr) || _non_iterable_spread$7();
22311
22311
  }
22312
- function _unsupported_iterable_to_array$e(o, minLen) {
22312
+ function _unsupported_iterable_to_array$g(o, minLen) {
22313
22313
  if (!o) return;
22314
- if (typeof o === "string") return _array_like_to_array$e(o, minLen);
22314
+ if (typeof o === "string") return _array_like_to_array$g(o, minLen);
22315
22315
  var n = Object.prototype.toString.call(o).slice(8, -1);
22316
22316
  if (n === "Object" && o.constructor) n = o.constructor.name;
22317
22317
  if (n === "Map" || n === "Set") return Array.from(n);
22318
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(o, minLen);
22318
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
22319
22319
  }
22320
22320
  /**
22321
22321
  Motion-trail geometry shared by both backends. A trail is a tapering "cone"
@@ -22360,8 +22360,8 @@
22360
22360
  }), ys = pts.map(function(p) {
22361
22361
  return p[1];
22362
22362
  });
22363
- var minX = (_Math = Math).min.apply(_Math, _to_consumable_array$6(xs)), maxX = (_Math1 = Math).max.apply(_Math1, _to_consumable_array$6(xs));
22364
- var minY = (_Math2 = Math).min.apply(_Math2, _to_consumable_array$6(ys)), maxY = (_Math3 = Math).max.apply(_Math3, _to_consumable_array$6(ys));
22363
+ var minX = (_Math = Math).min.apply(_Math, _to_consumable_array$7(xs)), maxX = (_Math1 = Math).max.apply(_Math1, _to_consumable_array$7(xs));
22364
+ var minY = (_Math2 = Math).min.apply(_Math2, _to_consumable_array$7(ys)), maxY = (_Math3 = Math).max.apply(_Math3, _to_consumable_array$7(ys));
22365
22365
  return {
22366
22366
  x: minX,
22367
22367
  y: minY,
@@ -22395,7 +22395,7 @@
22395
22395
  hh
22396
22396
  ]
22397
22397
  ].map(function(param) {
22398
- var _param = _sliced_to_array$b(param, 2), x = _param[0], y = _param[1];
22398
+ var _param = _sliced_to_array$d(param, 2), x = _param[0], y = _param[1];
22399
22399
  return [
22400
22400
  cx + x * c - y * s,
22401
22401
  cy + x * s + y * c
@@ -22491,7 +22491,7 @@
22491
22491
  ])
22492
22492
  };
22493
22493
  }
22494
- return pathBox(convexHull(_to_consumable_array$6(rectCorners(A[0], A[1], aDims[0], aDims[1], rotate)).concat(_to_consumable_array$6(rectCorners(hx, hy, hDims[0], hDims[1], rotate)))));
22494
+ return pathBox(convexHull(_to_consumable_array$7(rectCorners(A[0], A[1], aDims[0], aDims[1], rotate)).concat(_to_consumable_array$7(rectCorners(hx, hy, hDims[0], hDims[1], rotate)))));
22495
22495
  }
22496
22496
  /**
22497
22497
  The trail's fill: a gradient (objectBoundingBox units) along the travel
@@ -22583,20 +22583,20 @@
22583
22583
  };
22584
22584
  }
22585
22585
 
22586
- function _array_like_to_array$d(arr, len) {
22586
+ function _array_like_to_array$f(arr, len) {
22587
22587
  if (len == null || len > arr.length) len = arr.length;
22588
22588
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
22589
22589
  return arr2;
22590
22590
  }
22591
- function _array_without_holes$5(arr) {
22592
- if (Array.isArray(arr)) return _array_like_to_array$d(arr);
22591
+ function _array_without_holes$6(arr) {
22592
+ if (Array.isArray(arr)) return _array_like_to_array$f(arr);
22593
22593
  }
22594
- function _class_call_check$3(instance, Constructor) {
22594
+ function _class_call_check$4(instance, Constructor) {
22595
22595
  if (!(instance instanceof Constructor)) {
22596
22596
  throw new TypeError("Cannot call a class as a function");
22597
22597
  }
22598
22598
  }
22599
- function _defineProperties$3(target, props) {
22599
+ function _defineProperties$4(target, props) {
22600
22600
  for(var i = 0; i < props.length; i++){
22601
22601
  var descriptor = props[i];
22602
22602
  descriptor.enumerable = descriptor.enumerable || false;
@@ -22605,11 +22605,11 @@
22605
22605
  Object.defineProperty(target, descriptor.key, descriptor);
22606
22606
  }
22607
22607
  }
22608
- function _create_class$3(Constructor, protoProps, staticProps) {
22609
- if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
22608
+ function _create_class$4(Constructor, protoProps, staticProps) {
22609
+ if (protoProps) _defineProperties$4(Constructor.prototype, protoProps);
22610
22610
  return Constructor;
22611
22611
  }
22612
- function _define_property$5(obj, key, value) {
22612
+ function _define_property$6(obj, key, value) {
22613
22613
  if (key in obj) {
22614
22614
  Object.defineProperty(obj, key, {
22615
22615
  value: value,
@@ -22622,10 +22622,10 @@
22622
22622
  }
22623
22623
  return obj;
22624
22624
  }
22625
- function _iterable_to_array$5(iter) {
22625
+ function _iterable_to_array$6(iter) {
22626
22626
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
22627
22627
  }
22628
- function _non_iterable_spread$5() {
22628
+ function _non_iterable_spread$6() {
22629
22629
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
22630
22630
  }
22631
22631
  function _object_spread$2(target) {
@@ -22638,7 +22638,7 @@
22638
22638
  }));
22639
22639
  }
22640
22640
  ownKeys.forEach(function(key) {
22641
- _define_property$5(target, key, source[key]);
22641
+ _define_property$6(target, key, source[key]);
22642
22642
  });
22643
22643
  }
22644
22644
  return target;
@@ -22662,23 +22662,23 @@
22662
22662
  }
22663
22663
  return target;
22664
22664
  }
22665
- function _to_consumable_array$5(arr) {
22666
- return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$d(arr) || _non_iterable_spread$5();
22665
+ function _to_consumable_array$6(arr) {
22666
+ return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$f(arr) || _non_iterable_spread$6();
22667
22667
  }
22668
- function _unsupported_iterable_to_array$d(o, minLen) {
22668
+ function _unsupported_iterable_to_array$f(o, minLen) {
22669
22669
  if (!o) return;
22670
- if (typeof o === "string") return _array_like_to_array$d(o, minLen);
22670
+ if (typeof o === "string") return _array_like_to_array$f(o, minLen);
22671
22671
  var n = Object.prototype.toString.call(o).slice(8, -1);
22672
22672
  if (n === "Object" && o.constructor) n = o.constructor.name;
22673
22673
  if (n === "Map" || n === "Set") return Array.from(n);
22674
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
22674
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
22675
22675
  }
22676
22676
  var TrailLog = /*#__PURE__*/ function() {
22677
22677
  function TrailLog() {
22678
- _class_call_check$3(this, TrailLog);
22679
- _define_property$5(this, "map", new Map());
22678
+ _class_call_check$4(this, TrailLog);
22679
+ _define_property$6(this, "map", new Map());
22680
22680
  }
22681
- _create_class$3(TrailLog, [
22681
+ _create_class$4(TrailLog, [
22682
22682
  {
22683
22683
  /**
22684
22684
  Fold a mark's current geometry into its history, keyed by the timeline value
@@ -22750,7 +22750,7 @@
22750
22750
  // instead of retracting the whole jump and detaching.
22751
22751
  var forwardInFlight = ((_e_animating1 = e.animating) === null || _e_animating1 === void 0 ? void 0 : _e_animating1.dir) === 1 ? e.animating.seg : null;
22752
22752
  e.animating = null;
22753
- var all = forwardInFlight ? _to_consumable_array$5(e.committed).concat([
22753
+ var all = forwardInFlight ? _to_consumable_array$6(e.committed).concat([
22754
22754
  forwardInFlight
22755
22755
  ]) : e.committed;
22756
22756
  e.committed = [];
@@ -24984,7 +24984,7 @@
24984
24984
  return none(series).reverse();
24985
24985
  }
24986
24986
 
24987
- var d3Shape = /*#__PURE__*/Object.freeze({
24987
+ var paths = /*#__PURE__*/Object.freeze({
24988
24988
  __proto__: null,
24989
24989
  arc: arc,
24990
24990
  area: d3area,
@@ -25100,15 +25100,15 @@
25100
25100
  }))) !== null && _gen !== void 0 ? _gen : "";
25101
25101
  }
25102
25102
 
25103
- function _array_like_to_array$c(arr, len) {
25103
+ function _array_like_to_array$e(arr, len) {
25104
25104
  if (len == null || len > arr.length) len = arr.length;
25105
25105
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
25106
25106
  return arr2;
25107
25107
  }
25108
- function _array_with_holes$a(arr) {
25108
+ function _array_with_holes$c(arr) {
25109
25109
  if (Array.isArray(arr)) return arr;
25110
25110
  }
25111
- function _iterable_to_array_limit$a(arr, i) {
25111
+ function _iterable_to_array_limit$c(arr, i) {
25112
25112
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
25113
25113
  if (_i == null) return;
25114
25114
  var _arr = [];
@@ -25132,19 +25132,19 @@
25132
25132
  }
25133
25133
  return _arr;
25134
25134
  }
25135
- function _non_iterable_rest$a() {
25135
+ function _non_iterable_rest$c() {
25136
25136
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
25137
25137
  }
25138
- function _sliced_to_array$a(arr, i) {
25139
- return _array_with_holes$a(arr) || _iterable_to_array_limit$a(arr, i) || _unsupported_iterable_to_array$c(arr, i) || _non_iterable_rest$a();
25138
+ function _sliced_to_array$c(arr, i) {
25139
+ return _array_with_holes$c(arr) || _iterable_to_array_limit$c(arr, i) || _unsupported_iterable_to_array$e(arr, i) || _non_iterable_rest$c();
25140
25140
  }
25141
- function _unsupported_iterable_to_array$c(o, minLen) {
25141
+ function _unsupported_iterable_to_array$e(o, minLen) {
25142
25142
  if (!o) return;
25143
- if (typeof o === "string") return _array_like_to_array$c(o, minLen);
25143
+ if (typeof o === "string") return _array_like_to_array$e(o, minLen);
25144
25144
  var n = Object.prototype.toString.call(o).slice(8, -1);
25145
25145
  if (n === "Object" && o.constructor) n = o.constructor.name;
25146
25146
  if (n === "Map" || n === "Set") return Array.from(n);
25147
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
25147
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(o, minLen);
25148
25148
  }
25149
25149
  var SVG_NS$1 = "http://www.w3.org/2000/svg";
25150
25150
  var XLINK_NS = "http://www.w3.org/1999/xlink";
@@ -25204,8 +25204,8 @@
25204
25204
  var pt = prev.transform || {};
25205
25205
  var nt = node.transform || {};
25206
25206
  var orot = (_pt_rotate = pt.rotate) !== null && _pt_rotate !== void 0 ? _pt_rotate : 0, nrot = (_nt_rotate = nt.rotate) !== null && _nt_rotate !== void 0 ? _nt_rotate : 0;
25207
- var _textVisualCenter = _sliced_to_array$a(textVisualCenter(node), 2), nvcx = _textVisualCenter[0], nvcy = _textVisualCenter[1];
25208
- var _textVisualCenter1 = _sliced_to_array$a(textVisualCenter(prev), 2), ovcx = _textVisualCenter1[0], ovcy = _textVisualCenter1[1];
25207
+ var _textVisualCenter = _sliced_to_array$c(textVisualCenter(node), 2), nvcx = _textVisualCenter[0], nvcy = _textVisualCenter[1];
25208
+ var _textVisualCenter1 = _sliced_to_array$c(textVisualCenter(prev), 2), ovcx = _textVisualCenter1[0], ovcy = _textVisualCenter1[1];
25209
25209
  // Visual-center positions in the parent frame (origin + visual center).
25210
25210
  var oldCx = ((_pt_x = pt.x) !== null && _pt_x !== void 0 ? _pt_x : 0) + ovcx, oldCy = ((_pt_y = pt.y) !== null && _pt_y !== void 0 ? _pt_y : 0) + ovcy;
25211
25211
  var newCx = ((_nt_x = nt.x) !== null && _nt_x !== void 0 ? _nt_x : 0) + nvcx, newCy = ((_nt_y = nt.y) !== null && _nt_y !== void 0 ? _nt_y : 0) + nvcy;
@@ -25341,7 +25341,8 @@
25341
25341
  setPath(target, node.d, animated);
25342
25342
  break;
25343
25343
  case "image":
25344
- target.attr("x", node.x).attr("y", node.y).attr("width", node.width).attr("height", node.height);
25344
+ var _node_preserveAspectRatio;
25345
+ target.attr("x", node.x).attr("y", node.y).attr("width", node.width).attr("height", node.height).attr("preserveAspectRatio", (_node_preserveAspectRatio = node.preserveAspectRatio) !== null && _node_preserveAspectRatio !== void 0 ? _node_preserveAspectRatio : null);
25345
25346
  break;
25346
25347
  case "text":
25347
25348
  target.attr("x", node.x).attr("y", node.y);
@@ -25351,12 +25352,12 @@
25351
25352
  target.attr("transform", transformStr(node));
25352
25353
  }
25353
25354
 
25354
- function _class_call_check$2(instance, Constructor) {
25355
+ function _class_call_check$3(instance, Constructor) {
25355
25356
  if (!(instance instanceof Constructor)) {
25356
25357
  throw new TypeError("Cannot call a class as a function");
25357
25358
  }
25358
25359
  }
25359
- function _defineProperties$2(target, props) {
25360
+ function _defineProperties$3(target, props) {
25360
25361
  for(var i = 0; i < props.length; i++){
25361
25362
  var descriptor = props[i];
25362
25363
  descriptor.enumerable = descriptor.enumerable || false;
@@ -25365,11 +25366,11 @@
25365
25366
  Object.defineProperty(target, descriptor.key, descriptor);
25366
25367
  }
25367
25368
  }
25368
- function _create_class$2(Constructor, protoProps, staticProps) {
25369
- if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
25369
+ function _create_class$3(Constructor, protoProps, staticProps) {
25370
+ if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
25370
25371
  return Constructor;
25371
25372
  }
25372
- function _define_property$4(obj, key, value) {
25373
+ function _define_property$5(obj, key, value) {
25373
25374
  if (key in obj) {
25374
25375
  Object.defineProperty(obj, key, {
25375
25376
  value: value,
@@ -25492,17 +25493,17 @@
25492
25493
  renderer's (possibly not-yet-mounted) state.
25493
25494
  */ var TrailGradients = /*#__PURE__*/ function() {
25494
25495
  function TrailGradients(defs, uid) {
25495
- _class_call_check$2(this, TrailGradients);
25496
- _define_property$4(this, "defs", void 0);
25497
- _define_property$4(this, "uid", void 0);
25498
- _define_property$4(this, "map", void 0);
25499
- _define_property$4(this, "seq", void 0);
25496
+ _class_call_check$3(this, TrailGradients);
25497
+ _define_property$5(this, "defs", void 0);
25498
+ _define_property$5(this, "uid", void 0);
25499
+ _define_property$5(this, "map", void 0);
25500
+ _define_property$5(this, "seq", void 0);
25500
25501
  this.defs = defs;
25501
25502
  this.uid = uid;
25502
25503
  this.map = new Map();
25503
25504
  this.seq = 0;
25504
25505
  }
25505
- _create_class$2(TrailGradients, [
25506
+ _create_class$3(TrailGradients, [
25506
25507
  {
25507
25508
  /** Create/update this mark's gradient from a `gradient:<json>` token; returns its url. */ key: "apply",
25508
25509
  value: function apply(key, fill) {
@@ -25866,23 +25867,23 @@
25866
25867
  }
25867
25868
  }
25868
25869
 
25869
- function _array_like_to_array$b(arr, len) {
25870
+ function _array_like_to_array$d(arr, len) {
25870
25871
  if (len == null || len > arr.length) len = arr.length;
25871
25872
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
25872
25873
  return arr2;
25873
25874
  }
25874
- function _array_with_holes$9(arr) {
25875
+ function _array_with_holes$b(arr) {
25875
25876
  if (Array.isArray(arr)) return arr;
25876
25877
  }
25877
- function _array_without_holes$4(arr) {
25878
- if (Array.isArray(arr)) return _array_like_to_array$b(arr);
25878
+ function _array_without_holes$5(arr) {
25879
+ if (Array.isArray(arr)) return _array_like_to_array$d(arr);
25879
25880
  }
25880
- function _class_call_check$1(instance, Constructor) {
25881
+ function _class_call_check$2(instance, Constructor) {
25881
25882
  if (!(instance instanceof Constructor)) {
25882
25883
  throw new TypeError("Cannot call a class as a function");
25883
25884
  }
25884
25885
  }
25885
- function _defineProperties$1(target, props) {
25886
+ function _defineProperties$2(target, props) {
25886
25887
  for(var i = 0; i < props.length; i++){
25887
25888
  var descriptor = props[i];
25888
25889
  descriptor.enumerable = descriptor.enumerable || false;
@@ -25891,11 +25892,11 @@
25891
25892
  Object.defineProperty(target, descriptor.key, descriptor);
25892
25893
  }
25893
25894
  }
25894
- function _create_class$1(Constructor, protoProps, staticProps) {
25895
- if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
25895
+ function _create_class$2(Constructor, protoProps, staticProps) {
25896
+ if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
25896
25897
  return Constructor;
25897
25898
  }
25898
- function _define_property$3(obj, key, value) {
25899
+ function _define_property$4(obj, key, value) {
25899
25900
  if (key in obj) {
25900
25901
  Object.defineProperty(obj, key, {
25901
25902
  value: value,
@@ -25908,10 +25909,10 @@
25908
25909
  }
25909
25910
  return obj;
25910
25911
  }
25911
- function _iterable_to_array$4(iter) {
25912
+ function _iterable_to_array$5(iter) {
25912
25913
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
25913
25914
  }
25914
- function _iterable_to_array_limit$9(arr, i) {
25915
+ function _iterable_to_array_limit$b(arr, i) {
25915
25916
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
25916
25917
  if (_i == null) return;
25917
25918
  var _arr = [];
@@ -25935,25 +25936,25 @@
25935
25936
  }
25936
25937
  return _arr;
25937
25938
  }
25938
- function _non_iterable_rest$9() {
25939
+ function _non_iterable_rest$b() {
25939
25940
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
25940
25941
  }
25941
- function _non_iterable_spread$4() {
25942
+ function _non_iterable_spread$5() {
25942
25943
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
25943
25944
  }
25944
- function _sliced_to_array$9(arr, i) {
25945
- return _array_with_holes$9(arr) || _iterable_to_array_limit$9(arr, i) || _unsupported_iterable_to_array$b(arr, i) || _non_iterable_rest$9();
25945
+ function _sliced_to_array$b(arr, i) {
25946
+ return _array_with_holes$b(arr) || _iterable_to_array_limit$b(arr, i) || _unsupported_iterable_to_array$d(arr, i) || _non_iterable_rest$b();
25946
25947
  }
25947
- function _to_consumable_array$4(arr) {
25948
- return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$b(arr) || _non_iterable_spread$4();
25948
+ function _to_consumable_array$5(arr) {
25949
+ return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$d(arr) || _non_iterable_spread$5();
25949
25950
  }
25950
- function _unsupported_iterable_to_array$b(o, minLen) {
25951
+ function _unsupported_iterable_to_array$d(o, minLen) {
25951
25952
  if (!o) return;
25952
- if (typeof o === "string") return _array_like_to_array$b(o, minLen);
25953
+ if (typeof o === "string") return _array_like_to_array$d(o, minLen);
25953
25954
  var n = Object.prototype.toString.call(o).slice(8, -1);
25954
25955
  if (n === "Object" && o.constructor) n = o.constructor.name;
25955
25956
  if (n === "Map" || n === "Set") return Array.from(n);
25956
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
25957
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
25957
25958
  }
25958
25959
  /**
25959
25960
  A Renderer backend that realizes a Scene as SVG, using a keyed enter/update/exit
@@ -25971,39 +25972,39 @@
25971
25972
  var SvgRenderer = /*#__PURE__*/ function() {
25972
25973
  function SvgRenderer() {
25973
25974
  var _this = this;
25974
- _class_call_check$1(this, SvgRenderer);
25975
- _define_property$3(this, "kind", "svg");
25976
- /** Unique per-instance prefix for this renderer's document-scoped def ids. */ _define_property$3(this, "_uid", ++rendererInstanceSeq);
25977
- _define_property$3(this, "_target", void 0);
25978
- _define_property$3(this, "_svg", void 0);
25979
- _define_property$3(this, "_root", void 0);
25980
- /** Per-mark position history for persistent motion trails. */ _define_property$3(this, "_trailLog", new TrailLog());
25981
- /** Whether persistent trails are active this draw (single-period timeline). */ _define_property$3(this, "_trailActive", false);
25982
- /** Lazy <defs> for clipPaths / patterns. Created on first use. */ _define_property$3(this, "_defs", void 0);
25983
- /** Stable id counter so each GroupNode clip gets a unique <clipPath>. */ _define_property$3(this, "_clipIds", new Map());
25984
- _define_property$3(this, "_clipSeq", 0);
25985
- /** Sibling host for HtmlOverlayNode mounts. Positioned absolutely over the svg. */ _define_property$3(this, "_overlayHost", void 0);
25986
- _define_property$3(this, "_scene", void 0);
25987
- _define_property$3(this, "_index", new Map());
25988
- _define_property$3(this, "_textureDefs", new Map());
25989
- /** Cache of `gradient:<json>` token → `url(#id)`, materialized in <defs>. */ _define_property$3(this, "_gradientDefs", new Map());
25990
- _define_property$3(this, "_gradientSeq", 0);
25991
- /** Reused per-mark userSpaceOnUse gradients for persistent trails. */ _define_property$3(this, "_trailGrads", new TrailGradients(function() {
25975
+ _class_call_check$2(this, SvgRenderer);
25976
+ _define_property$4(this, "kind", "svg");
25977
+ /** Unique per-instance prefix for this renderer's document-scoped def ids. */ _define_property$4(this, "_uid", ++rendererInstanceSeq);
25978
+ _define_property$4(this, "_target", void 0);
25979
+ _define_property$4(this, "_svg", void 0);
25980
+ _define_property$4(this, "_root", void 0);
25981
+ /** Per-mark position history for persistent motion trails. */ _define_property$4(this, "_trailLog", new TrailLog());
25982
+ /** Whether persistent trails are active this draw (single-period timeline). */ _define_property$4(this, "_trailActive", false);
25983
+ /** Lazy <defs> for clipPaths / patterns. Created on first use. */ _define_property$4(this, "_defs", void 0);
25984
+ /** Stable id counter so each GroupNode clip gets a unique <clipPath>. */ _define_property$4(this, "_clipIds", new Map());
25985
+ _define_property$4(this, "_clipSeq", 0);
25986
+ /** Sibling host for HtmlOverlayNode mounts. Positioned absolutely over the svg. */ _define_property$4(this, "_overlayHost", void 0);
25987
+ _define_property$4(this, "_scene", void 0);
25988
+ _define_property$4(this, "_index", new Map());
25989
+ _define_property$4(this, "_textureDefs", new Map());
25990
+ /** Cache of `gradient:<json>` token → `url(#id)`, materialized in <defs>. */ _define_property$4(this, "_gradientDefs", new Map());
25991
+ _define_property$4(this, "_gradientSeq", 0);
25992
+ /** Reused per-mark userSpaceOnUse gradients for persistent trails. */ _define_property$4(this, "_trailGrads", new TrailGradients(function() {
25992
25993
  return _this._ensureDefs();
25993
25994
  }, function() {
25994
25995
  return _this._uid;
25995
25996
  }));
25996
- _define_property$3(this, "_handlers", new Set());
25997
- _define_property$3(this, "_domListeners", {});
25998
- _define_property$3(this, "_listening", false);
25999
- _define_property$3(this, "_hoverKey", null);
26000
- _define_property$3(this, "_timers", new Set());
26001
- _define_property$3(this, "_invalidatePointerRect", null);
26002
- _define_property$3(this, "_removePointerRectListeners", null);
26003
- /** Cancel handle for the latest drawScene transition; flipped on overlap. */ _define_property$3(this, "_cancelDraw", null);
26004
- /** Marks `_index` as needing a rebuild before the next external read. */ _define_property$3(this, "_indexDirty", true);
26005
- }
26006
- _create_class$1(SvgRenderer, [
25997
+ _define_property$4(this, "_handlers", new Set());
25998
+ _define_property$4(this, "_domListeners", {});
25999
+ _define_property$4(this, "_listening", false);
26000
+ _define_property$4(this, "_hoverKey", null);
26001
+ _define_property$4(this, "_timers", new Set());
26002
+ _define_property$4(this, "_invalidatePointerRect", null);
26003
+ _define_property$4(this, "_removePointerRectListeners", null);
26004
+ /** Cancel handle for the latest drawScene transition; flipped on overlap. */ _define_property$4(this, "_cancelDraw", null);
26005
+ /** Marks `_index` as needing a rebuild before the next external read. */ _define_property$4(this, "_indexDirty", true);
26006
+ }
26007
+ _create_class$2(SvgRenderer, [
26007
26008
  {
26008
26009
  key: "mount",
26009
26010
  value: function mount(target) {
@@ -26194,7 +26195,7 @@
26194
26195
  if (k in t) {
26195
26196
  var _t;
26196
26197
  var v = config[k];
26197
- if (Array.isArray(v)) (_t = t)[k].apply(_t, _to_consumable_array$4(v));
26198
+ if (Array.isArray(v)) (_t = t)[k].apply(_t, _to_consumable_array$5(v));
26198
26199
  else t[k](v);
26199
26200
  }
26200
26201
  }
@@ -26232,7 +26233,7 @@
26232
26233
  break;
26233
26234
  }
26234
26235
  }
26235
- var ordered = needsSort ? _to_consumable_array$4(svgChildren).sort(function(a, b) {
26236
+ var ordered = needsSort ? _to_consumable_array$5(svgChildren).sort(function(a, b) {
26236
26237
  var _a_z, _b_z;
26237
26238
  return ((_a_z = a.z) !== null && _a_z !== void 0 ? _a_z : 0) - ((_b_z = b.z) !== null && _b_z !== void 0 ? _b_z : 0);
26238
26239
  }) : svgChildren;
@@ -26570,7 +26571,7 @@
26570
26571
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
26571
26572
  try {
26572
26573
  for(var _iterator = Object.entries(this._domListeners)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
26573
- var _step_value = _sliced_to_array$9(_step.value, 2), k = _step_value[0], fn = _step_value[1];
26574
+ var _step_value = _sliced_to_array$b(_step.value, 2), k = _step_value[0], fn = _step_value[1];
26574
26575
  svg.addEventListener(k, fn);
26575
26576
  }
26576
26577
  } catch (err) {
@@ -26648,7 +26649,7 @@
26648
26649
  var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
26649
26650
  try {
26650
26651
  for(var _iterator1 = Object.entries(this._domListeners)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
26651
- var _step_value = _sliced_to_array$9(_step1.value, 2), k = _step_value[0], fn = _step_value[1];
26652
+ var _step_value = _sliced_to_array$b(_step1.value, 2), k = _step_value[0], fn = _step_value[1];
26652
26653
  this._svg.removeEventListener(k, fn);
26653
26654
  }
26654
26655
  } catch (err) {
@@ -26697,15 +26698,15 @@
26697
26698
  return SvgRenderer;
26698
26699
  }();
26699
26700
 
26700
- function _array_like_to_array$a(arr, len) {
26701
+ function _array_like_to_array$c(arr, len) {
26701
26702
  if (len == null || len > arr.length) len = arr.length;
26702
26703
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
26703
26704
  return arr2;
26704
26705
  }
26705
- function _array_with_holes$8(arr) {
26706
+ function _array_with_holes$a(arr) {
26706
26707
  if (Array.isArray(arr)) return arr;
26707
26708
  }
26708
- function _define_property$2(obj, key, value) {
26709
+ function _define_property$3(obj, key, value) {
26709
26710
  if (key in obj) {
26710
26711
  Object.defineProperty(obj, key, {
26711
26712
  value: value,
@@ -26718,7 +26719,7 @@
26718
26719
  }
26719
26720
  return obj;
26720
26721
  }
26721
- function _iterable_to_array_limit$8(arr, i) {
26722
+ function _iterable_to_array_limit$a(arr, i) {
26722
26723
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
26723
26724
  if (_i == null) return;
26724
26725
  var _arr = [];
@@ -26742,7 +26743,7 @@
26742
26743
  }
26743
26744
  return _arr;
26744
26745
  }
26745
- function _non_iterable_rest$8() {
26746
+ function _non_iterable_rest$a() {
26746
26747
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
26747
26748
  }
26748
26749
  function _object_spread$1(target) {
@@ -26755,7 +26756,7 @@
26755
26756
  }));
26756
26757
  }
26757
26758
  ownKeys.forEach(function(key) {
26758
- _define_property$2(target, key, source[key]);
26759
+ _define_property$3(target, key, source[key]);
26759
26760
  });
26760
26761
  }
26761
26762
  return target;
@@ -26779,16 +26780,16 @@
26779
26780
  }
26780
26781
  return target;
26781
26782
  }
26782
- function _sliced_to_array$8(arr, i) {
26783
- return _array_with_holes$8(arr) || _iterable_to_array_limit$8(arr, i) || _unsupported_iterable_to_array$a(arr, i) || _non_iterable_rest$8();
26783
+ function _sliced_to_array$a(arr, i) {
26784
+ return _array_with_holes$a(arr) || _iterable_to_array_limit$a(arr, i) || _unsupported_iterable_to_array$c(arr, i) || _non_iterable_rest$a();
26784
26785
  }
26785
- function _unsupported_iterable_to_array$a(o, minLen) {
26786
+ function _unsupported_iterable_to_array$c(o, minLen) {
26786
26787
  if (!o) return;
26787
- if (typeof o === "string") return _array_like_to_array$a(o, minLen);
26788
+ if (typeof o === "string") return _array_like_to_array$c(o, minLen);
26788
26789
  var n = Object.prototype.toString.call(o).slice(8, -1);
26789
26790
  if (n === "Object" && o.constructor) n = o.constructor.name;
26790
26791
  if (n === "Map" || n === "Set") return Array.from(n);
26791
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
26792
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
26792
26793
  }
26793
26794
  /**
26794
26795
  Reads a motion-trail spec off a moving update-pair of trailed mark nodes,
@@ -26885,7 +26886,7 @@
26885
26886
  var trailSpecs = [];
26886
26887
  var persist = [];
26887
26888
  var updaters = update.map(function(param) {
26888
- var _param = _sliced_to_array$8(param, 2), a = _param[0], b = _param[1];
26889
+ var _param = _sliced_to_array$a(param, 2), a = _param[0], b = _param[1];
26889
26890
  if (a.type === "group" && b.type === "group") {
26890
26891
  return wrapGroup(interpolateNode(a, b), interpolateChildren(a.children, b.children, log));
26891
26892
  }
@@ -27045,15 +27046,15 @@
27045
27046
  };
27046
27047
  }
27047
27048
 
27048
- function _array_like_to_array$9(arr, len) {
27049
+ function _array_like_to_array$b(arr, len) {
27049
27050
  if (len == null || len > arr.length) len = arr.length;
27050
27051
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
27051
27052
  return arr2;
27052
27053
  }
27053
- function _array_with_holes$7(arr) {
27054
+ function _array_with_holes$9(arr) {
27054
27055
  if (Array.isArray(arr)) return arr;
27055
27056
  }
27056
- function _iterable_to_array_limit$7(arr, i) {
27057
+ function _iterable_to_array_limit$9(arr, i) {
27057
27058
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
27058
27059
  if (_i == null) return;
27059
27060
  var _arr = [];
@@ -27077,19 +27078,19 @@
27077
27078
  }
27078
27079
  return _arr;
27079
27080
  }
27080
- function _non_iterable_rest$7() {
27081
+ function _non_iterable_rest$9() {
27081
27082
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
27082
27083
  }
27083
- function _sliced_to_array$7(arr, i) {
27084
- return _array_with_holes$7(arr) || _iterable_to_array_limit$7(arr, i) || _unsupported_iterable_to_array$9(arr, i) || _non_iterable_rest$7();
27084
+ function _sliced_to_array$9(arr, i) {
27085
+ return _array_with_holes$9(arr) || _iterable_to_array_limit$9(arr, i) || _unsupported_iterable_to_array$b(arr, i) || _non_iterable_rest$9();
27085
27086
  }
27086
- function _unsupported_iterable_to_array$9(o, minLen) {
27087
+ function _unsupported_iterable_to_array$b(o, minLen) {
27087
27088
  if (!o) return;
27088
- if (typeof o === "string") return _array_like_to_array$9(o, minLen);
27089
+ if (typeof o === "string") return _array_like_to_array$b(o, minLen);
27089
27090
  var n = Object.prototype.toString.call(o).slice(8, -1);
27090
27091
  if (n === "Object" && o.constructor) n = o.constructor.name;
27091
27092
  if (n === "Map" || n === "Set") return Array.from(n);
27092
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
27093
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
27093
27094
  }
27094
27095
  var identity$7 = [
27095
27096
  1,
@@ -27164,7 +27165,7 @@
27164
27165
  0
27165
27166
  ];
27166
27167
  if (tr.rotateAnchor) {
27167
- var _tr_rotateAnchor = _sliced_to_array$7(tr.rotateAnchor, 2), ax = _tr_rotateAnchor[0], ay = _tr_rotateAnchor[1];
27168
+ var _tr_rotateAnchor = _sliced_to_array$9(tr.rotateAnchor, 2), ax = _tr_rotateAnchor[0], ay = _tr_rotateAnchor[1];
27168
27169
  m = multiply$1(m, multiply$1([
27169
27170
  1,
27170
27171
  0,
@@ -27381,30 +27382,30 @@
27381
27382
  }
27382
27383
  }
27383
27384
 
27384
- function _array_like_to_array$8(arr, len) {
27385
+ function _array_like_to_array$a(arr, len) {
27385
27386
  if (len == null || len > arr.length) len = arr.length;
27386
27387
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
27387
27388
  return arr2;
27388
27389
  }
27389
- function _array_without_holes$3(arr) {
27390
- if (Array.isArray(arr)) return _array_like_to_array$8(arr);
27390
+ function _array_without_holes$4(arr) {
27391
+ if (Array.isArray(arr)) return _array_like_to_array$a(arr);
27391
27392
  }
27392
- function _iterable_to_array$3(iter) {
27393
+ function _iterable_to_array$4(iter) {
27393
27394
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
27394
27395
  }
27395
- function _non_iterable_spread$3() {
27396
+ function _non_iterable_spread$4() {
27396
27397
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
27397
27398
  }
27398
- function _to_consumable_array$3(arr) {
27399
- return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$3();
27399
+ function _to_consumable_array$4(arr) {
27400
+ return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$4();
27400
27401
  }
27401
- function _unsupported_iterable_to_array$8(o, minLen) {
27402
+ function _unsupported_iterable_to_array$a(o, minLen) {
27402
27403
  if (!o) return;
27403
- if (typeof o === "string") return _array_like_to_array$8(o, minLen);
27404
+ if (typeof o === "string") return _array_like_to_array$a(o, minLen);
27404
27405
  var n = Object.prototype.toString.call(o).slice(8, -1);
27405
27406
  if (n === "Object" && o.constructor) n = o.constructor.name;
27406
27407
  if (n === "Map" || n === "Set") return Array.from(n);
27407
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
27408
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
27408
27409
  }
27409
27410
  var SVG_NS = "http://www.w3.org/2000/svg";
27410
27411
  /**
@@ -27442,7 +27443,7 @@
27442
27443
  if (k in t) {
27443
27444
  var _t;
27444
27445
  var v = config[k];
27445
- if (Array.isArray(v)) (_t = t)[k].apply(_t, _to_consumable_array$3(v));
27446
+ if (Array.isArray(v)) (_t = t)[k].apply(_t, _to_consumable_array$4(v));
27446
27447
  else t[k](v);
27447
27448
  }
27448
27449
  }
@@ -27469,23 +27470,23 @@
27469
27470
  };
27470
27471
  }
27471
27472
 
27472
- function _array_like_to_array$7(arr, len) {
27473
+ function _array_like_to_array$9(arr, len) {
27473
27474
  if (len == null || len > arr.length) len = arr.length;
27474
27475
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
27475
27476
  return arr2;
27476
27477
  }
27477
- function _array_with_holes$6(arr) {
27478
+ function _array_with_holes$8(arr) {
27478
27479
  if (Array.isArray(arr)) return arr;
27479
27480
  }
27480
- function _array_without_holes$2(arr) {
27481
- if (Array.isArray(arr)) return _array_like_to_array$7(arr);
27481
+ function _array_without_holes$3(arr) {
27482
+ if (Array.isArray(arr)) return _array_like_to_array$9(arr);
27482
27483
  }
27483
- function _class_call_check(instance, Constructor) {
27484
+ function _class_call_check$1(instance, Constructor) {
27484
27485
  if (!(instance instanceof Constructor)) {
27485
27486
  throw new TypeError("Cannot call a class as a function");
27486
27487
  }
27487
27488
  }
27488
- function _defineProperties(target, props) {
27489
+ function _defineProperties$1(target, props) {
27489
27490
  for(var i = 0; i < props.length; i++){
27490
27491
  var descriptor = props[i];
27491
27492
  descriptor.enumerable = descriptor.enumerable || false;
@@ -27494,11 +27495,11 @@
27494
27495
  Object.defineProperty(target, descriptor.key, descriptor);
27495
27496
  }
27496
27497
  }
27497
- function _create_class(Constructor, protoProps, staticProps) {
27498
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
27498
+ function _create_class$1(Constructor, protoProps, staticProps) {
27499
+ if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
27499
27500
  return Constructor;
27500
27501
  }
27501
- function _define_property$1(obj, key, value) {
27502
+ function _define_property$2(obj, key, value) {
27502
27503
  if (key in obj) {
27503
27504
  Object.defineProperty(obj, key, {
27504
27505
  value: value,
@@ -27511,10 +27512,10 @@
27511
27512
  }
27512
27513
  return obj;
27513
27514
  }
27514
- function _iterable_to_array$2(iter) {
27515
+ function _iterable_to_array$3(iter) {
27515
27516
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
27516
27517
  }
27517
- function _iterable_to_array_limit$6(arr, i) {
27518
+ function _iterable_to_array_limit$8(arr, i) {
27518
27519
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
27519
27520
  if (_i == null) return;
27520
27521
  var _arr = [];
@@ -27538,25 +27539,25 @@
27538
27539
  }
27539
27540
  return _arr;
27540
27541
  }
27541
- function _non_iterable_rest$6() {
27542
+ function _non_iterable_rest$8() {
27542
27543
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
27543
27544
  }
27544
- function _non_iterable_spread$2() {
27545
+ function _non_iterable_spread$3() {
27545
27546
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
27546
27547
  }
27547
- function _sliced_to_array$6(arr, i) {
27548
- return _array_with_holes$6(arr) || _iterable_to_array_limit$6(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$6();
27548
+ function _sliced_to_array$8(arr, i) {
27549
+ return _array_with_holes$8(arr) || _iterable_to_array_limit$8(arr, i) || _unsupported_iterable_to_array$9(arr, i) || _non_iterable_rest$8();
27549
27550
  }
27550
- function _to_consumable_array$2(arr) {
27551
- return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$2();
27551
+ function _to_consumable_array$3(arr) {
27552
+ return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$9(arr) || _non_iterable_spread$3();
27552
27553
  }
27553
- function _unsupported_iterable_to_array$7(o, minLen) {
27554
+ function _unsupported_iterable_to_array$9(o, minLen) {
27554
27555
  if (!o) return;
27555
- if (typeof o === "string") return _array_like_to_array$7(o, minLen);
27556
+ if (typeof o === "string") return _array_like_to_array$9(o, minLen);
27556
27557
  var n = Object.prototype.toString.call(o).slice(8, -1);
27557
27558
  if (n === "Object" && o.constructor) n = o.constructor.name;
27558
27559
  if (n === "Map" || n === "Set") return Array.from(n);
27559
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
27560
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
27560
27561
  }
27561
27562
  var raf = typeof requestAnimationFrame === "function" ? function(cb) {
27562
27563
  return requestAnimationFrame(function() {
@@ -27573,47 +27574,47 @@
27573
27574
  var CanvasRenderer = /*#__PURE__*/ function() {
27574
27575
  function CanvasRenderer() {
27575
27576
  var _this = this;
27576
- _class_call_check(this, CanvasRenderer);
27577
- _define_property$1(this, "kind", "canvas");
27578
- _define_property$1(this, "_target", void 0);
27579
- _define_property$1(this, "_canvas", void 0);
27580
- _define_property$1(this, "_ctx", void 0);
27581
- /** Sibling host for HtmlOverlayNode mounts (same approach as SvgRenderer). */ _define_property$1(this, "_overlayHost", void 0);
27577
+ _class_call_check$1(this, CanvasRenderer);
27578
+ _define_property$2(this, "kind", "canvas");
27579
+ _define_property$2(this, "_target", void 0);
27580
+ _define_property$2(this, "_canvas", void 0);
27581
+ _define_property$2(this, "_ctx", void 0);
27582
+ /** Sibling host for HtmlOverlayNode mounts (same approach as SvgRenderer). */ _define_property$2(this, "_overlayHost", void 0);
27582
27583
  /**
27583
27584
  * Cached key→element map for HtmlOverlay reconcile. Mutated as overlays
27584
27585
  * enter/exit so the hot path (every draw, including 60Hz zoom ticks)
27585
27586
  * doesn't pay for `host.querySelectorAll(':scope > .d3plus-render-overlay')`.
27586
- */ _define_property$1(this, "_overlayMap", new Map());
27587
- _define_property$1(this, "_ratio", 1);
27588
- _define_property$1(this, "_width", 0);
27589
- _define_property$1(this, "_height", 0);
27590
- _define_property$1(this, "_scene", null);
27591
- /** Per-mark position history for persistent motion trails. */ _define_property$1(this, "_trailLog", new TrailLog());
27592
- _define_property$1(this, "_pickIndex", []);
27593
- _define_property$1(this, "_images", new Map());
27587
+ */ _define_property$2(this, "_overlayMap", new Map());
27588
+ _define_property$2(this, "_ratio", 1);
27589
+ _define_property$2(this, "_width", 0);
27590
+ _define_property$2(this, "_height", 0);
27591
+ _define_property$2(this, "_scene", null);
27592
+ /** Per-mark position history for persistent motion trails. */ _define_property$2(this, "_trailLog", new TrailLog());
27593
+ _define_property$2(this, "_pickIndex", []);
27594
+ _define_property$2(this, "_images", new Map());
27594
27595
  // Token → tiled CanvasPattern (rasterized from the texture's SVG tile), plus
27595
27596
  // the set of tokens whose rasterization is in flight. `_patternResolver` is a
27596
27597
  // pre-bound view passed into the paint path so no closure is allocated per
27597
27598
  // node per frame.
27598
- _define_property$1(this, "_patterns", new Map());
27599
- _define_property$1(this, "_patternsPending", new Set());
27600
- _define_property$1(this, "_patternResolver", function(token) {
27599
+ _define_property$2(this, "_patterns", new Map());
27600
+ _define_property$2(this, "_patternsPending", new Set());
27601
+ _define_property$2(this, "_patternResolver", function(token) {
27601
27602
  return _this._resolvePattern(token);
27602
27603
  });
27603
- _define_property$1(this, "_handlers", new Set());
27604
- _define_property$1(this, "_domListeners", {});
27605
- _define_property$1(this, "_listening", false);
27606
- _define_property$1(this, "_hoverKey", null);
27607
- _define_property$1(this, "_frame", 0);
27604
+ _define_property$2(this, "_handlers", new Set());
27605
+ _define_property$2(this, "_domListeners", {});
27606
+ _define_property$2(this, "_listening", false);
27607
+ _define_property$2(this, "_hoverKey", null);
27608
+ _define_property$2(this, "_frame", 0);
27608
27609
  /**
27609
27610
  * `_cancelAnim(soft?)` — call with `soft=true` to stop the tick loop
27610
27611
  * without snap-painting the target scene; `false`/omitted snaps + paints
27611
27612
  * (so external `handle.cancel()` matches what resize/toSVGString see).
27612
- */ _define_property$1(this, "_cancelAnim", null);
27613
- _define_property$1(this, "_invalidatePointerRect", null);
27614
- _define_property$1(this, "_removePointerRectListeners", null);
27613
+ */ _define_property$2(this, "_cancelAnim", null);
27614
+ _define_property$2(this, "_invalidatePointerRect", null);
27615
+ _define_property$2(this, "_removePointerRectListeners", null);
27615
27616
  }
27616
- _create_class(CanvasRenderer, [
27617
+ _create_class$1(CanvasRenderer, [
27617
27618
  {
27618
27619
  key: "mount",
27619
27620
  value: function mount(target) {
@@ -27779,7 +27780,7 @@
27779
27780
  break;
27780
27781
  }
27781
27782
  }
27782
- var ordered = needsSort ? _to_consumable_array$2(children).sort(function(a, b) {
27783
+ var ordered = needsSort ? _to_consumable_array$3(children).sort(function(a, b) {
27783
27784
  var _a_z, _b_z;
27784
27785
  return ((_a_z = a.z) !== null && _a_z !== void 0 ? _a_z : 0) - ((_b_z = b.z) !== null && _b_z !== void 0 ? _b_z : 0);
27785
27786
  }) : children;
@@ -27912,7 +27913,7 @@
27912
27913
  var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
27913
27914
  try {
27914
27915
  for(var _iterator1 = existing[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
27915
- var _step_value = _sliced_to_array$6(_step1.value, 2), key1 = _step_value[0], el1 = _step_value[1];
27916
+ var _step_value = _sliced_to_array$8(_step1.value, 2), key1 = _step_value[0], el1 = _step_value[1];
27916
27917
  if (!seen.has(key1)) {
27917
27918
  el1.remove();
27918
27919
  existing.delete(key1);
@@ -28064,7 +28065,22 @@
28064
28065
  }
28065
28066
  if (img.complete && img.naturalWidth) {
28066
28067
  ctx.globalAlpha = alpha;
28067
- ctx.drawImage(img, node.x, node.y, node.width, node.height);
28068
+ var par = node.preserveAspectRatio;
28069
+ var iw = img.naturalWidth, ih = img.naturalHeight;
28070
+ if (par && par.includes("slice")) {
28071
+ // CSS `cover`: scale the image to fill the box, cropping the overflow
28072
+ // (centered), via drawImage's source-rect crop.
28073
+ var scale = Math.max(node.width / iw, node.height / ih);
28074
+ var sw = node.width / scale, sh = node.height / scale;
28075
+ ctx.drawImage(img, (iw - sw) / 2, (ih - sh) / 2, sw, sh, node.x, node.y, node.width, node.height);
28076
+ } else if (par && par !== "none" && par.includes("meet")) {
28077
+ // CSS `contain`: fit the whole image inside the box (centered).
28078
+ var scale1 = Math.min(node.width / iw, node.height / ih);
28079
+ var dw = iw * scale1, dh = ih * scale1;
28080
+ ctx.drawImage(img, node.x + (node.width - dw) / 2, node.y + (node.height - dh) / 2, dw, dh);
28081
+ } else {
28082
+ ctx.drawImage(img, node.x, node.y, node.width, node.height);
28083
+ }
28068
28084
  }
28069
28085
  }
28070
28086
  },
@@ -28074,7 +28090,7 @@
28074
28090
  // Topmost wins: entries are in paint order, so search from the end.
28075
28091
  for(var i = this._pickIndex.length - 1; i >= 0; i--){
28076
28092
  var _this__pickIndex_i = this._pickIndex[i], node = _this__pickIndex_i.node, inverse = _this__pickIndex_i.inverse;
28077
- var _apply = _sliced_to_array$6(apply(inverse, [
28093
+ var _apply = _sliced_to_array$8(apply(inverse, [
28078
28094
  point[0] * this._ratio,
28079
28095
  point[1] * this._ratio
28080
28096
  ]), 2), lx = _apply[0], ly = _apply[1];
@@ -28120,8 +28136,8 @@
28120
28136
  var tol = ((_ref = (_node_paint = node.paint) === null || _node_paint === void 0 ? void 0 : _node_paint.strokeWidth) !== null && _ref !== void 0 ? _ref : 1) / 2 + 2;
28121
28137
  var pts = node.points;
28122
28138
  for(var i = 1; i < pts.length; i++){
28123
- var _pts_ = _sliced_to_array$6(pts[i - 1], 2), x1 = _pts_[0], y1 = _pts_[1];
28124
- var _pts_i = _sliced_to_array$6(pts[i], 2), x2 = _pts_i[0], y2 = _pts_i[1];
28139
+ var _pts_ = _sliced_to_array$8(pts[i - 1], 2), x1 = _pts_[0], y1 = _pts_[1];
28140
+ var _pts_i = _sliced_to_array$8(pts[i], 2), x2 = _pts_i[0], y2 = _pts_i[1];
28125
28141
  var dx = x2 - x1;
28126
28142
  var dy = y2 - y1;
28127
28143
  var len2 = dx * dx + dy * dy;
@@ -28272,7 +28288,7 @@
28272
28288
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
28273
28289
  try {
28274
28290
  for(var _iterator = Object.entries(this._domListeners)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
28275
- var _step_value = _sliced_to_array$6(_step.value, 2), k = _step_value[0], fn = _step_value[1];
28291
+ var _step_value = _sliced_to_array$8(_step.value, 2), k = _step_value[0], fn = _step_value[1];
28276
28292
  canvas.addEventListener(k, fn);
28277
28293
  }
28278
28294
  } catch (err) {
@@ -28347,7 +28363,7 @@
28347
28363
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
28348
28364
  try {
28349
28365
  for(var _iterator = Object.entries(this._domListeners)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
28350
- var _step_value = _sliced_to_array$6(_step.value, 2), k = _step_value[0], fn = _step_value[1];
28366
+ var _step_value = _sliced_to_array$8(_step.value, 2), k = _step_value[0], fn = _step_value[1];
28351
28367
  this._canvas.removeEventListener(k, fn);
28352
28368
  }
28353
28369
  } catch (err) {
@@ -34827,21 +34843,21 @@
34827
34843
 
34828
34844
  var hyphenatedExports = requireHyphenated();
34829
34845
 
34830
- function _array_like_to_array$6(arr, len) {
34846
+ function _array_like_to_array$8(arr, len) {
34831
34847
  if (len == null || len > arr.length) len = arr.length;
34832
34848
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
34833
34849
  return arr2;
34834
34850
  }
34835
- function _array_with_holes$5(arr) {
34851
+ function _array_with_holes$7(arr) {
34836
34852
  if (Array.isArray(arr)) return arr;
34837
34853
  }
34838
- function _array_without_holes$1(arr) {
34839
- if (Array.isArray(arr)) return _array_like_to_array$6(arr);
34854
+ function _array_without_holes$2(arr) {
34855
+ if (Array.isArray(arr)) return _array_like_to_array$8(arr);
34840
34856
  }
34841
- function _iterable_to_array$1(iter) {
34857
+ function _iterable_to_array$2(iter) {
34842
34858
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
34843
34859
  }
34844
- function _iterable_to_array_limit$5(arr, i) {
34860
+ function _iterable_to_array_limit$7(arr, i) {
34845
34861
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
34846
34862
  if (_i == null) return;
34847
34863
  var _arr = [];
@@ -34865,25 +34881,25 @@
34865
34881
  }
34866
34882
  return _arr;
34867
34883
  }
34868
- function _non_iterable_rest$5() {
34884
+ function _non_iterable_rest$7() {
34869
34885
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
34870
34886
  }
34871
- function _non_iterable_spread$1() {
34887
+ function _non_iterable_spread$2() {
34872
34888
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
34873
34889
  }
34874
- function _sliced_to_array$5(arr, i) {
34875
- return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$5();
34890
+ function _sliced_to_array$7(arr, i) {
34891
+ return _array_with_holes$7(arr) || _iterable_to_array_limit$7(arr, i) || _unsupported_iterable_to_array$8(arr, i) || _non_iterable_rest$7();
34876
34892
  }
34877
- function _to_consumable_array$1(arr) {
34878
- return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$1();
34893
+ function _to_consumable_array$2(arr) {
34894
+ return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$2();
34879
34895
  }
34880
- function _unsupported_iterable_to_array$6(o, minLen) {
34896
+ function _unsupported_iterable_to_array$8(o, minLen) {
34881
34897
  if (!o) return;
34882
- if (typeof o === "string") return _array_like_to_array$6(o, minLen);
34898
+ if (typeof o === "string") return _array_like_to_array$8(o, minLen);
34883
34899
  var n = Object.prototype.toString.call(o).slice(8, -1);
34884
34900
  if (n === "Object" && o.constructor) n = o.constructor.name;
34885
34901
  if (n === "Map" || n === "Set") return Array.from(n);
34886
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
34902
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
34887
34903
  }
34888
34904
  var cjkRange = /[\u3000-\u9FFF\uF900-\uFAFF]/;
34889
34905
  var emojiRange = RegExp("[\\u00A9\\u00AE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9-\\u21AA\\u231A-\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA-\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614-\\u2615\\u2618\\u261D\\u2620\\u2622-\\u2623\\u2626\\u262A\\u262E-\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F-\\u2660\\u2663\\u2665-\\u2666\\u2668\\u267B\\u267E-\\u267F\\u2692-\\u2697\\u2699\\u269B-\\u269C\\u26A0-\\u26A1\\u26A7\\u26AA-\\u26AB\\u26B0-\\u26B1\\u26BD-\\u26BE\\u26C4-\\u26C5\\u26C8\\u26CE-\\u26CF\\u26D1\\u26D3-\\u26D4\\u26E9-\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733-\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763-\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934-\\u2935\\u2B05-\\u2B07\\u2B1B-\\u2B1C\\u2B50\\u2B55\\u3030\\u303D\\u3297\\u3299\\u{1F004}\\u{1F02C}-\\u{1F02F}\\u{1F094}-\\u{1F09F}\\u{1F0AF}-\\u{1F0B0}\\u{1F0C0}\\u{1F0CF}-\\u{1F0D0}\\u{1F0F6}-\\u{1F0FF}\\u{1F170}-\\u{1F171}\\u{1F17E}-\\u{1F17F}\\u{1F18E}\\u{1F191}-\\u{1F19A}\\u{1F1AE}-\\u{1F1E5}\\u{1F201}-\\u{1F20F}\\u{1F21A}\\u{1F22F}\\u{1F232}-\\u{1F23A}\\u{1F23C}-\\u{1F23F}\\u{1F249}-\\u{1F25F}\\u{1F266}-\\u{1F321}\\u{1F324}-\\u{1F393}\\u{1F396}-\\u{1F397}\\u{1F399}-\\u{1F39B}\\u{1F39E}-\\u{1F3F0}\\u{1F3F3}-\\u{1F3F5}\\u{1F3F7}-\\u{1F3FA}\\u{1F400}-\\u{1F4FD}\\u{1F4FF}-\\u{1F53D}\\u{1F549}-\\u{1F54E}\\u{1F550}-\\u{1F567}\\u{1F56F}-\\u{1F570}\\u{1F573}-\\u{1F57A}\\u{1F587}\\u{1F58A}-\\u{1F58D}\\u{1F590}\\u{1F595}-\\u{1F596}\\u{1F5A4}-\\u{1F5A5}\\u{1F5A8}\\u{1F5B1}-\\u{1F5B2}\\u{1F5BC}\\u{1F5C2}-\\u{1F5C4}\\u{1F5D1}-\\u{1F5D3}\\u{1F5DC}-\\u{1F5DE}\\u{1F5E1}\\u{1F5E3}\\u{1F5E8}\\u{1F5EF}\\u{1F5F3}\\u{1F5FA}-\\u{1F64F}\\u{1F680}-\\u{1F6C5}\\u{1F6CB}-\\u{1F6D2}\\u{1F6D5}-\\u{1F6E5}\\u{1F6E9}\\u{1F6EB}-\\u{1F6F0}\\u{1F6F3}-\\u{1F6FF}\\u{1F7DA}-\\u{1F7FF}\\u{1F80C}-\\u{1F80F}\\u{1F848}-\\u{1F84F}\\u{1F85A}-\\u{1F85F}\\u{1F888}-\\u{1F88F}\\u{1F8AE}-\\u{1F8AF}\\u{1F8BC}-\\u{1F8BF}\\u{1F8C2}-\\u{1F8CF}\\u{1F8D9}-\\u{1F8FF}\\u{1F90C}-\\u{1F93A}\\u{1F93C}-\\u{1F945}\\u{1F947}-\\u{1F9FF}\\u{1FA58}-\\u{1FA5F}\\u{1FA6E}-\\u{1FAFF}\\u{1FC00}-\\u{1FFFD}]", "u");
@@ -34904,7 +34920,7 @@
34904
34920
  if (!match) return [
34905
34921
  word
34906
34922
  ];
34907
- var _match = _sliced_to_array$5(match, 3), text = _match[1], trailing = _match[2];
34923
+ var _match = _sliced_to_array$7(match, 3), text = _match[1], trailing = _match[2];
34908
34924
  if (text.length < minHyphenLength) return [
34909
34925
  word
34910
34926
  ];
@@ -34950,7 +34966,7 @@
34950
34966
  var word = _step.value;
34951
34967
  var _result;
34952
34968
  var syllables = hyphenate(word);
34953
- (_result = result).push.apply(_result, _to_consumable_array$1(syllables));
34969
+ (_result = result).push.apply(_result, _to_consumable_array$2(syllables));
34954
34970
  }
34955
34971
  } catch (err) {
34956
34972
  _didIteratorError = true;
@@ -34969,15 +34985,15 @@
34969
34985
  return result;
34970
34986
  }
34971
34987
 
34972
- function _array_like_to_array$5(arr, len) {
34988
+ function _array_like_to_array$7(arr, len) {
34973
34989
  if (len == null || len > arr.length) len = arr.length;
34974
34990
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
34975
34991
  return arr2;
34976
34992
  }
34977
- function _array_without_holes(arr) {
34978
- if (Array.isArray(arr)) return _array_like_to_array$5(arr);
34993
+ function _array_without_holes$1(arr) {
34994
+ if (Array.isArray(arr)) return _array_like_to_array$7(arr);
34979
34995
  }
34980
- function _define_property(obj, key, value) {
34996
+ function _define_property$1(obj, key, value) {
34981
34997
  if (key in obj) {
34982
34998
  Object.defineProperty(obj, key, {
34983
34999
  value: value,
@@ -34998,10 +35014,10 @@
34998
35014
  return left instanceof right;
34999
35015
  }
35000
35016
  }
35001
- function _iterable_to_array(iter) {
35017
+ function _iterable_to_array$1(iter) {
35002
35018
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
35003
35019
  }
35004
- function _non_iterable_spread() {
35020
+ function _non_iterable_spread$1() {
35005
35021
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
35006
35022
  }
35007
35023
  function _object_spread(target) {
@@ -35014,7 +35030,7 @@
35014
35030
  }));
35015
35031
  }
35016
35032
  ownKeys.forEach(function(key) {
35017
- _define_property(target, key, source[key]);
35033
+ _define_property$1(target, key, source[key]);
35018
35034
  });
35019
35035
  }
35020
35036
  return target;
@@ -35038,20 +35054,20 @@
35038
35054
  }
35039
35055
  return target;
35040
35056
  }
35041
- function _to_consumable_array(arr) {
35042
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread();
35057
+ function _to_consumable_array$1(arr) {
35058
+ return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$1();
35043
35059
  }
35044
35060
  function _type_of$1(obj) {
35045
35061
  "@swc/helpers - typeof";
35046
35062
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
35047
35063
  }
35048
- function _unsupported_iterable_to_array$5(o, minLen) {
35064
+ function _unsupported_iterable_to_array$7(o, minLen) {
35049
35065
  if (!o) return;
35050
- if (typeof o === "string") return _array_like_to_array$5(o, minLen);
35066
+ if (typeof o === "string") return _array_like_to_array$7(o, minLen);
35051
35067
  var n = Object.prototype.toString.call(o).slice(8, -1);
35052
35068
  if (n === "Object" && o.constructor) n = o.constructor.name;
35053
35069
  if (n === "Map" || n === "Set") return Array.from(n);
35054
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
35070
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
35055
35071
  }
35056
35072
  var softHyphen = "\u00AD";
35057
35073
  /**
@@ -35188,7 +35204,7 @@
35188
35204
  var chord = circleLineWidth(radius, pass.lineData.length, lineHeight, fontSize);
35189
35205
  var over = (_Math = Math).max.apply(_Math, [
35190
35206
  0
35191
- ].concat(_to_consumable_array(visibleWidths.map(function(w, i) {
35207
+ ].concat(_to_consumable_array$1(visibleWidths.map(function(w, i) {
35192
35208
  return w - chord(i + 1);
35193
35209
  }))));
35194
35210
  // `overflow` opts out of containment — let the text spill, as the flag asks.
@@ -39794,15 +39810,15 @@
39794
39810
  }
39795
39811
  }
39796
39812
 
39797
- function _array_like_to_array$4(arr, len) {
39813
+ function _array_like_to_array$6(arr, len) {
39798
39814
  if (len == null || len > arr.length) len = arr.length;
39799
39815
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
39800
39816
  return arr2;
39801
39817
  }
39802
- function _array_with_holes$4(arr) {
39818
+ function _array_with_holes$6(arr) {
39803
39819
  if (Array.isArray(arr)) return arr;
39804
39820
  }
39805
- function _iterable_to_array_limit$4(arr, i) {
39821
+ function _iterable_to_array_limit$6(arr, i) {
39806
39822
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
39807
39823
  if (_i == null) return;
39808
39824
  var _arr = [];
@@ -39826,19 +39842,19 @@
39826
39842
  }
39827
39843
  return _arr;
39828
39844
  }
39829
- function _non_iterable_rest$4() {
39845
+ function _non_iterable_rest$6() {
39830
39846
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
39831
39847
  }
39832
- function _sliced_to_array$4(arr, i) {
39833
- return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$4();
39848
+ function _sliced_to_array$6(arr, i) {
39849
+ return _array_with_holes$6(arr) || _iterable_to_array_limit$6(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$6();
39834
39850
  }
39835
- function _unsupported_iterable_to_array$4(o, minLen) {
39851
+ function _unsupported_iterable_to_array$6(o, minLen) {
39836
39852
  if (!o) return;
39837
- if (typeof o === "string") return _array_like_to_array$4(o, minLen);
39853
+ if (typeof o === "string") return _array_like_to_array$6(o, minLen);
39838
39854
  var n = Object.prototype.toString.call(o).slice(8, -1);
39839
39855
  if (n === "Object" && o.constructor) n = o.constructor.name;
39840
39856
  if (n === "Map" || n === "Set") return Array.from(n);
39841
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
39857
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
39842
39858
  }
39843
39859
  var s2lin = function s2lin(c) {
39844
39860
  return c <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
@@ -39859,7 +39875,7 @@
39859
39875
  Converts a CSS color string to OKLab.
39860
39876
  @param c A valid CSS color string.
39861
39877
  */ function colorToOklab(c) {
39862
- var _linearRGB = _sliced_to_array$4(linearRGB(c), 3), r = _linearRGB[0], g = _linearRGB[1], b = _linearRGB[2];
39878
+ var _linearRGB = _sliced_to_array$6(linearRGB(c), 3), r = _linearRGB[0], g = _linearRGB[1], b = _linearRGB[2];
39863
39879
  var l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
39864
39880
  var m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
39865
39881
  var s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
@@ -39910,7 +39926,7 @@
39910
39926
  The WCAG 2.x relative luminance of a color (0 = black, 1 = white).
39911
39927
  @param c A valid CSS color string.
39912
39928
  */ function relativeLuminance(c) {
39913
- var _linearRGB = _sliced_to_array$4(linearRGB(c), 3), r = _linearRGB[0], g = _linearRGB[1], b = _linearRGB[2];
39929
+ var _linearRGB = _sliced_to_array$6(linearRGB(c), 3), r = _linearRGB[0], g = _linearRGB[1], b = _linearRGB[2];
39914
39930
  return 0.2126 * r + 0.7152 * g + 0.0722 * b;
39915
39931
  }
39916
39932
  /**
@@ -39918,7 +39934,7 @@
39918
39934
  @param a A valid CSS color string.
39919
39935
  @param b A valid CSS color string.
39920
39936
  */ function contrastRatio(a, b) {
39921
- var _sort = _sliced_to_array$4([
39937
+ var _sort = _sliced_to_array$6([
39922
39938
  relativeLuminance(a),
39923
39939
  relativeLuminance(b)
39924
39940
  ].sort(function(x, y) {
@@ -40086,15 +40102,15 @@
40086
40102
  .replace(/\.[0]*$/g, ""); // removes any trailing decimal point
40087
40103
  }
40088
40104
 
40089
- function _array_like_to_array$3(arr, len) {
40105
+ function _array_like_to_array$5(arr, len) {
40090
40106
  if (len == null || len > arr.length) len = arr.length;
40091
40107
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
40092
40108
  return arr2;
40093
40109
  }
40094
- function _array_with_holes$3(arr) {
40110
+ function _array_with_holes$5(arr) {
40095
40111
  if (Array.isArray(arr)) return arr;
40096
40112
  }
40097
- function _iterable_to_array_limit$3(arr, i) {
40113
+ function _iterable_to_array_limit$5(arr, i) {
40098
40114
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
40099
40115
  if (_i == null) return;
40100
40116
  var _arr = [];
@@ -40118,19 +40134,19 @@
40118
40134
  }
40119
40135
  return _arr;
40120
40136
  }
40121
- function _non_iterable_rest$3() {
40137
+ function _non_iterable_rest$5() {
40122
40138
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
40123
40139
  }
40124
- function _sliced_to_array$3(arr, i) {
40125
- return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
40140
+ function _sliced_to_array$5(arr, i) {
40141
+ return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$5();
40126
40142
  }
40127
- function _unsupported_iterable_to_array$3(o, minLen) {
40143
+ function _unsupported_iterable_to_array$5(o, minLen) {
40128
40144
  if (!o) return;
40129
- if (typeof o === "string") return _array_like_to_array$3(o, minLen);
40145
+ if (typeof o === "string") return _array_like_to_array$5(o, minLen);
40130
40146
  var n = Object.prototype.toString.call(o).slice(8, -1);
40131
40147
  if (n === "Object" && o.constructor) n = o.constructor.name;
40132
40148
  if (n === "Map" || n === "Set") return Array.from(n);
40133
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
40149
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
40134
40150
  }
40135
40151
  /**
40136
40152
  A default set of date formatters, which takes into account both the interval in between in each data point but also the start/end data points.
@@ -40145,7 +40161,7 @@
40145
40161
  });
40146
40162
  var firstOrLast = labelIndex === 0 || labelIndex === dataArray.length - 1;
40147
40163
  var smallArray = dataArray.length <= 5;
40148
- var _dataArray_reduce = _sliced_to_array$3(dataArray.reduce(function(arr, d, i) {
40164
+ var _dataArray_reduce = _sliced_to_array$5(dataArray.reduce(function(arr, d, i) {
40149
40165
  if (i) {
40150
40166
  arr[0].push(d.getFullYear() - dataArray[i - 1].getFullYear());
40151
40167
  arr[1].push(monthDiff(dataArray[i - 1], d));
@@ -40640,15 +40656,15 @@
40640
40656
  ];
40641
40657
  }
40642
40658
 
40643
- function _array_like_to_array$2(arr, len) {
40659
+ function _array_like_to_array$4(arr, len) {
40644
40660
  if (len == null || len > arr.length) len = arr.length;
40645
40661
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
40646
40662
  return arr2;
40647
40663
  }
40648
- function _array_with_holes$2(arr) {
40664
+ function _array_with_holes$4(arr) {
40649
40665
  if (Array.isArray(arr)) return arr;
40650
40666
  }
40651
- function _iterable_to_array_limit$2(arr, i) {
40667
+ function _iterable_to_array_limit$4(arr, i) {
40652
40668
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
40653
40669
  if (_i == null) return;
40654
40670
  var _arr = [];
@@ -40672,19 +40688,19 @@
40672
40688
  }
40673
40689
  return _arr;
40674
40690
  }
40675
- function _non_iterable_rest$2() {
40691
+ function _non_iterable_rest$4() {
40676
40692
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
40677
40693
  }
40678
- function _sliced_to_array$2(arr, i) {
40679
- return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
40694
+ function _sliced_to_array$4(arr, i) {
40695
+ return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$4();
40680
40696
  }
40681
- function _unsupported_iterable_to_array$2(o, minLen) {
40697
+ function _unsupported_iterable_to_array$4(o, minLen) {
40682
40698
  if (!o) return;
40683
- if (typeof o === "string") return _array_like_to_array$2(o, minLen);
40699
+ if (typeof o === "string") return _array_like_to_array$4(o, minLen);
40684
40700
  var n = Object.prototype.toString.call(o).slice(8, -1);
40685
40701
  if (n === "Object" && o.constructor) n = o.constructor.name;
40686
40702
  if (n === "Map" || n === "Set") return Array.from(n);
40687
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
40703
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
40688
40704
  }
40689
40705
  /**
40690
40706
  Checks whether a point is inside the bounding box of a line segment.
@@ -40692,7 +40708,7 @@
40692
40708
  @param s2 The second point of the line segment to be used for the bounding box, which should always be an `[x, y]` formatted Array.
40693
40709
  @param p The point to be checked, which should always be an `[x, y]` formatted Array.
40694
40710
  */ function segmentBoxContains(s1, s2, p) {
40695
- var eps = 1e-9, _p = _sliced_to_array$2(p, 2), px = _p[0], py = _p[1];
40711
+ var eps = 1e-9, _p = _sliced_to_array$4(p, 2), px = _p[0], py = _p[1];
40696
40712
  return !(px < Math.min(s1[0], s2[0]) - eps || px > Math.max(s1[0], s2[0]) + eps || py < Math.min(s1[1], s2[1]) - eps || py > Math.max(s1[1], s2[1]) + eps);
40697
40713
  }
40698
40714
 
@@ -40740,15 +40756,15 @@
40740
40756
  return dx * dx + dy * dy;
40741
40757
  }
40742
40758
 
40743
- function _array_like_to_array$1(arr, len) {
40759
+ function _array_like_to_array$3(arr, len) {
40744
40760
  if (len == null || len > arr.length) len = arr.length;
40745
40761
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
40746
40762
  return arr2;
40747
40763
  }
40748
- function _array_with_holes$1(arr) {
40764
+ function _array_with_holes$3(arr) {
40749
40765
  if (Array.isArray(arr)) return arr;
40750
40766
  }
40751
- function _iterable_to_array_limit$1(arr, i) {
40767
+ function _iterable_to_array_limit$3(arr, i) {
40752
40768
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
40753
40769
  if (_i == null) return;
40754
40770
  var _arr = [];
@@ -40772,19 +40788,19 @@
40772
40788
  }
40773
40789
  return _arr;
40774
40790
  }
40775
- function _non_iterable_rest$1() {
40791
+ function _non_iterable_rest$3() {
40776
40792
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
40777
40793
  }
40778
- function _sliced_to_array$1(arr, i) {
40779
- return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1();
40794
+ function _sliced_to_array$3(arr, i) {
40795
+ return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
40780
40796
  }
40781
- function _unsupported_iterable_to_array$1(o, minLen) {
40797
+ function _unsupported_iterable_to_array$3(o, minLen) {
40782
40798
  if (!o) return;
40783
- if (typeof o === "string") return _array_like_to_array$1(o, minLen);
40799
+ if (typeof o === "string") return _array_like_to_array$3(o, minLen);
40784
40800
  var n = Object.prototype.toString.call(o).slice(8, -1);
40785
40801
  if (n === "Object" && o.constructor) n = o.constructor.name;
40786
40802
  if (n === "Map" || n === "Set") return Array.from(n);
40787
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
40803
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
40788
40804
  }
40789
40805
  /**
40790
40806
  Gives the two closest intersection points between a ray cast from a point inside a polygon. The two points should lie on opposite sides of the origin.
@@ -40799,7 +40815,7 @@
40799
40815
  origin[0] + eps * Math.cos(alpha),
40800
40816
  origin[1] + eps * Math.sin(alpha)
40801
40817
  ];
40802
- var _origin = _sliced_to_array$1(origin, 2), x0 = _origin[0], y0 = _origin[1];
40818
+ var _origin = _sliced_to_array$3(origin, 2), x0 = _origin[0], y0 = _origin[1];
40803
40819
  var shiftedOrigin = [
40804
40820
  x0 + Math.cos(alpha),
40805
40821
  y0 + Math.sin(alpha)
@@ -40957,12 +40973,12 @@
40957
40973
  return poly;
40958
40974
  }
40959
40975
 
40960
- function _array_like_to_array(arr, len) {
40976
+ function _array_like_to_array$2(arr, len) {
40961
40977
  if (len == null || len > arr.length) len = arr.length;
40962
40978
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
40963
40979
  return arr2;
40964
40980
  }
40965
- function _array_with_holes(arr) {
40981
+ function _array_with_holes$2(arr) {
40966
40982
  if (Array.isArray(arr)) return arr;
40967
40983
  }
40968
40984
  function _instanceof(left, right) {
@@ -40973,7 +40989,7 @@
40973
40989
  return left instanceof right;
40974
40990
  }
40975
40991
  }
40976
- function _iterable_to_array_limit(arr, i) {
40992
+ function _iterable_to_array_limit$2(arr, i) {
40977
40993
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
40978
40994
  if (_i == null) return;
40979
40995
  var _arr = [];
@@ -40997,19 +41013,19 @@
40997
41013
  }
40998
41014
  return _arr;
40999
41015
  }
41000
- function _non_iterable_rest() {
41016
+ function _non_iterable_rest$2() {
41001
41017
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
41002
41018
  }
41003
- function _sliced_to_array(arr, i) {
41004
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
41019
+ function _sliced_to_array$2(arr, i) {
41020
+ return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
41005
41021
  }
41006
- function _unsupported_iterable_to_array(o, minLen) {
41022
+ function _unsupported_iterable_to_array$2(o, minLen) {
41007
41023
  if (!o) return;
41008
- if (typeof o === "string") return _array_like_to_array(o, minLen);
41024
+ if (typeof o === "string") return _array_like_to_array$2(o, minLen);
41009
41025
  var n = Object.prototype.toString.call(o).slice(8, -1);
41010
41026
  if (n === "Object" && o.constructor) n = o.constructor.name;
41011
41027
  if (n === "Map" || n === "Set") return Array.from(n);
41012
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
41028
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
41013
41029
  }
41014
41030
  // Algorithm constants
41015
41031
  var aspectRatioStep = 0.5; // step size for the aspect ratio
@@ -41068,8 +41084,8 @@
41068
41084
  Improves a candidate origin by averaging the polygon ray-cast intersections
41069
41085
  along the width and height axes, returning the refined center points.
41070
41086
  */ function refineOrigins(poly, origOrigin, angleRad, idx, events) {
41071
- var _polygonRayCast = _sliced_to_array(polygonRayCast(poly, origOrigin, angleRad), 2), p1W = _polygonRayCast[0], p2W = _polygonRayCast[1];
41072
- var _polygonRayCast1 = _sliced_to_array(polygonRayCast(poly, origOrigin, angleRad + Math.PI / 2), 2), p1H = _polygonRayCast1[0], p2H = _polygonRayCast1[1];
41087
+ var _polygonRayCast = _sliced_to_array$2(polygonRayCast(poly, origOrigin, angleRad), 2), p1W = _polygonRayCast[0], p2W = _polygonRayCast[1];
41088
+ var _polygonRayCast1 = _sliced_to_array$2(polygonRayCast(poly, origOrigin, angleRad + Math.PI / 2), 2), p1H = _polygonRayCast1[0], p2H = _polygonRayCast1[1];
41073
41089
  var modifOrigins = [];
41074
41090
  if (p1W && p2W) modifOrigins.push([
41075
41091
  (p1W[0] + p2W[0]) / 2,
@@ -41101,14 +41117,14 @@
41101
41117
  cx: origin[0],
41102
41118
  cy: origin[1]
41103
41119
  });
41104
- var _polygonRayCast = _sliced_to_array(polygonRayCast(poly, origin, angleRad), 2), p1W = _polygonRayCast[0], p2W = _polygonRayCast[1];
41120
+ var _polygonRayCast = _sliced_to_array$2(polygonRayCast(poly, origin, angleRad), 2), p1W = _polygonRayCast[0], p2W = _polygonRayCast[1];
41105
41121
  if (p1W === null || p2W === null) return {
41106
41122
  maxArea: maxArea,
41107
41123
  maxRect: maxRect
41108
41124
  };
41109
41125
  var minSqDistW = Math.min(pointDistanceSquared(origin, p1W), pointDistanceSquared(origin, p2W));
41110
41126
  var maxWidth = 2 * Math.sqrt(minSqDistW);
41111
- var _polygonRayCast1 = _sliced_to_array(polygonRayCast(poly, origin, angleRad + Math.PI / 2), 2), p1H = _polygonRayCast1[0], p2H = _polygonRayCast1[1];
41127
+ var _polygonRayCast1 = _sliced_to_array$2(polygonRayCast(poly, origin, angleRad + Math.PI / 2), 2), p1H = _polygonRayCast1[0], p2H = _polygonRayCast1[1];
41112
41128
  if (p1H === null || p2H === null) return {
41113
41129
  maxArea: maxArea,
41114
41130
  maxRect: maxRect
@@ -41138,7 +41154,7 @@
41138
41154
  while(right - left >= widthStep){
41139
41155
  var width = (left + right) / 2;
41140
41156
  var height = width / aRatio;
41141
- var _origin = _sliced_to_array(origin, 2), cx = _origin[0], cy = _origin[1];
41157
+ var _origin = _sliced_to_array$2(origin, 2), cx = _origin[0], cy = _origin[1];
41142
41158
  var rectPoly = [
41143
41159
  [
41144
41160
  cx - width / 2,
@@ -41253,10 +41269,10 @@
41253
41269
  return null;
41254
41270
  }
41255
41271
  // get the width of the bounding box of the original polygon to determine tolerance
41256
- var _extent = _sliced_to_array(extent$1(poly, function(d) {
41272
+ var _extent = _sliced_to_array$2(extent$1(poly, function(d) {
41257
41273
  return d[0];
41258
41274
  }), 2), minx = _extent[0], maxx = _extent[1];
41259
- var _extent1 = _sliced_to_array(extent$1(poly, function(d) {
41275
+ var _extent1 = _sliced_to_array$2(extent$1(poly, function(d) {
41260
41276
  return d[1];
41261
41277
  }), 2), miny = _extent1[0], maxy = _extent1[1];
41262
41278
  // simplify polygon
@@ -41268,11 +41284,11 @@
41268
41284
  });
41269
41285
  var ref;
41270
41286
  // get the width of the bounding box of the simplified polygon
41271
- ref = _sliced_to_array(extent$1(poly, function(d) {
41287
+ ref = _sliced_to_array$2(extent$1(poly, function(d) {
41272
41288
  return d[0];
41273
41289
  }), 2), minx = ref[0], maxx = ref[1];
41274
41290
  var ref1;
41275
- ref1 = _sliced_to_array(extent$1(poly, function(d) {
41291
+ ref1 = _sliced_to_array$2(extent$1(poly, function(d) {
41276
41292
  return d[1];
41277
41293
  }), 2), miny = ref1[0], maxy = ref1[1];
41278
41294
  var _ref = [
@@ -41324,28 +41340,715 @@
41324
41340
  }) : maxRect;
41325
41341
  }
41326
41342
 
41343
+ function _class_call_check(instance, Constructor) {
41344
+ if (!(instance instanceof Constructor)) {
41345
+ throw new TypeError("Cannot call a class as a function");
41346
+ }
41347
+ }
41348
+ function _defineProperties(target, props) {
41349
+ for(var i = 0; i < props.length; i++){
41350
+ var descriptor = props[i];
41351
+ descriptor.enumerable = descriptor.enumerable || false;
41352
+ descriptor.configurable = true;
41353
+ if ("value" in descriptor) descriptor.writable = true;
41354
+ Object.defineProperty(target, descriptor.key, descriptor);
41355
+ }
41356
+ }
41357
+ function _create_class(Constructor, protoProps, staticProps) {
41358
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
41359
+ return Constructor;
41360
+ }
41361
+ function _define_property(obj, key, value) {
41362
+ if (key in obj) {
41363
+ Object.defineProperty(obj, key, {
41364
+ value: value,
41365
+ enumerable: true,
41366
+ configurable: true,
41367
+ writable: true
41368
+ });
41369
+ } else {
41370
+ obj[key] = value;
41371
+ }
41372
+ return obj;
41373
+ }
41374
+ var WS = new Set([
41375
+ " ",
41376
+ "\t",
41377
+ "\n",
41378
+ "\r",
41379
+ "\f",
41380
+ ","
41381
+ ]);
41382
+ /**
41383
+ A pointer-driven scanner over an SVG path `d` string. Kept command-aware so
41384
+ it can read arc flags (`large-arc`/`sweep`) as single `0`/`1` characters even
41385
+ when they are glued to the next number (the classic `a5 5 0 0150 0` case a
41386
+ plain number regex mis-tokenizes).
41387
+ @private
41388
+ */ var Scanner = /*#__PURE__*/ function() {
41389
+ function Scanner(s) {
41390
+ _class_call_check(this, Scanner);
41391
+ _define_property(this, "s", void 0);
41392
+ _define_property(this, "i", 0);
41393
+ this.s = s;
41394
+ }
41395
+ _create_class(Scanner, [
41396
+ {
41397
+ key: "eof",
41398
+ value: function eof() {
41399
+ return this.i >= this.s.length;
41400
+ }
41401
+ },
41402
+ {
41403
+ key: "skipSep",
41404
+ value: function skipSep() {
41405
+ while(this.i < this.s.length && WS.has(this.s[this.i]))this.i++;
41406
+ }
41407
+ },
41408
+ {
41409
+ /** Reads a number token (handles `.5`, `1.`, `1e3`, signs, exponents). */ key: "readNumber",
41410
+ value: function readNumber() {
41411
+ this.skipSep();
41412
+ var start = this.i;
41413
+ var s = this.s;
41414
+ if (s[this.i] === "+" || s[this.i] === "-") this.i++;
41415
+ while(this.i < s.length && s[this.i] >= "0" && s[this.i] <= "9")this.i++;
41416
+ if (s[this.i] === ".") {
41417
+ this.i++;
41418
+ while(this.i < s.length && s[this.i] >= "0" && s[this.i] <= "9")this.i++;
41419
+ }
41420
+ if (s[this.i] === "e" || s[this.i] === "E") {
41421
+ this.i++;
41422
+ if (s[this.i] === "+" || s[this.i] === "-") this.i++;
41423
+ while(this.i < s.length && s[this.i] >= "0" && s[this.i] <= "9")this.i++;
41424
+ }
41425
+ return parseFloat(s.slice(start, this.i));
41426
+ }
41427
+ },
41428
+ {
41429
+ /** Reads a single `0`/`1` arc flag, which may be glued to the next number. */ key: "readFlag",
41430
+ value: function readFlag() {
41431
+ this.skipSep();
41432
+ var c = this.s[this.i];
41433
+ this.i++;
41434
+ return c === "1" ? 1 : 0;
41435
+ }
41436
+ },
41437
+ {
41438
+ /** True when the next non-separator char begins a new number (implicit repeat). */ key: "moreArgs",
41439
+ value: function moreArgs() {
41440
+ this.skipSep();
41441
+ var c = this.s[this.i];
41442
+ return c !== undefined && (c === "+" || c === "-" || c === "." || c >= "0" && c <= "9");
41443
+ }
41444
+ },
41445
+ {
41446
+ key: "nextCommand",
41447
+ value: function nextCommand() {
41448
+ this.skipSep();
41449
+ var c = this.s[this.i];
41450
+ if (c !== undefined && (c >= "a" && c <= "z" || c >= "A" && c <= "Z")) {
41451
+ this.i++;
41452
+ return c;
41453
+ }
41454
+ return null;
41455
+ }
41456
+ }
41457
+ ]);
41458
+ return Scanner;
41459
+ }();
41327
41460
  /**
41328
- Transforms a path string into an Array of points.
41461
+ Parses an SVG path `d` string into a flat list of absolute {@link PathSegment}s,
41462
+ with no DOM involved. Every relative command is resolved against the running
41463
+ point, `H`/`V` become `L`, and `S`/`T` expand into `C`/`Q` using the reflected
41464
+ previous control point.
41465
+ @param d An SVG path string (the `d` attribute of a `<path>`).
41466
+ */ function parsePath(d) {
41467
+ var out = [];
41468
+ if (!d) return out;
41469
+ var sc = new Scanner(d);
41470
+ var cmd = null;
41471
+ var cx = 0, cy = 0; // current point
41472
+ var sx = 0, sy = 0; // subpath start (for Z)
41473
+ // Reflected control point of the previous C/S (cubic) or Q/T (quadratic).
41474
+ var px = 0, py = 0;
41475
+ var prevType = "";
41476
+ while(!sc.eof()){
41477
+ var next = sc.nextCommand();
41478
+ if (next) cmd = next;
41479
+ else if (cmd === null) break;
41480
+ else if (cmd === "M") cmd = "L";
41481
+ else if (cmd === "m") cmd = "l";
41482
+ var rel = cmd === cmd.toLowerCase();
41483
+ var C = cmd.toUpperCase();
41484
+ var bx = rel ? cx : 0;
41485
+ var by = rel ? cy : 0;
41486
+ if (C === "M") {
41487
+ cx = sc.readNumber() + bx;
41488
+ cy = sc.readNumber() + by;
41489
+ sx = cx;
41490
+ sy = cy;
41491
+ out.push({
41492
+ type: "M",
41493
+ x: cx,
41494
+ y: cy
41495
+ });
41496
+ } else if (C === "L") {
41497
+ cx = sc.readNumber() + bx;
41498
+ cy = sc.readNumber() + by;
41499
+ out.push({
41500
+ type: "L",
41501
+ x: cx,
41502
+ y: cy
41503
+ });
41504
+ } else if (C === "H") {
41505
+ cx = sc.readNumber() + bx;
41506
+ out.push({
41507
+ type: "L",
41508
+ x: cx,
41509
+ y: cy
41510
+ });
41511
+ } else if (C === "V") {
41512
+ cy = sc.readNumber() + by;
41513
+ out.push({
41514
+ type: "L",
41515
+ x: cx,
41516
+ y: cy
41517
+ });
41518
+ } else if (C === "C") {
41519
+ var x1 = sc.readNumber() + bx, y1 = sc.readNumber() + by;
41520
+ var x2 = sc.readNumber() + bx, y2 = sc.readNumber() + by;
41521
+ cx = sc.readNumber() + bx;
41522
+ cy = sc.readNumber() + by;
41523
+ out.push({
41524
+ type: "C",
41525
+ x1: x1,
41526
+ y1: y1,
41527
+ x2: x2,
41528
+ y2: y2,
41529
+ x: cx,
41530
+ y: cy
41531
+ });
41532
+ px = x2;
41533
+ py = y2;
41534
+ } else if (C === "S") {
41535
+ var ref = prevType === "C" || prevType === "S";
41536
+ var x11 = ref ? 2 * cx - px : cx, y11 = ref ? 2 * cy - py : cy;
41537
+ var x21 = sc.readNumber() + bx, y21 = sc.readNumber() + by;
41538
+ cx = sc.readNumber() + bx;
41539
+ cy = sc.readNumber() + by;
41540
+ out.push({
41541
+ type: "C",
41542
+ x1: x11,
41543
+ y1: y11,
41544
+ x2: x21,
41545
+ y2: y21,
41546
+ x: cx,
41547
+ y: cy
41548
+ });
41549
+ px = x21;
41550
+ py = y21;
41551
+ } else if (C === "Q") {
41552
+ var x12 = sc.readNumber() + bx, y12 = sc.readNumber() + by;
41553
+ cx = sc.readNumber() + bx;
41554
+ cy = sc.readNumber() + by;
41555
+ out.push({
41556
+ type: "Q",
41557
+ x1: x12,
41558
+ y1: y12,
41559
+ x: cx,
41560
+ y: cy
41561
+ });
41562
+ px = x12;
41563
+ py = y12;
41564
+ } else if (C === "T") {
41565
+ var ref1 = prevType === "Q" || prevType === "T";
41566
+ var x13 = ref1 ? 2 * cx - px : cx, y13 = ref1 ? 2 * cy - py : cy;
41567
+ cx = sc.readNumber() + bx;
41568
+ cy = sc.readNumber() + by;
41569
+ out.push({
41570
+ type: "Q",
41571
+ x1: x13,
41572
+ y1: y13,
41573
+ x: cx,
41574
+ y: cy
41575
+ });
41576
+ px = x13;
41577
+ py = y13;
41578
+ } else if (C === "A") {
41579
+ var rx = sc.readNumber(), ry = sc.readNumber(), rot = sc.readNumber();
41580
+ var large = sc.readFlag(), sweep = sc.readFlag();
41581
+ cx = sc.readNumber() + bx;
41582
+ cy = sc.readNumber() + by;
41583
+ out.push({
41584
+ type: "A",
41585
+ rx: rx,
41586
+ ry: ry,
41587
+ rot: rot,
41588
+ large: large,
41589
+ sweep: sweep,
41590
+ x: cx,
41591
+ y: cy
41592
+ });
41593
+ } else if (C === "Z") {
41594
+ out.push({
41595
+ type: "Z"
41596
+ });
41597
+ cx = sx;
41598
+ cy = sy;
41599
+ } else {
41600
+ break;
41601
+ }
41602
+ prevType = C;
41603
+ // Stop repeating this command once its arguments are exhausted.
41604
+ if (C !== "Z" && !sc.moreArgs()) ;
41605
+ }
41606
+ return out;
41607
+ }
41608
+ /**
41609
+ Converts an SVG endpoint-parameterized arc to its center parameterization
41610
+ (SVG spec F.6.5), returning the ellipse center, corrected radii, x-axis
41611
+ rotation (radians), start angle and signed sweep. Returns null for a
41612
+ degenerate arc (zero radius), which callers treat as a straight line.
41613
+ @private
41614
+ */ function arcToCenter(x1, y1, rx, ry, rotDeg, large, sweep, x2, y2) {
41615
+ rx = Math.abs(rx);
41616
+ ry = Math.abs(ry);
41617
+ if (rx === 0 || ry === 0) return null;
41618
+ var phi = rotDeg * Math.PI / 180;
41619
+ var cosP = Math.cos(phi), sinP = Math.sin(phi);
41620
+ var dx = (x1 - x2) / 2, dy = (y1 - y2) / 2;
41621
+ var x1p = cosP * dx + sinP * dy;
41622
+ var y1p = -sinP * dx + cosP * dy;
41623
+ // Scale radii up if they are too small to span the endpoints.
41624
+ var lambda = x1p * x1p / (rx * rx) + y1p * y1p / (ry * ry);
41625
+ if (lambda > 1) {
41626
+ var s = Math.sqrt(lambda);
41627
+ rx *= s;
41628
+ ry *= s;
41629
+ }
41630
+ var sign = large !== sweep ? 1 : -1;
41631
+ var num = rx * rx * ry * ry - rx * rx * y1p * y1p - ry * ry * x1p * x1p;
41632
+ var den = rx * rx * y1p * y1p + ry * ry * x1p * x1p;
41633
+ var co = sign * Math.sqrt(Math.max(0, num / den));
41634
+ var cxp = co * rx * y1p / ry;
41635
+ var cyp = -co * ry * x1p / rx;
41636
+ var cx = cosP * cxp - sinP * cyp + (x1 + x2) / 2;
41637
+ var cy = sinP * cxp + cosP * cyp + (y1 + y2) / 2;
41638
+ var ang = function ang(ux, uy, vx, vy) {
41639
+ var dot = ux * vx + uy * vy;
41640
+ var len = Math.sqrt((ux * ux + uy * uy) * (vx * vx + vy * vy));
41641
+ var a = Math.acos(Math.min(1, Math.max(-1, dot / len)));
41642
+ if (ux * vy - uy * vx < 0) a = -a;
41643
+ return a;
41644
+ };
41645
+ var theta1 = ang(1, 0, (x1p - cxp) / rx, (y1p - cyp) / ry);
41646
+ var dtheta = ang((x1p - cxp) / rx, (y1p - cyp) / ry, (-x1p - cxp) / rx, (-y1p - cyp) / ry);
41647
+ if (!sweep && dtheta > 0) dtheta -= 2 * Math.PI;
41648
+ else if (sweep && dtheta < 0) dtheta += 2 * Math.PI;
41649
+ return {
41650
+ cx: cx,
41651
+ cy: cy,
41652
+ rx: rx,
41653
+ ry: ry,
41654
+ phi: phi,
41655
+ theta1: theta1,
41656
+ dtheta: dtheta
41657
+ };
41658
+ }
41659
+ /** A point on a center-parameterized arc at absolute ellipse angle `theta`. */ function arcPoint(arc, theta) {
41660
+ var cosP = Math.cos(arc.phi), sinP = Math.sin(arc.phi);
41661
+ var ct = Math.cos(theta), st = Math.sin(theta);
41662
+ return [
41663
+ arc.cx + arc.rx * ct * cosP - arc.ry * st * sinP,
41664
+ arc.cy + arc.rx * ct * sinP + arc.ry * st * cosP
41665
+ ];
41666
+ }
41667
+
41668
+ function _array_like_to_array$1(arr, len) {
41669
+ if (len == null || len > arr.length) len = arr.length;
41670
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
41671
+ return arr2;
41672
+ }
41673
+ function _array_with_holes$1(arr) {
41674
+ if (Array.isArray(arr)) return arr;
41675
+ }
41676
+ function _iterable_to_array_limit$1(arr, i) {
41677
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
41678
+ if (_i == null) return;
41679
+ var _arr = [];
41680
+ var _n = true;
41681
+ var _d = false;
41682
+ var _s, _e;
41683
+ try {
41684
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
41685
+ _arr.push(_s.value);
41686
+ if (i && _arr.length === i) break;
41687
+ }
41688
+ } catch (err) {
41689
+ _d = true;
41690
+ _e = err;
41691
+ } finally{
41692
+ try {
41693
+ if (!_n && _i["return"] != null) _i["return"]();
41694
+ } finally{
41695
+ if (_d) throw _e;
41696
+ }
41697
+ }
41698
+ return _arr;
41699
+ }
41700
+ function _non_iterable_rest$1() {
41701
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
41702
+ }
41703
+ function _sliced_to_array$1(arr, i) {
41704
+ return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1();
41705
+ }
41706
+ function _unsupported_iterable_to_array$1(o, minLen) {
41707
+ if (!o) return;
41708
+ if (typeof o === "string") return _array_like_to_array$1(o, minLen);
41709
+ var n = Object.prototype.toString.call(o).slice(8, -1);
41710
+ if (n === "Object" && o.constructor) n = o.constructor.name;
41711
+ if (n === "Map" || n === "Set") return Array.from(n);
41712
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
41713
+ }
41714
+ /** Chord-length of a cubic Bézier's control polygon — an upper bound on its arc length. */ function cubicPolyLen(x0, y0, x1, y1, x2, y2, x3, y3) {
41715
+ return Math.hypot(x1 - x0, y1 - y0) + Math.hypot(x2 - x1, y2 - y1) + Math.hypot(x3 - x2, y3 - y2);
41716
+ }
41717
+ /**
41718
+ Transforms a path string into an Array of points, with no DOM involved.
41719
+ Straight segments contribute their endpoints; curves and arcs are flattened
41720
+ into line segments no longer than `segmentLength`. Higher `segmentLength`
41721
+ values lower computation time but yield more rigid curves.
41329
41722
  @param path An SVG string path, commonly the "d" property of a <path> element.
41330
- @param segmentLength The length of line segments when converting curves line segments. Higher values lower computation time, but will result in curves that are more rigid.
41723
+ @param segmentLength The maximum length of line segments when flattening curves.
41331
41724
  */ function path2polygon(path) {
41332
41725
  var segmentLength = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 50;
41333
- if (typeof document === "undefined") return [];
41334
- var svgPath = document.createElementNS("http://www.w3.org/2000/svg", "path");
41335
- svgPath.setAttribute("d", path);
41336
- var len = svgPath.getTotalLength();
41337
- var NUM_POINTS = len / segmentLength < 10 ? len / 10 : len / segmentLength;
41338
41726
  var points = [];
41339
- for(var i = 0; i < NUM_POINTS; i++){
41340
- var pt = svgPath.getPointAtLength(i * len / (NUM_POINTS - 1));
41341
- points.push([
41342
- pt.x,
41343
- pt.y
41727
+ var step = Math.max(1, segmentLength);
41728
+ var cx = 0, cy = 0;
41729
+ var push = function push(x, y) {
41730
+ var last = points[points.length - 1];
41731
+ // Skip exact duplicates (e.g. a curve start == the previous endpoint).
41732
+ if (!last || last[0] !== x || last[1] !== y) points.push([
41733
+ x,
41734
+ y
41344
41735
  ]);
41736
+ };
41737
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
41738
+ try {
41739
+ for(var _iterator = parsePath(path)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
41740
+ var seg = _step.value;
41741
+ if (seg.type === "M" || seg.type === "L") {
41742
+ push(seg.x, seg.y);
41743
+ cx = seg.x;
41744
+ cy = seg.y;
41745
+ } else if (seg.type === "C") {
41746
+ var len = cubicPolyLen(cx, cy, seg.x1, seg.y1, seg.x2, seg.y2, seg.x, seg.y);
41747
+ var n = Math.max(2, Math.ceil(len / step));
41748
+ for(var i = 1; i <= n; i++){
41749
+ var t = i / n, u = 1 - t;
41750
+ push(u * u * u * cx + 3 * u * u * t * seg.x1 + 3 * u * t * t * seg.x2 + t * t * t * seg.x, u * u * u * cy + 3 * u * u * t * seg.y1 + 3 * u * t * t * seg.y2 + t * t * t * seg.y);
41751
+ }
41752
+ cx = seg.x;
41753
+ cy = seg.y;
41754
+ } else if (seg.type === "Q") {
41755
+ var len1 = Math.hypot(seg.x1 - cx, seg.y1 - cy) + Math.hypot(seg.x - seg.x1, seg.y - seg.y1);
41756
+ var n1 = Math.max(2, Math.ceil(len1 / step));
41757
+ for(var i1 = 1; i1 <= n1; i1++){
41758
+ var t1 = i1 / n1, u1 = 1 - t1;
41759
+ push(u1 * u1 * cx + 2 * u1 * t1 * seg.x1 + t1 * t1 * seg.x, u1 * u1 * cy + 2 * u1 * t1 * seg.y1 + t1 * t1 * seg.y);
41760
+ }
41761
+ cx = seg.x;
41762
+ cy = seg.y;
41763
+ } else if (seg.type === "A") {
41764
+ var arc = arcToCenter(cx, cy, seg.rx, seg.ry, seg.rot, seg.large, seg.sweep, seg.x, seg.y);
41765
+ if (!arc) {
41766
+ push(seg.x, seg.y);
41767
+ } else {
41768
+ // Estimate length from the average radius × swept angle.
41769
+ var len2 = (arc.rx + arc.ry) / 2 * Math.abs(arc.dtheta);
41770
+ var n2 = Math.max(2, Math.ceil(len2 / step));
41771
+ for(var i2 = 1; i2 <= n2; i2++){
41772
+ var _arcPoint = _sliced_to_array$1(arcPoint(arc, arc.theta1 + arc.dtheta * i2 / n2), 2), px = _arcPoint[0], py = _arcPoint[1];
41773
+ push(px, py);
41774
+ }
41775
+ }
41776
+ cx = seg.x;
41777
+ cy = seg.y;
41778
+ }
41779
+ // Z contributes no new vertex — the subpath start is already in `points`.
41780
+ }
41781
+ } catch (err) {
41782
+ _didIteratorError = true;
41783
+ _iteratorError = err;
41784
+ } finally{
41785
+ try {
41786
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
41787
+ _iterator.return();
41788
+ }
41789
+ } finally{
41790
+ if (_didIteratorError) {
41791
+ throw _iteratorError;
41792
+ }
41793
+ }
41345
41794
  }
41346
41795
  return points;
41347
41796
  }
41348
41797
 
41798
+ function _array_like_to_array(arr, len) {
41799
+ if (len == null || len > arr.length) len = arr.length;
41800
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
41801
+ return arr2;
41802
+ }
41803
+ function _array_with_holes(arr) {
41804
+ if (Array.isArray(arr)) return arr;
41805
+ }
41806
+ function _array_without_holes(arr) {
41807
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
41808
+ }
41809
+ function _iterable_to_array(iter) {
41810
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
41811
+ }
41812
+ function _iterable_to_array_limit(arr, i) {
41813
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
41814
+ if (_i == null) return;
41815
+ var _arr = [];
41816
+ var _n = true;
41817
+ var _d = false;
41818
+ var _s, _e;
41819
+ try {
41820
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
41821
+ _arr.push(_s.value);
41822
+ if (i && _arr.length === i) break;
41823
+ }
41824
+ } catch (err) {
41825
+ _d = true;
41826
+ _e = err;
41827
+ } finally{
41828
+ try {
41829
+ if (!_n && _i["return"] != null) _i["return"]();
41830
+ } finally{
41831
+ if (_d) throw _e;
41832
+ }
41833
+ }
41834
+ return _arr;
41835
+ }
41836
+ function _non_iterable_rest() {
41837
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
41838
+ }
41839
+ function _non_iterable_spread() {
41840
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
41841
+ }
41842
+ function _sliced_to_array(arr, i) {
41843
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
41844
+ }
41845
+ function _to_consumable_array(arr) {
41846
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
41847
+ }
41848
+ function _unsupported_iterable_to_array(o, minLen) {
41849
+ if (!o) return;
41850
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
41851
+ var n = Object.prototype.toString.call(o).slice(8, -1);
41852
+ if (n === "Object" && o.constructor) n = o.constructor.name;
41853
+ if (n === "Map" || n === "Set") return Array.from(n);
41854
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
41855
+ }
41856
+ /** Value of a cubic Bézier on one axis at parameter t. */ function cubicAt(p0, p1, p2, p3, t) {
41857
+ var u = 1 - t;
41858
+ return u * u * u * p0 + 3 * u * u * t * p1 + 3 * u * t * t * p2 + t * t * t * p3;
41859
+ }
41860
+ /** Value of a quadratic Bézier on one axis at parameter t. */ function quadAt(p0, p1, p2, t) {
41861
+ var u = 1 - t;
41862
+ return u * u * p0 + 2 * u * t * p1 + t * t * p2;
41863
+ }
41864
+ /** Parameters in (0,1) where a cubic Bézier's derivative is zero on one axis. */ function cubicExtrema(p0, p1, p2, p3) {
41865
+ var a = p3 - 3 * p2 + 3 * p1 - p0;
41866
+ var b = 2 * (p2 - 2 * p1 + p0);
41867
+ var c = p1 - p0;
41868
+ var ts = [];
41869
+ if (Math.abs(a) < 1e-12) {
41870
+ if (Math.abs(b) > 1e-12) ts.push(-c / b);
41871
+ } else {
41872
+ var disc = b * b - 4 * a * c;
41873
+ if (disc >= 0) {
41874
+ var s = Math.sqrt(disc);
41875
+ ts.push((-b + s) / (2 * a), (-b - s) / (2 * a));
41876
+ }
41877
+ }
41878
+ return ts.filter(function(t) {
41879
+ return t > 0 && t < 1;
41880
+ });
41881
+ }
41882
+ /** Parameter in (0,1) where a quadratic Bézier's derivative is zero on one axis. */ function quadExtremum(p0, p1, p2) {
41883
+ var den = p0 - 2 * p1 + p2;
41884
+ if (Math.abs(den) < 1e-12) return [];
41885
+ var t = (p0 - p1) / den;
41886
+ return t > 0 && t < 1 ? [
41887
+ t
41888
+ ] : [];
41889
+ }
41890
+ /** True when absolute ellipse angle `theta` falls inside the arc's signed sweep. */ function angleInArc(theta, theta1, dtheta) {
41891
+ var TAU = 2 * Math.PI;
41892
+ var d = theta - theta1;
41893
+ if (dtheta >= 0) {
41894
+ while(d < 0)d += TAU;
41895
+ while(d > TAU)d -= TAU;
41896
+ return d <= dtheta + 1e-9;
41897
+ }
41898
+ while(d > 0)d -= TAU;
41899
+ while(d < -TAU)d += TAU;
41900
+ return d >= dtheta - 1e-9;
41901
+ }
41902
+ /**
41903
+ Computes the exact bounding box of an SVG path string with no DOM involved,
41904
+ evaluating the true extrema of each Bézier and arc segment (not a sampled
41905
+ approximation). Returns `{x, y, width, height}`, or a zero-size box at the
41906
+ origin for an empty/unparseable path.
41907
+ @param d An SVG path string (the `d` attribute of a `<path>`).
41908
+ */ function pathBounds(d) {
41909
+ var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
41910
+ var add = function add(x, y) {
41911
+ if (x < minX) minX = x;
41912
+ if (y < minY) minY = y;
41913
+ if (x > maxX) maxX = x;
41914
+ if (y > maxY) maxY = y;
41915
+ };
41916
+ var cx = 0, cy = 0;
41917
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
41918
+ try {
41919
+ for(var _iterator = parsePath(d)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
41920
+ var seg = _step.value;
41921
+ if (seg.type === "M" || seg.type === "L") {
41922
+ add(seg.x, seg.y);
41923
+ cx = seg.x;
41924
+ cy = seg.y;
41925
+ } else if (seg.type === "C") {
41926
+ add(cx, cy);
41927
+ add(seg.x, seg.y);
41928
+ // At each axis extremum, include the full point on the curve — only the
41929
+ // extreme axis grows the box, the other coordinate is a real point on it.
41930
+ var ts = _to_consumable_array(cubicExtrema(cx, seg.x1, seg.x2, seg.x)).concat(_to_consumable_array(cubicExtrema(cy, seg.y1, seg.y2, seg.y)));
41931
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
41932
+ try {
41933
+ for(var _iterator1 = ts[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
41934
+ var t = _step1.value;
41935
+ add(cubicAt(cx, seg.x1, seg.x2, seg.x, t), cubicAt(cy, seg.y1, seg.y2, seg.y, t));
41936
+ }
41937
+ } catch (err) {
41938
+ _didIteratorError1 = true;
41939
+ _iteratorError1 = err;
41940
+ } finally{
41941
+ try {
41942
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
41943
+ _iterator1.return();
41944
+ }
41945
+ } finally{
41946
+ if (_didIteratorError1) {
41947
+ throw _iteratorError1;
41948
+ }
41949
+ }
41950
+ }
41951
+ cx = seg.x;
41952
+ cy = seg.y;
41953
+ } else if (seg.type === "Q") {
41954
+ add(cx, cy);
41955
+ add(seg.x, seg.y);
41956
+ var ts1 = _to_consumable_array(quadExtremum(cx, seg.x1, seg.x)).concat(_to_consumable_array(quadExtremum(cy, seg.y1, seg.y)));
41957
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
41958
+ try {
41959
+ for(var _iterator2 = ts1[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){
41960
+ var t1 = _step2.value;
41961
+ add(quadAt(cx, seg.x1, seg.x, t1), quadAt(cy, seg.y1, seg.y, t1));
41962
+ }
41963
+ } catch (err) {
41964
+ _didIteratorError2 = true;
41965
+ _iteratorError2 = err;
41966
+ } finally{
41967
+ try {
41968
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
41969
+ _iterator2.return();
41970
+ }
41971
+ } finally{
41972
+ if (_didIteratorError2) {
41973
+ throw _iteratorError2;
41974
+ }
41975
+ }
41976
+ }
41977
+ cx = seg.x;
41978
+ cy = seg.y;
41979
+ } else if (seg.type === "A") {
41980
+ add(cx, cy);
41981
+ add(seg.x, seg.y);
41982
+ var arc = arcToCenter(cx, cy, seg.rx, seg.ry, seg.rot, seg.large, seg.sweep, seg.x, seg.y);
41983
+ if (arc) {
41984
+ var phi = arc.phi, rx = arc.rx, ry = arc.ry, theta1 = arc.theta1, dtheta = arc.dtheta;
41985
+ // Ellipse-angle candidates where dX/dθ = 0 and dY/dθ = 0.
41986
+ var cands = [
41987
+ Math.atan2(-ry * Math.sin(phi), rx * Math.cos(phi)),
41988
+ Math.atan2(ry * Math.cos(phi), rx * Math.sin(phi))
41989
+ ];
41990
+ var _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = undefined;
41991
+ try {
41992
+ for(var _iterator3 = cands[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true){
41993
+ var base = _step3.value;
41994
+ for(var _i = 0, _iter = [
41995
+ base,
41996
+ base + Math.PI
41997
+ ]; _i < _iter.length; _i++){
41998
+ var theta = _iter[_i];
41999
+ if (angleInArc(theta, theta1, dtheta)) {
42000
+ var _arcPoint = _sliced_to_array(arcPoint(arc, theta), 2), px = _arcPoint[0], py = _arcPoint[1];
42001
+ add(px, py);
42002
+ }
42003
+ }
42004
+ }
42005
+ } catch (err) {
42006
+ _didIteratorError3 = true;
42007
+ _iteratorError3 = err;
42008
+ } finally{
42009
+ try {
42010
+ if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
42011
+ _iterator3.return();
42012
+ }
42013
+ } finally{
42014
+ if (_didIteratorError3) {
42015
+ throw _iteratorError3;
42016
+ }
42017
+ }
42018
+ }
42019
+ }
42020
+ cx = seg.x;
42021
+ cy = seg.y;
42022
+ }
42023
+ }
42024
+ } catch (err) {
42025
+ _didIteratorError = true;
42026
+ _iteratorError = err;
42027
+ } finally{
42028
+ try {
42029
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
42030
+ _iterator.return();
42031
+ }
42032
+ } finally{
42033
+ if (_didIteratorError) {
42034
+ throw _iteratorError;
42035
+ }
42036
+ }
42037
+ }
42038
+ if (!Number.isFinite(minX)) return {
42039
+ x: 0,
42040
+ y: 0,
42041
+ width: 0,
42042
+ height: 0
42043
+ };
42044
+ return {
42045
+ x: minX,
42046
+ y: minY,
42047
+ width: maxX - minX,
42048
+ height: maxY - minY
42049
+ };
42050
+ }
42051
+
41349
42052
  /**
41350
42053
  Calculates the pixel distance between two points.
41351
42054
  @param p1 The first point, which should always be an `[x, y]` formatted Array.
@@ -41832,153 +42535,6 @@
41832
42535
  };
41833
42536
  }
41834
42537
 
41835
- /** Image's fluent accessor schema. Config storage lives on `this.schema.<key>`. */ const imageSchema = [
41836
- {
41837
- key: "duration",
41838
- coerce: "identity",
41839
- default: 600
41840
- },
41841
- {
41842
- key: "height",
41843
- coerce: "accessor",
41844
- default: accessor("height")
41845
- },
41846
- {
41847
- key: "id",
41848
- coerce: "identity",
41849
- default: accessor("id")
41850
- },
41851
- {
41852
- key: "opacity",
41853
- coerce: "const",
41854
- default: constant$b(1)
41855
- },
41856
- {
41857
- key: "pointerEvents",
41858
- coerce: "const",
41859
- default: constant$b("auto")
41860
- },
41861
- {
41862
- key: "renderMode",
41863
- coerce: "identity",
41864
- default: "full"
41865
- },
41866
- {
41867
- key: "url",
41868
- coerce: "identity",
41869
- default: accessor("url")
41870
- },
41871
- {
41872
- key: "width",
41873
- coerce: "accessor",
41874
- default: accessor("width")
41875
- },
41876
- {
41877
- key: "x",
41878
- coerce: "const",
41879
- default: accessor("x", 0)
41880
- },
41881
- {
41882
- key: "y",
41883
- coerce: "const",
41884
- default: accessor("y", 0)
41885
- }
41886
- ];
41887
- let Image$1 = class Image {
41888
- config(_) {
41889
- if (!arguments.length) return {
41890
- ...this.schema,
41891
- data: this._data,
41892
- select: this._select
41893
- };
41894
- const patch = _;
41895
- for(const k in patch){
41896
- if (!Object.prototype.hasOwnProperty.call(patch, k)) continue;
41897
- // `this[k]` resolves the fluent accessor via the index signature.
41898
- if (typeof this[k] === "function") this[k](patch[k]);
41899
- else this.schema[k] = patch[k];
41900
- }
41901
- return this;
41902
- }
41903
- /**
41904
- Renders the current Image to the page. If a *callback* is specified, it will be called once the images are done drawing.
41905
- @param callback Optional callback invoked after rendering completes.
41906
- */ render(callback) {
41907
- // Compute mode is a no-op for DOM emission — the caller will read
41908
- // `toScene()` to get a SceneNode tree, no need to mount.
41909
- if (this.schema.renderMode === "compute") {
41910
- if (callback) setTimeout(callback, 0);
41911
- return this;
41912
- }
41913
- if (this._select === void 0) this.select(select("body").append("svg").style("width", `${window.innerWidth}px`).style("height", `${window.innerHeight}px`).style("display", "block").node());
41914
- const images = this._select.selectAll(".d3plus-Image").data(this._data, this.schema.id);
41915
- const enter = images.enter().append("image").attr("class", "d3plus-Image").attr("opacity", 0).attr("width", 0).attr("height", 0).attr("x", (d, i)=>this.schema.x(d, i) + this.schema.width(d, i) / 2).attr("y", (d, i)=>this.schema.y(d, i) + this.schema.height(d, i) / 2);
41916
- const t = transition().duration(this.schema.duration), that = this, update = enter.merge(images);
41917
- update.attr("xlink:href", this.schema.url).style("pointer-events", this.schema.pointerEvents).transition(t).attr("opacity", this.schema.opacity).attr("width", (d, i)=>this.schema.width(d, i)).attr("height", (d, i)=>this.schema.height(d, i)).attr("x", (d, i)=>this.schema.x(d, i)).attr("y", (d, i)=>this.schema.y(d, i)).each(function(d, i) {
41918
- const image = select(this), link = that.schema.url(d, i);
41919
- const fullAddress = link.indexOf("http://") === 0 || link.indexOf("https://") === 0;
41920
- if (!fullAddress || link.indexOf(window.location.hostname) === 0) {
41921
- const img = new window.Image();
41922
- img.src = link;
41923
- img.crossOrigin = "Anonymous";
41924
- img.onload = function() {
41925
- const canvas = document.createElement("canvas");
41926
- canvas.width = img.width;
41927
- canvas.height = img.height;
41928
- const context = canvas.getContext("2d");
41929
- context.drawImage(img, 0, 0);
41930
- image.attr("xlink:href", canvas.toDataURL("image/png"));
41931
- };
41932
- }
41933
- });
41934
- images.exit().transition(t).attr("width", (d, i)=>this.schema.width(d, i)).attr("height", (d, i)=>this.schema.height(d, i)).attr("x", (d, i)=>this.schema.x(d, i)).attr("y", (d, i)=>this.schema.y(d, i)).attr("opacity", 0).remove();
41935
- if (callback) setTimeout(callback, this.schema.duration + 100);
41936
- return this;
41937
- }
41938
- data(_) {
41939
- return arguments.length ? (this._data = _, this) : this._data;
41940
- }
41941
- /**
41942
- Compute-mode scene emission. Mirrors Shape.toScene's shape — a
41943
- keyed GroupNode wrapping per-datum ImageNodes. Used by chart
41944
- compositors (Shape._backgroundImageClass, plotPaint) that need
41945
- Image to participate in the scene graph rather than emit
41946
- d3-selection DOM.
41947
- */ toScene() {
41948
- const children = (this._data || []).map((d, i)=>{
41949
- const node = {
41950
- type: "image",
41951
- key: `${this.schema.id(d, i)}`,
41952
- x: this.schema.x(d, i),
41953
- y: this.schema.y(d, i),
41954
- width: this.schema.width(d, i),
41955
- height: this.schema.height(d, i),
41956
- href: this.schema.url(d, i),
41957
- paint: {
41958
- opacity: this.schema.opacity(d, i)
41959
- },
41960
- datum: d,
41961
- index: i
41962
- };
41963
- return node;
41964
- });
41965
- return {
41966
- type: "group",
41967
- key: "d3plus-Image",
41968
- children
41969
- };
41970
- }
41971
- select(_) {
41972
- return arguments.length ? (this._select = select(_), this) : this._select;
41973
- }
41974
- /**
41975
- Invoked when creating a new class instance, and sets any default parameters.
41976
- @private
41977
- */ constructor(){
41978
- installFluent(this, imageSchema);
41979
- }
41980
- };
41981
-
41982
42538
  /** Follows the chart (`__d3plus__`) and shape (`__d3plusShape__`) wrappers back
41983
42539
  to the source datum, so a `sort` comparator sees the same object the other
41984
42540
  per-datum accessors receive. */ function unwrap(d) {
@@ -42001,18 +42557,219 @@
42001
42557
  order.forEach((origIdx, pos)=>rank[origIdx] = pos);
42002
42558
  return rank;
42003
42559
  }
42560
+ /** Bounding box of a list of polygon points, or null when degenerate. */ function pointsBox(points) {
42561
+ if (!points.length) return null;
42562
+ let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
42563
+ for (const [px, py] of points){
42564
+ if (px < minX) minX = px;
42565
+ if (py < minY) minY = py;
42566
+ if (px > maxX) maxX = px;
42567
+ if (py > maxY) maxY = py;
42568
+ }
42569
+ if (!Number.isFinite(minX) || maxX <= minX || maxY <= minY) return null;
42570
+ return {
42571
+ x: minX,
42572
+ y: minY,
42573
+ width: maxX - minX,
42574
+ height: maxY - minY
42575
+ };
42576
+ }
42577
+ /**
42578
+ The local-space bounding box `{x, y, width, height}` a backgroundImage fills,
42579
+ derived from a datum's scene geometry. Rect/Bar geometry is already a box;
42580
+ Circle is centered at (cx, cy) with radius r; a `path` uses the exact
42581
+ (DOM-free) bounds of its `d`; Area/Line fall back to their polygon `points`.
42582
+ Returns null when no finite extent can be determined.
42583
+ */ function backgroundImageBox(g, points) {
42584
+ if (typeof g.width === "number" && typeof g.height === "number") {
42585
+ const x = typeof g.x === "number" ? g.x : -g.width / 2;
42586
+ const y = typeof g.y === "number" ? g.y : -g.height / 2;
42587
+ return {
42588
+ x,
42589
+ y,
42590
+ width: g.width,
42591
+ height: g.height
42592
+ };
42593
+ }
42594
+ if (typeof g.r === "number") {
42595
+ const cx = typeof g.cx === "number" ? g.cx : 0;
42596
+ const cy = typeof g.cy === "number" ? g.cy : 0;
42597
+ return {
42598
+ x: cx - g.r,
42599
+ y: cy - g.r,
42600
+ width: g.r * 2,
42601
+ height: g.r * 2
42602
+ };
42603
+ }
42604
+ if (typeof g.d === "string") {
42605
+ const b = pathBounds(g.d);
42606
+ return b.width > 0 && b.height > 0 ? b : null;
42607
+ }
42608
+ return pointsBox(points);
42609
+ }
42610
+ /** Rounded-rectangle path `d` (falls back to a plain rect when radii are 0). */ function roundedRectPath(x, y, w, h, rx, ry) {
42611
+ rx = Math.min(rx, w / 2);
42612
+ ry = Math.min(ry, h / 2);
42613
+ return `M${x + rx},${y}h${w - 2 * rx}a${rx},${ry} 0 0 1 ${rx},${ry}` + `v${h - 2 * ry}a${rx},${ry} 0 0 1 ${-rx},${ry}h${-(w - 2 * rx)}` + `a${rx},${ry} 0 0 1 ${-rx},${-ry}v${-(h - 2 * ry)}a${rx},${ry} 0 0 1 ${rx},${-ry}Z`;
42614
+ }
42615
+ /**
42616
+ The shape's own geometry expressed as a clip region in its LOCAL coordinate
42617
+ space, so a background image can be clipped to the shape itself (a Path image
42618
+ is clipped to the path, a Circle image to the circle, etc.). Returns
42619
+ undefined when the geometry has no usable outline.
42620
+ */ function backgroundImageClip(g, points) {
42621
+ if (typeof g.d === "string") return {
42622
+ type: "path",
42623
+ d: g.d
42624
+ };
42625
+ if (typeof g.width === "number" && typeof g.height === "number") {
42626
+ const x = typeof g.x === "number" ? g.x : -g.width / 2;
42627
+ const y = typeof g.y === "number" ? g.y : -g.height / 2;
42628
+ const rx = typeof g.rx === "number" ? g.rx : 0;
42629
+ const ry = typeof g.ry === "number" ? g.ry : 0;
42630
+ return rx > 0 || ry > 0 ? {
42631
+ type: "path",
42632
+ d: roundedRectPath(x, y, g.width, g.height, rx || ry, ry || rx)
42633
+ } : {
42634
+ type: "rect",
42635
+ x,
42636
+ y,
42637
+ width: g.width,
42638
+ height: g.height
42639
+ };
42640
+ }
42641
+ if (typeof g.r === "number") {
42642
+ const cx = typeof g.cx === "number" ? g.cx : 0;
42643
+ const cy = typeof g.cy === "number" ? g.cy : 0;
42644
+ const r = g.r;
42645
+ return {
42646
+ type: "path",
42647
+ d: `M${cx - r},${cy}a${r},${r} 0 1,0 ${2 * r},0a${r},${r} 0 1,0 ${ -2 * r},0Z`
42648
+ };
42649
+ }
42650
+ if (points.length > 2) {
42651
+ const d = `M${points.map(([x, y])=>`${x},${y}`).join("L")}Z`;
42652
+ return {
42653
+ type: "path",
42654
+ d
42655
+ };
42656
+ }
42657
+ return undefined;
42658
+ }
42659
+ /** A polygon (local coords) approximating the shape outline, for `largestRect`. */ function shapePolygon(g, points) {
42660
+ if (typeof g.d === "string") return path2polygon(g.d);
42661
+ return points;
42662
+ }
42004
42663
  /**
42005
- Renders the per-datum background images collected during `Shape.toScene` as
42006
- flat sibling nodes. When `rank` is set (a `sort` comparator is active) every
42007
- returned node needs a `z` — otherwise the backend sort would collapse the
42008
- images to 0 and interleave them among the geometry — so they are placed
42009
- above all geometry (ranks span `0..dataLen-1`) while keeping their own order.
42010
- */ function emitBackgroundImages(bgClass, imageData, rank, dataLen) {
42011
- bgClass.data(imageData).id((d)=>`${d.id}`).url((d)=>d.url).x((d)=>d.x).y((d)=>d.y).width((d)=>d.width).height((d)=>d.height).renderMode("compute");
42012
- const imgScene = bgClass.toScene();
42013
- if (!imgScene || !Array.isArray(imgScene.children)) return [];
42014
- if (rank) imgScene.children.forEach((c, k)=>c.z = dataLen + k);
42015
- return imgScene.children;
42664
+ Resolves a backgroundImage's box + clip + `preserveAspectRatio` for a datum's
42665
+ geometry, honoring the fit mode:
42666
+
42667
+ - `cover` — the image fills the shape's bounding box and is cropped
42668
+ (`xMidYMid slice`), clipped to the shape's own outline.
42669
+ - `contain` — the whole image is centered and fully visible inside the shape:
42670
+ it is fit (`xMidYMid meet`) into the shape's largest inscribed axis-aligned
42671
+ rectangle (a Rect uses itself; a Circle its inscribed square; a Path/Area
42672
+ uses `largestRect` of its polygon). No clip is needed since the box already
42673
+ sits inside the shape.
42674
+
42675
+ Returns null when no usable box can be derived.
42676
+ */ function backgroundImageLayout(g, points, fit) {
42677
+ if (fit !== "contain") {
42678
+ const box = backgroundImageBox(g, points);
42679
+ if (!box) return null;
42680
+ return {
42681
+ box,
42682
+ clip: backgroundImageClip(g, points),
42683
+ preserveAspectRatio: "xMidYMid slice"
42684
+ };
42685
+ }
42686
+ // contain: fit inside the largest inscribed rectangle, fully visible.
42687
+ let box = null;
42688
+ if (typeof g.width === "number" && typeof g.height === "number") {
42689
+ box = backgroundImageBox(g, points); // a rect contains itself
42690
+ } else if (typeof g.r === "number") {
42691
+ // Inscribed square of a circle: side = r·√2, centered on (cx, cy).
42692
+ const cx = typeof g.cx === "number" ? g.cx : 0;
42693
+ const cy = typeof g.cy === "number" ? g.cy : 0;
42694
+ const half = g.r / Math.SQRT2;
42695
+ box = {
42696
+ x: cx - half,
42697
+ y: cy - half,
42698
+ width: half * 2,
42699
+ height: half * 2
42700
+ };
42701
+ } else {
42702
+ const poly = shapePolygon(g, points);
42703
+ const r = poly.length > 2 ? largestRect(poly, {
42704
+ angle: 0
42705
+ }) : null;
42706
+ box = r ? {
42707
+ x: r.cx - r.width / 2,
42708
+ y: r.cy - r.height / 2,
42709
+ width: r.width,
42710
+ height: r.height
42711
+ } : backgroundImageBox(g, points);
42712
+ }
42713
+ return box ? {
42714
+ box,
42715
+ preserveAspectRatio: "xMidYMid meet"
42716
+ } : null;
42717
+ }
42718
+ /**
42719
+ Emits the per-datum background images collected during `Shape.toScene`. Each
42720
+ image is wrapped in its own group carrying the shape's datum + transform, so
42721
+ it is clipped to the shape's outline, positioned in local space, and dims/
42722
+ raises together with its shape on hover. The image is non-interactive (and
42723
+ keyed apart from the shape) so pointer events pass through to the shape below.
42724
+ When `rank` is set (a `sort` comparator is active) every group needs a `z`
42725
+ so the backend sort keeps images above the geometry in their own order.
42726
+ */ function emitBackgroundImages(specs, rank, dataLen) {
42727
+ return specs.map((spec, k)=>{
42728
+ const image = {
42729
+ type: "image",
42730
+ // Keyed apart from the shape (which uses `spec.key`): sharing the key would
42731
+ // let this non-interactive image overwrite the shape in the hit-test index.
42732
+ key: `${spec.key}-bgimage-img`,
42733
+ x: spec.box.x,
42734
+ y: spec.box.y,
42735
+ width: spec.box.width,
42736
+ height: spec.box.height,
42737
+ href: spec.url,
42738
+ preserveAspectRatio: spec.preserveAspectRatio,
42739
+ // Decorative: pointer events fall through to the shape underneath.
42740
+ interactive: false
42741
+ };
42742
+ const group = {
42743
+ type: "group",
42744
+ key: `${spec.key}-bgimage`,
42745
+ children: [
42746
+ image
42747
+ ],
42748
+ // Carry the shape's datum/index so hover/active dimming treats the image
42749
+ // like its shape — dimming and hover-raising the two together (the group
42750
+ // is emitted after the geometry, so at equal `z` the image stays on top).
42751
+ datum: spec.datum,
42752
+ index: spec.index,
42753
+ interactive: false,
42754
+ // A group-level opacity gives the enter/exit animation a target to fade
42755
+ // to/from (matching the shape): the animate layer collapses it to 0 on
42756
+ // enter and eases up to this. It also cascades to the image, so hover
42757
+ // dimming applied here fades the picture with its shape.
42758
+ paint: {
42759
+ opacity: spec.opacity ?? 1
42760
+ },
42761
+ ...spec.transform ? {
42762
+ transform: spec.transform
42763
+ } : {},
42764
+ ...spec.clip ? {
42765
+ clip: spec.clip
42766
+ } : {},
42767
+ ...rank ? {
42768
+ z: dataLen + k
42769
+ } : {}
42770
+ };
42771
+ return group;
42772
+ });
42016
42773
  }
42017
42774
 
42018
42775
  /** Coerces a value to a finite number, or undefined. @private */ function numOrUndef(v) {
@@ -42046,6 +42803,11 @@
42046
42803
  coerce: "const",
42047
42804
  default: constant$b(false)
42048
42805
  },
42806
+ {
42807
+ key: "backgroundImageFit",
42808
+ coerce: "const",
42809
+ default: constant$b("cover")
42810
+ },
42049
42811
  {
42050
42812
  key: "discrete",
42051
42813
  coerce: "identity"
@@ -42358,10 +43120,10 @@
42358
43120
  let data = this._data;
42359
43121
  if (this._dataFilter) data = this._dataFilter(data);
42360
43122
  const children = [];
42361
- // Build the backgroundImage data for emission below. Each datum that
42362
- // resolves to a non-false `backgroundImage(d, i)` becomes an
42363
- // ImageNode positioned at the shape's geometry.
42364
- const imageData = [];
43123
+ // Collected background images, emitted below (after the geometry) as clipped,
43124
+ // transformed groups. Each datum whose `backgroundImage(d, i)` resolves to a
43125
+ // truthy URL contributes one spec.
43126
+ const bgSpecs = [];
42365
43127
  // A `sort` comparator becomes per-datum `z` ranks rather than a reorder of
42366
43128
  // `data`: the render backends sort each group's children ascending by `z`
42367
43129
  // (stably), so a lower rank paints first (behind) and a higher rank paints
@@ -42400,41 +43162,37 @@
42400
43162
  z: rank[i]
42401
43163
  } : {}
42402
43164
  });
42403
- // backgroundImage: collect a per-datum image when the accessor
42404
- // returns a truthy URL. The image is sized to the shape's
42405
- // geometry (preferring width/height fields when present).
43165
+ // backgroundImage: collect a per-datum image (see backgroundImageLayout for
43166
+ // the cover/contain fit). The wrapping group carries the shape transform,
43167
+ // so the image box + clip stay in local space.
42406
43168
  const bg = this._nestWrapper(this.schema.backgroundImage)(d, i);
42407
43169
  if (bg) {
42408
43170
  const g = geom;
42409
- // Shape geometry is origin-centered; its on-screen position lives in
42410
- // the node transform. The background image is emitted as a flat sibling
42411
- // (no transform), so bake the shape's translate into the image x/y —
42412
- // otherwise every image lands at the origin (top-left).
42413
- const t = this._sceneTransform(d, i);
42414
- const w = typeof g.width === "number" ? g.width : undefined;
42415
- const h = typeof g.height === "number" ? g.height : undefined;
42416
- const cx = typeof g.cx === "number" ? g.cx : typeof g.x === "number" ? g.x : 0;
42417
- const cy = typeof g.cy === "number" ? g.cy : typeof g.y === "number" ? g.y : 0;
42418
- const r = typeof g.r === "number" ? g.r : undefined;
42419
- const iw = w ?? (r != null ? r * 2 : 0);
42420
- const ih = h ?? (r != null ? r * 2 : 0);
42421
- imageData.push({
42422
- __d3plus__: true,
42423
- data: d,
42424
- i,
42425
- id: this._nestWrapper(this.schema.id)(d, i),
42426
- url: bg,
42427
- x: (t.x ?? 0) + cx - iw / 2,
42428
- y: (t.y ?? 0) + cy - ih / 2,
42429
- width: iw,
42430
- height: ih
42431
- });
43171
+ // Only Area/Line lack a `d`/box and need polygon points; Path/Rect/Circle
43172
+ // derive their layout from `d`/width/r directly.
43173
+ const needsPoints = typeof g.d !== "string" && typeof g.width !== "number" && typeof g.r !== "number";
43174
+ const points = needsPoints ? this._aes(d, i).points ?? [] : [];
43175
+ const fit = this._nestWrapper(this.schema.backgroundImageFit)(d, i);
43176
+ const layout = backgroundImageLayout(g, points, fit === "contain" ? "contain" : "cover");
43177
+ if (layout) {
43178
+ bgSpecs.push({
43179
+ key,
43180
+ index: i,
43181
+ datum,
43182
+ url: bg,
43183
+ box: layout.box,
43184
+ clip: layout.clip,
43185
+ preserveAspectRatio: layout.preserveAspectRatio,
43186
+ opacity: numOrUndef(this._nestWrapper(this.schema.opacity)(d, i)),
43187
+ transform
43188
+ });
43189
+ }
42432
43190
  }
42433
43191
  });
42434
43192
  // Emit background images AFTER shape children so they paint above the
42435
43193
  // shape's fill — matches the DOM order where the <image> was
42436
43194
  // appended as a sibling of the shape.
42437
- if (imageData.length) children.push(...emitBackgroundImages(this._backgroundImageClass, imageData, rank, data.length));
43195
+ if (bgSpecs.length) children.push(...emitBackgroundImages(bgSpecs, rank, data.length));
42438
43196
  // NOTE: Labels are NOT pushed here. The canonical aggregation point is
42439
43197
  // `emitHelpers.collectComputed(shape)`, which appends `shape.toScene()`
42440
43198
  // AND `shape._labelClass.toScene()` independently. Pushing labels here
@@ -42597,7 +43355,6 @@
42597
43355
  */ constructor(tagName = "g"){
42598
43356
  super();
42599
43357
  installFluent(this, shapeSchema);
42600
- this._backgroundImageClass = new Image$1();
42601
43358
  this._data = [];
42602
43359
  this._labelClass = new TextBox();
42603
43360
  this._name = "Shape";
@@ -42686,7 +43443,7 @@
42686
43443
  const cx = Number(d.x);
42687
43444
  const cy = Number(d.y);
42688
43445
  const userCurve = String(this.schema.curve.bind(this)(this.config()));
42689
- const curve = d3Shape[`curve${userCurve.charAt(0).toUpperCase()}${userCurve.slice(1)}`];
43446
+ const curve = paths[`curve${userCurve.charAt(0).toUpperCase()}${userCurve.slice(1)}`];
42690
43447
  const offX = (fn)=>(v, z)=>fn(v, z) - cx;
42691
43448
  const offY = (fn)=>(v, z)=>fn(v, z) - cy;
42692
43449
  const gen = d3area().defined(this.schema.defined).curve(curve).x(offX(this.schema.x)).x0(offX(this.schema.x0)).y(offY(this.schema.y)).y0(offY(this.schema.y0));
@@ -43195,7 +43952,7 @@
43195
43952
  const cx = Number(d.x);
43196
43953
  const cy = Number(d.y);
43197
43954
  const userCurve = String(this.schema.curve.bind(this)(this.config()));
43198
- const curve = d3Shape[`curve${userCurve.charAt(0).toUpperCase()}${userCurve.slice(1)}`];
43955
+ const curve = paths[`curve${userCurve.charAt(0).toUpperCase()}${userCurve.slice(1)}`];
43199
43956
  const gen = d3line().curve(curve).defined(this.schema.defined).x((v, z)=>this.schema.x(v, z) - cx).y((v, z)=>this.schema.y(v, z) - cy);
43200
43957
  return {
43201
43958
  type: "path",
@@ -43725,6 +44482,152 @@
43725
44482
  }
43726
44483
  }
43727
44484
 
44485
+ /** Image's fluent accessor schema. Config storage lives on `this.schema.<key>`. */ const imageSchema = [
44486
+ {
44487
+ key: "duration",
44488
+ coerce: "identity",
44489
+ default: 600
44490
+ },
44491
+ {
44492
+ key: "height",
44493
+ coerce: "accessor",
44494
+ default: accessor("height")
44495
+ },
44496
+ {
44497
+ key: "id",
44498
+ coerce: "identity",
44499
+ default: accessor("id")
44500
+ },
44501
+ {
44502
+ key: "opacity",
44503
+ coerce: "const",
44504
+ default: constant$b(1)
44505
+ },
44506
+ {
44507
+ key: "pointerEvents",
44508
+ coerce: "const",
44509
+ default: constant$b("auto")
44510
+ },
44511
+ {
44512
+ key: "renderMode",
44513
+ coerce: "identity",
44514
+ default: "full"
44515
+ },
44516
+ {
44517
+ key: "url",
44518
+ coerce: "identity",
44519
+ default: accessor("url")
44520
+ },
44521
+ {
44522
+ key: "width",
44523
+ coerce: "accessor",
44524
+ default: accessor("width")
44525
+ },
44526
+ {
44527
+ key: "x",
44528
+ coerce: "const",
44529
+ default: accessor("x", 0)
44530
+ },
44531
+ {
44532
+ key: "y",
44533
+ coerce: "const",
44534
+ default: accessor("y", 0)
44535
+ }
44536
+ ];
44537
+ let Image$1 = class Image {
44538
+ config(_) {
44539
+ if (!arguments.length) return {
44540
+ ...this.schema,
44541
+ data: this._data,
44542
+ select: this._select
44543
+ };
44544
+ const patch = _;
44545
+ for(const k in patch){
44546
+ if (!Object.prototype.hasOwnProperty.call(patch, k)) continue;
44547
+ // `this[k]` resolves the fluent accessor via the index signature.
44548
+ if (typeof this[k] === "function") this[k](patch[k]);
44549
+ else this.schema[k] = patch[k];
44550
+ }
44551
+ return this;
44552
+ }
44553
+ /**
44554
+ Renders the current Image to the page. If a *callback* is specified, it will be called once the images are done drawing.
44555
+ @param callback Optional callback invoked after rendering completes.
44556
+ */ render(callback) {
44557
+ // Compute mode is a no-op for DOM emission — the caller will read
44558
+ // `toScene()` to get a SceneNode tree, no need to mount.
44559
+ if (this.schema.renderMode === "compute") {
44560
+ if (callback) setTimeout(callback, 0);
44561
+ return this;
44562
+ }
44563
+ if (this._select === void 0) this.select(select("body").append("svg").style("width", `${window.innerWidth}px`).style("height", `${window.innerHeight}px`).style("display", "block").node());
44564
+ const images = this._select.selectAll(".d3plus-Image").data(this._data, this.schema.id);
44565
+ const enter = images.enter().append("image").attr("class", "d3plus-Image").attr("opacity", 0).attr("width", 0).attr("height", 0).attr("x", (d, i)=>this.schema.x(d, i) + this.schema.width(d, i) / 2).attr("y", (d, i)=>this.schema.y(d, i) + this.schema.height(d, i) / 2);
44566
+ const t = transition().duration(this.schema.duration), that = this, update = enter.merge(images);
44567
+ update.attr("xlink:href", this.schema.url).style("pointer-events", this.schema.pointerEvents).transition(t).attr("opacity", this.schema.opacity).attr("width", (d, i)=>this.schema.width(d, i)).attr("height", (d, i)=>this.schema.height(d, i)).attr("x", (d, i)=>this.schema.x(d, i)).attr("y", (d, i)=>this.schema.y(d, i)).each(function(d, i) {
44568
+ const image = select(this), link = that.schema.url(d, i);
44569
+ const fullAddress = link.indexOf("http://") === 0 || link.indexOf("https://") === 0;
44570
+ if (!fullAddress || link.indexOf(window.location.hostname) === 0) {
44571
+ const img = new window.Image();
44572
+ img.src = link;
44573
+ img.crossOrigin = "Anonymous";
44574
+ img.onload = function() {
44575
+ const canvas = document.createElement("canvas");
44576
+ canvas.width = img.width;
44577
+ canvas.height = img.height;
44578
+ const context = canvas.getContext("2d");
44579
+ context.drawImage(img, 0, 0);
44580
+ image.attr("xlink:href", canvas.toDataURL("image/png"));
44581
+ };
44582
+ }
44583
+ });
44584
+ images.exit().transition(t).attr("width", (d, i)=>this.schema.width(d, i)).attr("height", (d, i)=>this.schema.height(d, i)).attr("x", (d, i)=>this.schema.x(d, i)).attr("y", (d, i)=>this.schema.y(d, i)).attr("opacity", 0).remove();
44585
+ if (callback) setTimeout(callback, this.schema.duration + 100);
44586
+ return this;
44587
+ }
44588
+ data(_) {
44589
+ return arguments.length ? (this._data = _, this) : this._data;
44590
+ }
44591
+ /**
44592
+ Compute-mode scene emission. Mirrors Shape.toScene's shape — a
44593
+ keyed GroupNode wrapping per-datum ImageNodes. Used by chart
44594
+ compositors (e.g. plotPaint) that need Image to participate in the
44595
+ scene graph rather than emit d3-selection DOM.
44596
+ */ toScene() {
44597
+ const children = (this._data || []).map((d, i)=>{
44598
+ const node = {
44599
+ type: "image",
44600
+ key: `${this.schema.id(d, i)}`,
44601
+ x: this.schema.x(d, i),
44602
+ y: this.schema.y(d, i),
44603
+ width: this.schema.width(d, i),
44604
+ height: this.schema.height(d, i),
44605
+ href: this.schema.url(d, i),
44606
+ paint: {
44607
+ opacity: this.schema.opacity(d, i)
44608
+ },
44609
+ datum: d,
44610
+ index: i
44611
+ };
44612
+ return node;
44613
+ });
44614
+ return {
44615
+ type: "group",
44616
+ key: "d3plus-Image",
44617
+ children
44618
+ };
44619
+ }
44620
+ select(_) {
44621
+ return arguments.length ? (this._select = select(_), this) : this._select;
44622
+ }
44623
+ /**
44624
+ Invoked when creating a new class instance, and sets any default parameters.
44625
+ @private
44626
+ */ constructor(){
44627
+ installFluent(this, imageSchema);
44628
+ }
44629
+ };
44630
+
43728
44631
  /** Path's own fluent accessor schema, layered on top of Shape's. */ const pathSchema = [
43729
44632
  {
43730
44633
  key: "d",
@@ -51506,8 +52409,10 @@
51506
52409
  data.sort((a, b)=>a[viz.schema.discrete] - b[viz.schema.discrete]);
51507
52410
  }
51508
52411
  const order = viz._stackOrder;
52412
+ // An explicit key array orders `stackKeys` directly (then d3-stack keeps
52413
+ // that order via `stackOrderNone`); every other order is a comparator that
52414
+ // reranks the series d3-stack builds, so `stackKeys` is left in input order.
51509
52415
  if (Array.isArray(order)) stackKeys.sort((a, b)=>order.indexOf(a) - order.indexOf(b));
51510
- else if (order === none) stackKeys.sort((a, b)=>`${a}`.localeCompare(`${b}`));
51511
52416
  // d3-stack's generics don't model d3plus's dynamically-keyed rows; the
51512
52417
  // order/offset/value accessors are cast (`as never`) at the boundary, and
51513
52418
  // the configured stack is invoked as a `Row[][] -> number[][][]` function.
@@ -53049,6 +53954,13 @@
53049
53954
  };
53050
53955
  }
53051
53956
 
53957
+ /** Marks a comparator as an already-resolved d3plus stack order. */ function tagOrder(fn) {
53958
+ fn.__d3plusStackOrder = true;
53959
+ return fn;
53960
+ }
53961
+ // @types/d3-shape types the order accessors' param as a single `Series`,
53962
+ // though d3 passes the full stack array; this cast satisfies the signature.
53963
+ const asStack = (series)=>series;
53052
53964
  /**
53053
53965
  Sums a single stack series, ignoring non-numeric segments.
53054
53966
  */ function stackSum(series) {
@@ -53058,18 +53970,80 @@
53058
53970
  return s;
53059
53971
  }
53060
53972
  /**
53061
- Stack order: ascending by series key, tie-broken by summed value.
53062
- */ function stackOrderAscending(series) {
53973
+ Stack order: series with the smallest summed value on the bottom of the
53974
+ stack (matches d3's `stackOrderAscending`).
53975
+ */ const stackOrderTotalAscending = tagOrder((series)=>ascending(asStack(series)));
53976
+ /**
53977
+ Stack order: series with the largest summed value on the bottom of the
53978
+ stack (matches d3's `stackOrderDescending`). Plot's default.
53979
+ */ const stackOrderTotalDescending = tagOrder((series)=>descending(asStack(series)));
53980
+ /**
53981
+ Stack order: ascending by series key (A→Z from the bottom), tie-broken by
53982
+ ascending summed value.
53983
+ */ const stackOrderKey = tagOrder((series)=>{
53063
53984
  const sums = series.map(stackSum);
53064
53985
  const keys = series.map((d)=>d.key.split("_")[0]);
53065
- // @types/d3-shape types the order accessors' param as a single `Series`,
53066
- // though d3 passes the full stack array; cast to satisfy the signature.
53067
- return none(series).sort((a, b)=>keys[b].localeCompare(keys[a]) || sums[a] - sums[b]);
53986
+ return none(asStack(series)).sort((a, b)=>keys[a].localeCompare(keys[b]) || sums[a] - sums[b]);
53987
+ });
53988
+ /**
53989
+ Stack order: the reverse of {@link stackOrderKey} (Z→A from the bottom).
53990
+ */ const stackOrderKeyReverse = tagOrder((series)=>stackOrderKey(series).reverse());
53991
+ /**
53992
+ Builds a stack order that ranks each series by an aggregate (sum) of a
53993
+ data field, letting users order stacks by any value in their data rather
53994
+ than only the plotted one. `value` receives each series' original datum.
53995
+ */ function stackOrderField(value, order = "descending") {
53996
+ return tagOrder((series)=>{
53997
+ const totals = series.map((s)=>{
53998
+ let total = 0;
53999
+ for(let i = 0; i < s.length; i++){
54000
+ // Each stacked point carries `.data` = the discrete group's rows;
54001
+ // pick the row for this series and read the field off its datum.
54002
+ const group = s[i].data || [];
54003
+ const row = group.find((g)=>g.id === s.key);
54004
+ if (row && row.data) {
54005
+ const v = +value(row.data);
54006
+ if (!isNaN(v)) total += v;
54007
+ }
54008
+ }
54009
+ return total;
54010
+ });
54011
+ return none(asStack(series)).sort((a, b)=>order === "ascending" ? totals[a] - totals[b] : totals[b] - totals[a]);
54012
+ });
53068
54013
  }
54014
+ /** Named stack orders accepted by `Plot.stackOrder`. */ const NAMED_ORDERS = {
54015
+ ascending: stackOrderTotalAscending,
54016
+ descending: stackOrderTotalDescending,
54017
+ key: stackOrderKey,
54018
+ keyReverse: stackOrderKeyReverse,
54019
+ none: tagOrder((series)=>none(asStack(series))),
54020
+ data: tagOrder((series)=>none(asStack(series))),
54021
+ insideOut: tagOrder((series)=>insideOut(asStack(series))),
54022
+ appearance: tagOrder((series)=>appearance(asStack(series))),
54023
+ reverse: tagOrder((series)=>reverse$1(asStack(series)))
54024
+ };
54025
+ /** The named orders accepted by `Plot.stackOrder`, for docs/validation. */ const stackOrderNames = Object.keys(NAMED_ORDERS);
53069
54026
  /**
53070
- Stack order: the reverse of {@link stackOrderAscending}.
53071
- */ function stackOrderDescending(series) {
53072
- return stackOrderAscending(series).reverse();
54027
+ Normalizes any `stackOrder` input into a value Plot's pipeline can apply:
54028
+ a tagged comparator, or an explicit array of series keys. Warns and falls
54029
+ back to the default on an unrecognized name.
54030
+ */ function resolveStackOrder(input) {
54031
+ if (typeof input === "function") {
54032
+ // Already-resolved order (constructor default / config() reset) passes
54033
+ // through; a bare user function is treated as a value accessor.
54034
+ return input.__d3plusStackOrder ? input : stackOrderField(input);
54035
+ }
54036
+ if (Array.isArray(input)) return input;
54037
+ if (input && typeof input === "object") {
54038
+ const { value, order } = input;
54039
+ return stackOrderField(typeof value === "function" ? value : accessor(value), order);
54040
+ }
54041
+ if (typeof input === "string") {
54042
+ if (input in NAMED_ORDERS) return NAMED_ORDERS[input];
54043
+ console.warn(`[d3plus] Unknown stackOrder "${input}". Expected one of: ${stackOrderNames.join(", ")}; an array of series keys; a value accessor; or a {value, order} config. Falling back to "descending".`);
54044
+ return stackOrderTotalDescending;
54045
+ }
54046
+ return stackOrderTotalDescending;
53073
54047
  }
53074
54048
  /**
53075
54049
  Diverging stack offset: positive segments stack upward from zero,
@@ -53091,6 +54065,23 @@
53091
54065
  }
53092
54066
  }
53093
54067
  }
54068
+ /** Named stack offsets accepted by `Plot.stackOffset`. */ const NAMED_OFFSETS = {
54069
+ diverging: stackOffsetDiverging,
54070
+ none: none$1,
54071
+ expand: expand,
54072
+ silhouette: silhouette,
54073
+ wiggle: wiggle
54074
+ };
54075
+ /** The named offsets accepted by `Plot.stackOffset`, for docs/validation. */ const stackOffsetNames = Object.keys(NAMED_OFFSETS);
54076
+ /**
54077
+ Normalizes a `stackOffset` input into an offset function. Warns and falls
54078
+ back to the diverging default on an unrecognized name.
54079
+ */ function resolveStackOffset(input) {
54080
+ if (typeof input === "function") return input;
54081
+ if (typeof input === "string" && input in NAMED_OFFSETS) return NAMED_OFFSETS[input];
54082
+ console.warn(`[d3plus] Unknown stackOffset "${input}". Expected one of: ${stackOffsetNames.join(", ")}; or an offset function. Falling back to "diverging".`);
54083
+ return stackOffsetDiverging;
54084
+ }
53094
54085
 
53095
54086
  /**
53096
54087
  Clone the base shape config and, for stacked Area/Bar, inject the
@@ -53830,6 +54821,7 @@
53830
54821
  ];
53831
54822
  }
53832
54823
 
54824
+ /* eslint no-cond-assign: 0*/ // @ts-ignore
53833
54825
  const { theme: openColor } = pkg;
53834
54826
  // E4: Plot's identity-coerce accessor schema (18 keys). installFluent's
53835
54827
  // per-key idempotence lets this co-exist with vizSchema on the parent
@@ -54128,18 +55120,29 @@
54128
55120
  return arguments.length ? (this._size = typeof _ === "function" || !_ ? _ : accessor(_), this) : this._size;
54129
55121
  }
54130
55122
  /**
54131
- Sets the stack offset. If *value* is not specified, returns the current stack offset function.
55123
+ Sets the vertical offset applied to stacked series. Accepts a named
55124
+ offset — `"diverging"` (default), `"none"`, `"expand"`, `"silhouette"`,
55125
+ or `"wiggle"` — or a custom offset function. Unknown names warn and fall
55126
+ back to `"diverging"`. If *value* is not specified, returns the current
55127
+ stack offset function.
54132
55128
  */ stackOffset(_) {
54133
- return arguments.length ? (this._stackOffset = typeof _ === "function" ? _ : d3Shape[`stackOffset${_.charAt(0).toUpperCase() + _.slice(1)}`], this) : this._stackOffset;
55129
+ return arguments.length ? (this._stackOffset = resolveStackOffset(_), this) : this._stackOffset;
54134
55130
  }
54135
55131
  /**
54136
- Sets the stack order. If *value* is not specified, returns the current stack order function.
55132
+ Sets the order of stacked series, from the bottom of the stack upward.
55133
+ Accepts:
55134
+ - a named order: `"descending"` (default) / `"ascending"` by summed
55135
+ value, `"key"` / `"keyReverse"` alphabetically by series key,
55136
+ `"none"` / `"data"` for input order, or d3's `"insideOut"`,
55137
+ `"appearance"`, `"reverse"`;
55138
+ - an Array of series keys for an explicit order;
55139
+ - a value accessor, or a `{value, order}` config, to rank series by an
55140
+ aggregate of any data field.
55141
+
55142
+ Unknown named strings warn and fall back to `"descending"`. If *value*
55143
+ is not specified, returns the current stack order.
54137
55144
  */ stackOrder(_) {
54138
- if (arguments.length) {
54139
- if (typeof _ === "string") this._stackOrder = _ === "ascending" ? stackOrderAscending : _ === "descending" ? stackOrderDescending : d3Shape[`stackOrder${_.charAt(0).toUpperCase() + _.slice(1)}`];
54140
- else this._stackOrder = _;
54141
- return this;
54142
- } else return this._stackOrder;
55145
+ return arguments.length ? (this._stackOrder = resolveStackOrder(_), this) : this._stackOrder;
54143
55146
  }
54144
55147
  /**
54145
55148
  Accessor function or string key for the x-axis value of each data point.
@@ -54284,7 +55287,7 @@
54284
55287
  this.schema.sizeMin = 5;
54285
55288
  this.schema.sizeScale = "sqrt";
54286
55289
  this._stackOffset = stackOffsetDiverging;
54287
- this._stackOrder = stackOrderDescending;
55290
+ this._stackOrder = stackOrderTotalDescending;
54288
55291
  this.schema.timelineConfig = assign(this.schema.timelineConfig, {
54289
55292
  brushMin: ()=>this._xTime || this._yTime || this._x2Time || this._y2Time ? 2 : 1
54290
55293
  });
@@ -54360,7 +55363,8 @@
54360
55363
  },
54361
55364
  {
54362
55365
  key: "shape",
54363
- default: constant$b("Area")
55366
+ default: constant$b("Area"),
55367
+ coerce: "const"
54364
55368
  }
54365
55369
  ]
54366
55370
  };
@@ -54389,10 +55393,12 @@
54389
55393
  },
54390
55394
  {
54391
55395
  key: "shape",
54392
- default: constant$b("Bar")
55396
+ default: constant$b("Bar"),
55397
+ coerce: "const"
54393
55398
  },
54394
55399
  {
54395
55400
  key: "legend",
55401
+ coerce: "const",
54396
55402
  factory: (viz)=>{
54397
55403
  const base = viz.schema.legend;
54398
55404
  return (config, arr)=>{
@@ -54426,7 +55432,8 @@
54426
55432
  },
54427
55433
  {
54428
55434
  key: "shape",
54429
- default: constant$b("Box")
55435
+ default: constant$b("Box"),
55436
+ coerce: "const"
54430
55437
  },
54431
55438
  {
54432
55439
  key: "tooltipConfig",
@@ -54492,7 +55499,8 @@
54492
55499
  },
54493
55500
  {
54494
55501
  key: "shape",
54495
- default: constant$b("Line")
55502
+ default: constant$b("Line"),
55503
+ coerce: "const"
54496
55504
  }
54497
55505
  ]
54498
55506
  };
@@ -54727,6 +55735,7 @@
54727
55735
  },
54728
55736
  {
54729
55737
  key: "legend",
55738
+ coerce: "const",
54730
55739
  factory: (viz)=>{
54731
55740
  const base = viz.schema.legend;
54732
55741
  return (config, arr)=>{
@@ -67968,7 +68977,8 @@
67968
68977
  },
67969
68978
  {
67970
68979
  key: "shape",
67971
- default: constant$b("Circle")
68980
+ default: constant$b("Circle"),
68981
+ coerce: "const"
67972
68982
  },
67973
68983
  {
67974
68984
  key: "topojson",
@@ -68066,7 +69076,8 @@
68066
69076
  },
68067
69077
  {
68068
69078
  key: "shape",
68069
- default: constant$b("Line")
69079
+ default: constant$b("Line"),
69080
+ coerce: "const"
68070
69081
  }
68071
69082
  ]
68072
69083
  };
@@ -68330,6 +69341,7 @@
68330
69341
  },
68331
69342
  {
68332
69343
  key: "label",
69344
+ coerce: "const",
68333
69345
  factory: (viz)=>(d, i)=>`${getProp.bind(viz)("row", d, i)} / ${getProp.bind(viz)("column", d, i)}`
68334
69346
  }
68335
69347
  ]
@@ -69644,7 +70656,8 @@
69644
70656
  },
69645
70657
  {
69646
70658
  key: "shape",
69647
- default: constant$b("Circle")
70659
+ default: constant$b("Circle"),
70660
+ coerce: "const"
69648
70661
  },
69649
70662
  {
69650
70663
  key: "shapeConfig",
@@ -70772,6 +71785,7 @@
70772
71785
  },
70773
71786
  {
70774
71787
  key: "legend",
71788
+ coerce: "const",
70775
71789
  factory: (viz)=>{
70776
71790
  const base = viz.schema.legend;
70777
71791
  return (config, arr)=>{
@@ -71331,7 +72345,8 @@
71331
72345
  },
71332
72346
  {
71333
72347
  key: "shape",
71334
- default: constant$b("Path")
72348
+ default: constant$b("Path"),
72349
+ coerce: "const"
71335
72350
  },
71336
72351
  {
71337
72352
  key: "value",
@@ -71575,6 +72590,7 @@
71575
72590
  },
71576
72591
  {
71577
72592
  key: "label",
72593
+ coerce: "const",
71578
72594
  factory: (viz)=>(d, i)=>`${getProp.bind(viz)("row", d, i)} / ${getProp.bind(viz)("column", d, i)}`
71579
72595
  }
71580
72596
  ]
@@ -72293,7 +73309,8 @@
72293
73309
  },
72294
73310
  {
72295
73311
  key: "shape",
72296
- default: constant$b("Circle")
73312
+ default: constant$b("Circle"),
73313
+ coerce: "const"
72297
73314
  },
72298
73315
  {
72299
73316
  key: "shapeConfig",
@@ -73187,7 +74204,8 @@
73187
74204
  },
73188
74205
  {
73189
74206
  key: "shape",
73190
- default: constant$b("Rect")
74207
+ default: constant$b("Rect"),
74208
+ coerce: "const"
73191
74209
  },
73192
74210
  {
73193
74211
  key: "shapeConfig",
@@ -73571,7 +74589,8 @@
73571
74589
  },
73572
74590
  {
73573
74591
  key: "shape",
73574
- default: constant$b("Circle")
74592
+ default: constant$b("Circle"),
74593
+ coerce: "const"
73575
74594
  },
73576
74595
  {
73577
74596
  key: "shapeConfig",
@@ -73945,6 +74964,7 @@
73945
74964
  },
73946
74965
  {
73947
74966
  key: "legend",
74967
+ coerce: "const",
73948
74968
  factory: (viz)=>{
73949
74969
  const base = viz.schema.legend;
73950
74970
  return (config, arr)=>{