@d3plus/core 4.0.0 → 4.1.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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- @d3plus/core v4.0.0
2
+ @d3plus/core v4.1.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
@@ -1343,7 +1343,7 @@
1343
1343
  return Array.from(events, (event)=>pointer(event, node));
1344
1344
  }
1345
1345
 
1346
- function _type_of$3(obj) {
1346
+ function _type_of$4(obj) {
1347
1347
  "@swc/helpers - typeof";
1348
1348
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1349
1349
  }
@@ -1351,7 +1351,7 @@
1351
1351
  Returns true/false whether the argument provided to the function should be loaded using an internal XHR request. Valid data can either be a string URL or an Object with "url" and "headers" keys.
1352
1352
  @param dataItem The value to be tested
1353
1353
  */ function isData(dataItem) {
1354
- return typeof dataItem === "string" || (typeof dataItem === "undefined" ? "undefined" : _type_of$3(dataItem)) === "object" && dataItem !== null && !!dataItem.url;
1354
+ return typeof dataItem === "string" || (typeof dataItem === "undefined" ? "undefined" : _type_of$4(dataItem)) === "object" && dataItem !== null && !!dataItem.url;
1355
1355
  }
1356
1356
 
1357
1357
  var EOL = {}, EOF = {}, QUOTE = 34, NEWLINE = 10, RETURN = 13;
@@ -1518,7 +1518,7 @@
1518
1518
  return left instanceof right;
1519
1519
  }
1520
1520
  }
1521
- function _type_of$2(obj) {
1521
+ function _type_of$3(obj) {
1522
1522
  "@swc/helpers - typeof";
1523
1523
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1524
1524
  }
@@ -1526,7 +1526,7 @@
1526
1526
  Detects if a variable is a javascript Object.
1527
1527
  @param item The value to test.
1528
1528
  */ function isObject(item) {
1529
- return item && (typeof item === "undefined" ? "undefined" : _type_of$2(item)) === "object" && (typeof window === "undefined" || item !== window && item !== window.document && !_instanceof$c(item, Element)) && !Array.isArray(item) ? true : false;
1529
+ return item && (typeof item === "undefined" ? "undefined" : _type_of$3(item)) === "object" && (typeof window === "undefined" || item !== window && item !== window.document && !_instanceof$c(item, Element)) && !Array.isArray(item) ? true : false;
1530
1530
  }
1531
1531
 
1532
1532
  /**
@@ -9386,7 +9386,7 @@
9386
9386
  return left instanceof right;
9387
9387
  }
9388
9388
  }
9389
- function _type_of$1(obj) {
9389
+ function _type_of$2(obj) {
9390
9390
  "@swc/helpers - typeof";
9391
9391
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
9392
9392
  }
@@ -9482,7 +9482,7 @@
9482
9482
  toLoad.forEach(function(dataItem) {
9483
9483
  var url = dataItem;
9484
9484
  var init = {};
9485
- if ((typeof dataItem === "undefined" ? "undefined" : _type_of$1(dataItem)) === "object" && dataItem.url) {
9485
+ if ((typeof dataItem === "undefined" ? "undefined" : _type_of$2(dataItem)) === "object" && dataItem.url) {
9486
9486
  url = dataItem.url;
9487
9487
  init = dataItem;
9488
9488
  }
@@ -9651,7 +9651,7 @@
9651
9651
  return newObject;
9652
9652
  }
9653
9653
 
9654
- function _array_like_to_array$f(arr, len) {
9654
+ function _array_like_to_array$g(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;
@@ -9659,8 +9659,8 @@
9659
9659
  function _array_with_holes$d(arr) {
9660
9660
  if (Array.isArray(arr)) return arr;
9661
9661
  }
9662
- function _array_without_holes$6(arr) {
9663
- if (Array.isArray(arr)) return _array_like_to_array$f(arr);
9662
+ function _array_without_holes$7(arr) {
9663
+ if (Array.isArray(arr)) return _array_like_to_array$g(arr);
9664
9664
  }
9665
9665
  function _instanceof$4(left, right) {
9666
9666
  "@swc/helpers - instanceof";
@@ -9670,7 +9670,7 @@
9670
9670
  return left instanceof right;
9671
9671
  }
9672
9672
  }
9673
- function _iterable_to_array$6(iter) {
9673
+ function _iterable_to_array$7(iter) {
9674
9674
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
9675
9675
  }
9676
9676
  function _iterable_to_array_limit$d(arr, i) {
@@ -9700,22 +9700,22 @@
9700
9700
  function _non_iterable_rest$d() {
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$6() {
9703
+ function _non_iterable_spread$7() {
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
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$f(arr, i) || _non_iterable_rest$d();
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();
9708
9708
  }
9709
- function _to_consumable_array$6(arr) {
9710
- return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$f(arr) || _non_iterable_spread$6();
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();
9711
9711
  }
9712
- function _unsupported_iterable_to_array$f(o, minLen) {
9712
+ function _unsupported_iterable_to_array$g(o, minLen) {
9713
9713
  if (!o) return;
9714
- if (typeof o === "string") return _array_like_to_array$f(o, minLen);
9714
+ if (typeof o === "string") return _array_like_to_array$g(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$f(o, minLen);
9718
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
9719
9719
  }
9720
9720
  /**
9721
9721
  @summary Extends the base behavior of d3.nest to allow for multiple depth levels.
@@ -9734,7 +9734,7 @@
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$6(group(data, fns[0])).map(function(param) {
9737
+ return _to_consumable_array$7(group(data, fns[0])).map(function(param) {
9738
9738
  var _param = _sliced_to_array$d(param, 2), key = _param[0], values = _param[1];
9739
9739
  return {
9740
9740
  key: key,
@@ -20540,7 +20540,7 @@
20540
20540
  }
20541
20541
  };
20542
20542
 
20543
- function _define_property$6(obj, key, value) {
20543
+ function _define_property$7(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$6(_obj, "name", locale.language), _define_property$6(_obj, "location", locale.location), _define_property$6(_obj, "tag", locale.tag), _define_property$6(_obj, "lcid", locale.id), _define_property$6(_obj, "iso639-2", isoCodes[isoLanguage]["iso639-2"]), _define_property$6(_obj, "iso639-1", isoCodes[isoLanguage]["iso639-1"]), _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));
20566
20566
  }
20567
20567
  });
20568
20568
  var defaultLocales = {
@@ -21222,7 +21222,7 @@
21222
21222
  paths: paths
21223
21223
  };
21224
21224
 
21225
- function ownKeys$3(object, enumerableOnly) {
21225
+ function ownKeys$4(object, enumerableOnly) {
21226
21226
  var keys = Object.keys(object);
21227
21227
  if (Object.getOwnPropertySymbols) {
21228
21228
  var symbols = Object.getOwnPropertySymbols(object);
@@ -21239,13 +21239,13 @@
21239
21239
  for(var i = 1; i < arguments.length; i++){
21240
21240
  var source = arguments[i] != null ? arguments[i] : {};
21241
21241
  if (i % 2) {
21242
- ownKeys$3(Object(source), true).forEach(function(key) {
21242
+ ownKeys$4(Object(source), true).forEach(function(key) {
21243
21243
  _defineProperty(target, key, source[key]);
21244
21244
  });
21245
21245
  } else if (Object.getOwnPropertyDescriptors) {
21246
21246
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
21247
21247
  } else {
21248
- ownKeys$3(Object(source)).forEach(function(key) {
21248
+ ownKeys$4(Object(source)).forEach(function(key) {
21249
21249
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
21250
21250
  });
21251
21251
  }
@@ -21894,7 +21894,7 @@
21894
21894
  };
21895
21895
  }
21896
21896
 
21897
- function _array_like_to_array$e(arr, len) {
21897
+ function _array_like_to_array$f(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;
@@ -21902,7 +21902,7 @@
21902
21902
  function _array_with_holes$c(arr) {
21903
21903
  if (Array.isArray(arr)) return arr;
21904
21904
  }
21905
- function _define_property$5(obj, key, value) {
21905
+ function _define_property$6(obj, key, value) {
21906
21906
  if (key in obj) {
21907
21907
  Object.defineProperty(obj, key, {
21908
21908
  value: value,
@@ -21942,7 +21942,7 @@
21942
21942
  function _non_iterable_rest$c() {
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
- function _object_spread$2(target) {
21945
+ function _object_spread$3(target) {
21946
21946
  for(var i = 1; i < arguments.length; i++){
21947
21947
  var source = arguments[i] != null ? arguments[i] : {};
21948
21948
  var ownKeys = Object.keys(source);
@@ -21952,12 +21952,12 @@
21952
21952
  }));
21953
21953
  }
21954
21954
  ownKeys.forEach(function(key) {
21955
- _define_property$5(target, key, source[key]);
21955
+ _define_property$6(target, key, source[key]);
21956
21956
  });
21957
21957
  }
21958
21958
  return target;
21959
21959
  }
21960
- function ownKeys$2(object, enumerableOnly) {
21960
+ function ownKeys$3(object, enumerableOnly) {
21961
21961
  var keys = Object.keys(object);
21962
21962
  if (Object.getOwnPropertySymbols) {
21963
21963
  var symbols = Object.getOwnPropertySymbols(object);
@@ -21965,27 +21965,27 @@
21965
21965
  }
21966
21966
  return keys;
21967
21967
  }
21968
- function _object_spread_props$2(target, source) {
21968
+ function _object_spread_props$3(target, source) {
21969
21969
  source = source != null ? source : {};
21970
21970
  if (Object.getOwnPropertyDescriptors) {
21971
21971
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
21972
21972
  } else {
21973
- ownKeys$2(Object(source)).forEach(function(key) {
21973
+ ownKeys$3(Object(source)).forEach(function(key) {
21974
21974
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
21975
21975
  });
21976
21976
  }
21977
21977
  return target;
21978
21978
  }
21979
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$e(arr, i) || _non_iterable_rest$c();
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();
21981
21981
  }
21982
- function _unsupported_iterable_to_array$e(o, minLen) {
21982
+ function _unsupported_iterable_to_array$f(o, minLen) {
21983
21983
  if (!o) return;
21984
- if (typeof o === "string") return _array_like_to_array$e(o, minLen);
21984
+ if (typeof o === "string") return _array_like_to_array$f(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$e(o, minLen);
21988
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
21989
21989
  }
21990
21990
  /**
21991
21991
  The default easing curve, identical to d3-transition's default (cubic in-out),
@@ -22043,7 +22043,7 @@
22043
22043
  // collapse()'s opacity:0 fades a node fully in on enter and fully out on exit.
22044
22044
  var opacity = a.opacity === undefined && b.opacity === undefined ? null : lerpNum((_a_opacity = a.opacity) !== null && _a_opacity !== void 0 ? _a_opacity : 1, (_b_opacity = b.opacity) !== null && _b_opacity !== void 0 ? _b_opacity : 1);
22045
22045
  return function(t) {
22046
- return _object_spread$2(_object_spread_props$2(_object_spread$2({}, b), {
22046
+ return _object_spread$3(_object_spread_props$3(_object_spread$3({}, b), {
22047
22047
  fill: fill(t),
22048
22048
  stroke: stroke(t)
22049
22049
  }), fillOpacity ? {
@@ -22065,7 +22065,7 @@
22065
22065
  var scale = lerpNum((_a_scale = a.scale) !== null && _a_scale !== void 0 ? _a_scale : 1, (_b_scale = b.scale) !== null && _b_scale !== void 0 ? _b_scale : 1);
22066
22066
  var rotate = lerpNum((_a_rotate = a.rotate) !== null && _a_rotate !== void 0 ? _a_rotate : 0, (_b_rotate = b.rotate) !== null && _b_rotate !== void 0 ? _b_rotate : 0);
22067
22067
  return function(t) {
22068
- return _object_spread_props$2(_object_spread$2({}, b), {
22068
+ return _object_spread_props$3(_object_spread$3({}, b), {
22069
22069
  x: x(t),
22070
22070
  y: y(t),
22071
22071
  scale: scale(t),
@@ -22087,7 +22087,7 @@
22087
22087
  var hasTransform = Boolean(from.transform || to.transform);
22088
22088
  var transform = hasTransform ? interpTransform(from.transform, to.transform) : null;
22089
22089
  var base = function base(t) {
22090
- return _object_spread$2(_object_spread_props$2(_object_spread$2({}, to), {
22090
+ return _object_spread$3(_object_spread_props$3(_object_spread$3({}, to), {
22091
22091
  paint: paint(t)
22092
22092
  }), transform ? {
22093
22093
  transform: transform(t)
@@ -22100,7 +22100,7 @@
22100
22100
  var x = lerpNum(f.x, to.x), y = lerpNum(f.y, to.y);
22101
22101
  var w = lerpNum(f.width, to.width), h = lerpNum(f.height, to.height);
22102
22102
  return function(t) {
22103
- return _object_spread_props$2(_object_spread$2({}, base(t)), {
22103
+ return _object_spread_props$3(_object_spread$3({}, base(t)), {
22104
22104
  x: x(t),
22105
22105
  y: y(t),
22106
22106
  width: w(t),
@@ -22113,7 +22113,7 @@
22113
22113
  var f1 = from;
22114
22114
  var cx = lerpNum(f1.cx, to.cx), cy = lerpNum(f1.cy, to.cy), r = lerpNum(f1.r, to.r);
22115
22115
  return function(t) {
22116
- return _object_spread_props$2(_object_spread$2({}, base(t)), {
22116
+ return _object_spread_props$3(_object_spread$3({}, base(t)), {
22117
22117
  cx: cx(t),
22118
22118
  cy: cy(t),
22119
22119
  r: r(t)
@@ -22125,7 +22125,7 @@
22125
22125
  var f2 = from;
22126
22126
  var pts = lerpPoints(f2.points, to.points);
22127
22127
  return function(t) {
22128
- return _object_spread_props$2(_object_spread$2({}, base(t)), {
22128
+ return _object_spread_props$3(_object_spread$3({}, base(t)), {
22129
22129
  points: pts(t)
22130
22130
  });
22131
22131
  };
@@ -22136,7 +22136,7 @@
22136
22136
  var top = lerpPoints(f3.topline, to.topline);
22137
22137
  var bot = lerpPoints(f3.baseline, to.baseline);
22138
22138
  return function(t) {
22139
- return _object_spread_props$2(_object_spread$2({}, base(t)), {
22139
+ return _object_spread_props$3(_object_spread$3({}, base(t)), {
22140
22140
  topline: top(t),
22141
22141
  baseline: bot(t)
22142
22142
  });
@@ -22147,7 +22147,7 @@
22147
22147
  var f4 = from;
22148
22148
  var d = interpolatePath(f4.d, to.d);
22149
22149
  return function(t) {
22150
- return _object_spread_props$2(_object_spread$2({}, base(t)), {
22150
+ return _object_spread_props$3(_object_spread$3({}, base(t)), {
22151
22151
  d: d(t)
22152
22152
  });
22153
22153
  };
@@ -22177,8 +22177,8 @@
22177
22177
  var b = base(t);
22178
22178
  var tr = (_ref = (_b_transform = b.transform) !== null && _b_transform !== void 0 ? _b_transform : to.transform) !== null && _ref !== void 0 ? _ref : {};
22179
22179
  var scale = baseScale * si(t);
22180
- return _object_spread_props$2(_object_spread$2({}, b), {
22181
- transform: _object_spread_props$2(_object_spread$2({}, tr), {
22180
+ return _object_spread_props$3(_object_spread$3({}, b), {
22181
+ transform: _object_spread_props$3(_object_spread$3({}, tr), {
22182
22182
  scale: scale,
22183
22183
  x: pxI(t) - scale * nvcx,
22184
22184
  y: pyI(t) - scale * nvcy
@@ -22200,7 +22200,7 @@
22200
22200
  the enter/exit conventions of the SVG Shape classes.
22201
22201
  @param node The node to collapse.
22202
22202
  */ function collapse(node) {
22203
- var paint = _object_spread_props$2(_object_spread$2({}, node.paint), {
22203
+ var paint = _object_spread_props$3(_object_spread$3({}, node.paint), {
22204
22204
  opacity: 0
22205
22205
  });
22206
22206
  switch(node.type){
@@ -22212,18 +22212,18 @@
22212
22212
  // Collapse only the measure dimension and keep the bar's full breadth.
22213
22213
  // Plain rects (Treemap cells, etc.) collapse toward their center.
22214
22214
  if (node.shapeType === "Bar") {
22215
- if (node.y === 0 || node.y + node.height === 0) return _object_spread_props$2(_object_spread$2({}, node), {
22215
+ if (node.y === 0 || node.y + node.height === 0) return _object_spread_props$3(_object_spread$3({}, node), {
22216
22216
  paint: paint,
22217
22217
  y: 0,
22218
22218
  height: 0
22219
22219
  });
22220
- if (node.x === 0 || node.x + node.width === 0) return _object_spread_props$2(_object_spread$2({}, node), {
22220
+ if (node.x === 0 || node.x + node.width === 0) return _object_spread_props$3(_object_spread$3({}, node), {
22221
22221
  paint: paint,
22222
22222
  x: 0,
22223
22223
  width: 0
22224
22224
  });
22225
22225
  }
22226
- return _object_spread_props$2(_object_spread$2({}, node), {
22226
+ return _object_spread_props$3(_object_spread$3({}, node), {
22227
22227
  paint: paint,
22228
22228
  x: node.x + node.width / 2,
22229
22229
  y: node.y + node.height / 2,
@@ -22232,7 +22232,7 @@
22232
22232
  });
22233
22233
  }
22234
22234
  case "circle":
22235
- return _object_spread_props$2(_object_spread$2({}, node), {
22235
+ return _object_spread_props$3(_object_spread$3({}, node), {
22236
22236
  paint: paint,
22237
22237
  r: 0
22238
22238
  });
@@ -22240,26 +22240,26 @@
22240
22240
  // A Sankey link encodes its flow magnitude as stroke-width, so it grows
22241
22241
  // that thickness in on enter (and drains it on exit) from 0, keeping its
22242
22242
  // own opacity — rather than the default opacity fade other paths use.
22243
- if (node.shapeType === "Link") return _object_spread_props$2(_object_spread$2({}, node), {
22244
- paint: _object_spread_props$2(_object_spread$2({}, node.paint), {
22243
+ if (node.shapeType === "Link") return _object_spread_props$3(_object_spread$3({}, node), {
22244
+ paint: _object_spread_props$3(_object_spread$3({}, node.paint), {
22245
22245
  strokeWidth: 0
22246
22246
  })
22247
22247
  });
22248
- return _object_spread_props$2(_object_spread$2({}, node), {
22248
+ return _object_spread_props$3(_object_spread$3({}, node), {
22249
22249
  paint: paint
22250
22250
  });
22251
22251
  case "group":
22252
- return _object_spread_props$2(_object_spread$2({}, node), {
22252
+ return _object_spread_props$3(_object_spread$3({}, node), {
22253
22253
  paint: paint
22254
22254
  });
22255
22255
  default:
22256
- return _object_spread_props$2(_object_spread$2({}, node), {
22256
+ return _object_spread_props$3(_object_spread$3({}, node), {
22257
22257
  paint: paint
22258
22258
  });
22259
22259
  }
22260
22260
  }
22261
22261
 
22262
- function _array_like_to_array$d(arr, len) {
22262
+ function _array_like_to_array$e(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;
@@ -22267,10 +22267,10 @@
22267
22267
  function _array_with_holes$b(arr) {
22268
22268
  if (Array.isArray(arr)) return arr;
22269
22269
  }
22270
- function _array_without_holes$5(arr) {
22271
- if (Array.isArray(arr)) return _array_like_to_array$d(arr);
22270
+ function _array_without_holes$6(arr) {
22271
+ if (Array.isArray(arr)) return _array_like_to_array$e(arr);
22272
22272
  }
22273
- function _iterable_to_array$5(iter) {
22273
+ function _iterable_to_array$6(iter) {
22274
22274
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
22275
22275
  }
22276
22276
  function _iterable_to_array_limit$b(arr, i) {
@@ -22300,22 +22300,22 @@
22300
22300
  function _non_iterable_rest$b() {
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$5() {
22303
+ function _non_iterable_spread$6() {
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
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$d(arr, i) || _non_iterable_rest$b();
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();
22308
22308
  }
22309
- function _to_consumable_array$5(arr) {
22310
- return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$d(arr) || _non_iterable_spread$5();
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();
22311
22311
  }
22312
- function _unsupported_iterable_to_array$d(o, minLen) {
22312
+ function _unsupported_iterable_to_array$e(o, minLen) {
22313
22313
  if (!o) return;
22314
- if (typeof o === "string") return _array_like_to_array$d(o, minLen);
22314
+ if (typeof o === "string") return _array_like_to_array$e(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$d(o, minLen);
22318
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(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$5(xs)), maxX = (_Math1 = Math).max.apply(_Math1, _to_consumable_array$5(xs));
22364
- var minY = (_Math2 = Math).min.apply(_Math2, _to_consumable_array$5(ys)), maxY = (_Math3 = Math).max.apply(_Math3, _to_consumable_array$5(ys));
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));
22365
22365
  return {
22366
22366
  x: minX,
22367
22367
  y: minY,
@@ -22491,7 +22491,7 @@
22491
22491
  ])
22492
22492
  };
22493
22493
  }
22494
- return pathBox(convexHull(_to_consumable_array$5(rectCorners(A[0], A[1], aDims[0], aDims[1], rotate)).concat(_to_consumable_array$5(rectCorners(hx, hy, hDims[0], hDims[1], rotate)))));
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)))));
22495
22495
  }
22496
22496
  /**
22497
22497
  The trail's fill: a gradient (objectBoundingBox units) along the travel
@@ -22583,13 +22583,13 @@
22583
22583
  };
22584
22584
  }
22585
22585
 
22586
- function _array_like_to_array$c(arr, len) {
22586
+ function _array_like_to_array$d(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$4(arr) {
22592
- if (Array.isArray(arr)) return _array_like_to_array$c(arr);
22591
+ function _array_without_holes$5(arr) {
22592
+ if (Array.isArray(arr)) return _array_like_to_array$d(arr);
22593
22593
  }
22594
22594
  function _class_call_check$3(instance, Constructor) {
22595
22595
  if (!(instance instanceof Constructor)) {
@@ -22609,7 +22609,7 @@
22609
22609
  if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
22610
22610
  return Constructor;
22611
22611
  }
22612
- function _define_property$4(obj, key, value) {
22612
+ function _define_property$5(obj, key, value) {
22613
22613
  if (key in obj) {
22614
22614
  Object.defineProperty(obj, key, {
22615
22615
  value: value,
@@ -22622,13 +22622,13 @@
22622
22622
  }
22623
22623
  return obj;
22624
22624
  }
22625
- function _iterable_to_array$4(iter) {
22625
+ function _iterable_to_array$5(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$4() {
22628
+ function _non_iterable_spread$5() {
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
- function _object_spread$1(target) {
22631
+ function _object_spread$2(target) {
22632
22632
  for(var i = 1; i < arguments.length; i++){
22633
22633
  var source = arguments[i] != null ? arguments[i] : {};
22634
22634
  var ownKeys = Object.keys(source);
@@ -22638,12 +22638,12 @@
22638
22638
  }));
22639
22639
  }
22640
22640
  ownKeys.forEach(function(key) {
22641
- _define_property$4(target, key, source[key]);
22641
+ _define_property$5(target, key, source[key]);
22642
22642
  });
22643
22643
  }
22644
22644
  return target;
22645
22645
  }
22646
- function ownKeys$1(object, enumerableOnly) {
22646
+ function ownKeys$2(object, enumerableOnly) {
22647
22647
  var keys = Object.keys(object);
22648
22648
  if (Object.getOwnPropertySymbols) {
22649
22649
  var symbols = Object.getOwnPropertySymbols(object);
@@ -22651,32 +22651,32 @@
22651
22651
  }
22652
22652
  return keys;
22653
22653
  }
22654
- function _object_spread_props$1(target, source) {
22654
+ function _object_spread_props$2(target, source) {
22655
22655
  source = source != null ? source : {};
22656
22656
  if (Object.getOwnPropertyDescriptors) {
22657
22657
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
22658
22658
  } else {
22659
- ownKeys$1(Object(source)).forEach(function(key) {
22659
+ ownKeys$2(Object(source)).forEach(function(key) {
22660
22660
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
22661
22661
  });
22662
22662
  }
22663
22663
  return target;
22664
22664
  }
22665
- function _to_consumable_array$4(arr) {
22666
- return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$c(arr) || _non_iterable_spread$4();
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();
22667
22667
  }
22668
- function _unsupported_iterable_to_array$c(o, minLen) {
22668
+ function _unsupported_iterable_to_array$d(o, minLen) {
22669
22669
  if (!o) return;
22670
- if (typeof o === "string") return _array_like_to_array$c(o, minLen);
22670
+ if (typeof o === "string") return _array_like_to_array$d(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$c(o, minLen);
22674
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
22675
22675
  }
22676
22676
  var TrailLog = /*#__PURE__*/ function() {
22677
22677
  function TrailLog() {
22678
22678
  _class_call_check$3(this, TrailLog);
22679
- _define_property$4(this, "map", new Map());
22679
+ _define_property$5(this, "map", new Map());
22680
22680
  }
22681
22681
  _create_class$3(TrailLog, [
22682
22682
  {
@@ -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$4(e.committed).concat([
22753
+ var all = forwardInFlight ? _to_consumable_array$5(e.committed).concat([
22754
22754
  forwardInFlight
22755
22755
  ]) : e.committed;
22756
22756
  e.committed = [];
@@ -22779,7 +22779,7 @@
22779
22779
  }
22780
22780
  }
22781
22781
  if (spanning) {
22782
- e.committed.push(_object_spread_props$1(_object_spread$1({}, spanning), {
22782
+ e.committed.push(_object_spread_props$2(_object_spread$2({}, spanning), {
22783
22783
  B: pos,
22784
22784
  bDims: dims,
22785
22785
  seq: seq
@@ -23051,7 +23051,7 @@
23051
23051
  var _step_value1 = _step1.value, key = _step_value1.key, x = _step_value1.x, y = _step_value1.y;
23052
23052
  var node = byKey.get(key);
23053
23053
  var base = node && trailPartsFromNode(node);
23054
- if (base) log.commit(key, _object_spread_props$1(_object_spread$1({}, base), {
23054
+ if (base) log.commit(key, _object_spread_props$2(_object_spread$2({}, base), {
23055
23055
  x: x,
23056
23056
  y: y
23057
23057
  }), node.trailPersist, sequence);
@@ -25100,7 +25100,7 @@
25100
25100
  }))) !== null && _gen !== void 0 ? _gen : "";
25101
25101
  }
25102
25102
 
25103
- function _array_like_to_array$b(arr, len) {
25103
+ function _array_like_to_array$c(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;
@@ -25136,15 +25136,15 @@
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
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$b(arr, i) || _non_iterable_rest$a();
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();
25140
25140
  }
25141
- function _unsupported_iterable_to_array$b(o, minLen) {
25141
+ function _unsupported_iterable_to_array$c(o, minLen) {
25142
25142
  if (!o) return;
25143
- if (typeof o === "string") return _array_like_to_array$b(o, minLen);
25143
+ if (typeof o === "string") return _array_like_to_array$c(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$b(o, minLen);
25147
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(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";
@@ -25369,7 +25369,7 @@
25369
25369
  if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
25370
25370
  return Constructor;
25371
25371
  }
25372
- function _define_property$3(obj, key, value) {
25372
+ function _define_property$4(obj, key, value) {
25373
25373
  if (key in obj) {
25374
25374
  Object.defineProperty(obj, key, {
25375
25375
  value: value,
@@ -25493,10 +25493,10 @@
25493
25493
  */ var TrailGradients = /*#__PURE__*/ function() {
25494
25494
  function TrailGradients(defs, uid) {
25495
25495
  _class_call_check$2(this, TrailGradients);
25496
- _define_property$3(this, "defs", void 0);
25497
- _define_property$3(this, "uid", void 0);
25498
- _define_property$3(this, "map", void 0);
25499
- _define_property$3(this, "seq", void 0);
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);
25500
25500
  this.defs = defs;
25501
25501
  this.uid = uid;
25502
25502
  this.map = new Map();
@@ -25866,7 +25866,7 @@
25866
25866
  }
25867
25867
  }
25868
25868
 
25869
- function _array_like_to_array$a(arr, len) {
25869
+ function _array_like_to_array$b(arr, len) {
25870
25870
  if (len == null || len > arr.length) len = arr.length;
25871
25871
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
25872
25872
  return arr2;
@@ -25874,8 +25874,8 @@
25874
25874
  function _array_with_holes$9(arr) {
25875
25875
  if (Array.isArray(arr)) return arr;
25876
25876
  }
25877
- function _array_without_holes$3(arr) {
25878
- if (Array.isArray(arr)) return _array_like_to_array$a(arr);
25877
+ function _array_without_holes$4(arr) {
25878
+ if (Array.isArray(arr)) return _array_like_to_array$b(arr);
25879
25879
  }
25880
25880
  function _class_call_check$1(instance, Constructor) {
25881
25881
  if (!(instance instanceof Constructor)) {
@@ -25895,7 +25895,7 @@
25895
25895
  if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
25896
25896
  return Constructor;
25897
25897
  }
25898
- function _define_property$2(obj, key, value) {
25898
+ function _define_property$3(obj, key, value) {
25899
25899
  if (key in obj) {
25900
25900
  Object.defineProperty(obj, key, {
25901
25901
  value: value,
@@ -25908,7 +25908,7 @@
25908
25908
  }
25909
25909
  return obj;
25910
25910
  }
25911
- function _iterable_to_array$3(iter) {
25911
+ function _iterable_to_array$4(iter) {
25912
25912
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
25913
25913
  }
25914
25914
  function _iterable_to_array_limit$9(arr, i) {
@@ -25938,22 +25938,22 @@
25938
25938
  function _non_iterable_rest$9() {
25939
25939
  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
25940
  }
25941
- function _non_iterable_spread$3() {
25941
+ function _non_iterable_spread$4() {
25942
25942
  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
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$a(arr, i) || _non_iterable_rest$9();
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();
25946
25946
  }
25947
- function _to_consumable_array$3(arr) {
25948
- return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$3();
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();
25949
25949
  }
25950
- function _unsupported_iterable_to_array$a(o, minLen) {
25950
+ function _unsupported_iterable_to_array$b(o, minLen) {
25951
25951
  if (!o) return;
25952
- if (typeof o === "string") return _array_like_to_array$a(o, minLen);
25952
+ if (typeof o === "string") return _array_like_to_array$b(o, minLen);
25953
25953
  var n = Object.prototype.toString.call(o).slice(8, -1);
25954
25954
  if (n === "Object" && o.constructor) n = o.constructor.name;
25955
25955
  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$a(o, minLen);
25956
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
25957
25957
  }
25958
25958
  /**
25959
25959
  A Renderer backend that realizes a Scene as SVG, using a keyed enter/update/exit
@@ -25972,36 +25972,36 @@
25972
25972
  function SvgRenderer() {
25973
25973
  var _this = this;
25974
25974
  _class_call_check$1(this, SvgRenderer);
25975
- _define_property$2(this, "kind", "svg");
25976
- /** Unique per-instance prefix for this renderer's document-scoped def ids. */ _define_property$2(this, "_uid", ++rendererInstanceSeq);
25977
- _define_property$2(this, "_target", void 0);
25978
- _define_property$2(this, "_svg", void 0);
25979
- _define_property$2(this, "_root", void 0);
25980
- /** Per-mark position history for persistent motion trails. */ _define_property$2(this, "_trailLog", new TrailLog());
25981
- /** Whether persistent trails are active this draw (single-period timeline). */ _define_property$2(this, "_trailActive", false);
25982
- /** Lazy <defs> for clipPaths / patterns. Created on first use. */ _define_property$2(this, "_defs", void 0);
25983
- /** Stable id counter so each GroupNode clip gets a unique <clipPath>. */ _define_property$2(this, "_clipIds", new Map());
25984
- _define_property$2(this, "_clipSeq", 0);
25985
- /** Sibling host for HtmlOverlayNode mounts. Positioned absolutely over the svg. */ _define_property$2(this, "_overlayHost", void 0);
25986
- _define_property$2(this, "_scene", void 0);
25987
- _define_property$2(this, "_index", new Map());
25988
- _define_property$2(this, "_textureDefs", new Map());
25989
- /** Cache of `gradient:<json>` token → `url(#id)`, materialized in <defs>. */ _define_property$2(this, "_gradientDefs", new Map());
25990
- _define_property$2(this, "_gradientSeq", 0);
25991
- /** Reused per-mark userSpaceOnUse gradients for persistent trails. */ _define_property$2(this, "_trailGrads", new TrailGradients(function() {
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() {
25992
25992
  return _this._ensureDefs();
25993
25993
  }, function() {
25994
25994
  return _this._uid;
25995
25995
  }));
25996
- _define_property$2(this, "_handlers", new Set());
25997
- _define_property$2(this, "_domListeners", {});
25998
- _define_property$2(this, "_listening", false);
25999
- _define_property$2(this, "_hoverKey", null);
26000
- _define_property$2(this, "_timers", new Set());
26001
- _define_property$2(this, "_invalidatePointerRect", null);
26002
- _define_property$2(this, "_removePointerRectListeners", null);
26003
- /** Cancel handle for the latest drawScene transition; flipped on overlap. */ _define_property$2(this, "_cancelDraw", null);
26004
- /** Marks `_index` as needing a rebuild before the next external read. */ _define_property$2(this, "_indexDirty", true);
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
26005
  }
26006
26006
  _create_class$1(SvgRenderer, [
26007
26007
  {
@@ -26194,7 +26194,7 @@
26194
26194
  if (k in t) {
26195
26195
  var _t;
26196
26196
  var v = config[k];
26197
- if (Array.isArray(v)) (_t = t)[k].apply(_t, _to_consumable_array$3(v));
26197
+ if (Array.isArray(v)) (_t = t)[k].apply(_t, _to_consumable_array$4(v));
26198
26198
  else t[k](v);
26199
26199
  }
26200
26200
  }
@@ -26232,7 +26232,7 @@
26232
26232
  break;
26233
26233
  }
26234
26234
  }
26235
- var ordered = needsSort ? _to_consumable_array$3(svgChildren).sort(function(a, b) {
26235
+ var ordered = needsSort ? _to_consumable_array$4(svgChildren).sort(function(a, b) {
26236
26236
  var _a_z, _b_z;
26237
26237
  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
26238
  }) : svgChildren;
@@ -26697,7 +26697,7 @@
26697
26697
  return SvgRenderer;
26698
26698
  }();
26699
26699
 
26700
- function _array_like_to_array$9(arr, len) {
26700
+ function _array_like_to_array$a(arr, len) {
26701
26701
  if (len == null || len > arr.length) len = arr.length;
26702
26702
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
26703
26703
  return arr2;
@@ -26705,7 +26705,7 @@
26705
26705
  function _array_with_holes$8(arr) {
26706
26706
  if (Array.isArray(arr)) return arr;
26707
26707
  }
26708
- function _define_property$1(obj, key, value) {
26708
+ function _define_property$2(obj, key, value) {
26709
26709
  if (key in obj) {
26710
26710
  Object.defineProperty(obj, key, {
26711
26711
  value: value,
@@ -26745,7 +26745,7 @@
26745
26745
  function _non_iterable_rest$8() {
26746
26746
  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
26747
  }
26748
- function _object_spread(target) {
26748
+ function _object_spread$1(target) {
26749
26749
  for(var i = 1; i < arguments.length; i++){
26750
26750
  var source = arguments[i] != null ? arguments[i] : {};
26751
26751
  var ownKeys = Object.keys(source);
@@ -26755,12 +26755,12 @@
26755
26755
  }));
26756
26756
  }
26757
26757
  ownKeys.forEach(function(key) {
26758
- _define_property$1(target, key, source[key]);
26758
+ _define_property$2(target, key, source[key]);
26759
26759
  });
26760
26760
  }
26761
26761
  return target;
26762
26762
  }
26763
- function ownKeys(object, enumerableOnly) {
26763
+ function ownKeys$1(object, enumerableOnly) {
26764
26764
  var keys = Object.keys(object);
26765
26765
  if (Object.getOwnPropertySymbols) {
26766
26766
  var symbols = Object.getOwnPropertySymbols(object);
@@ -26768,27 +26768,27 @@
26768
26768
  }
26769
26769
  return keys;
26770
26770
  }
26771
- function _object_spread_props(target, source) {
26771
+ function _object_spread_props$1(target, source) {
26772
26772
  source = source != null ? source : {};
26773
26773
  if (Object.getOwnPropertyDescriptors) {
26774
26774
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
26775
26775
  } else {
26776
- ownKeys(Object(source)).forEach(function(key) {
26776
+ ownKeys$1(Object(source)).forEach(function(key) {
26777
26777
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
26778
26778
  });
26779
26779
  }
26780
26780
  return target;
26781
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$9(arr, i) || _non_iterable_rest$8();
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();
26784
26784
  }
26785
- function _unsupported_iterable_to_array$9(o, minLen) {
26785
+ function _unsupported_iterable_to_array$a(o, minLen) {
26786
26786
  if (!o) return;
26787
- if (typeof o === "string") return _array_like_to_array$9(o, minLen);
26787
+ if (typeof o === "string") return _array_like_to_array$a(o, minLen);
26788
26788
  var n = Object.prototype.toString.call(o).slice(8, -1);
26789
26789
  if (n === "Object" && o.constructor) n = o.constructor.name;
26790
26790
  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$9(o, minLen);
26791
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
26792
26792
  }
26793
26793
  /**
26794
26794
  Reads a motion-trail spec off a moving update-pair of trailed mark nodes,
@@ -26877,7 +26877,7 @@
26877
26877
  var _diffChildren = diffChildren(prev, next), enter = _diffChildren.enter, update = _diffChildren.update, exit = _diffChildren.exit;
26878
26878
  var wrapGroup = function wrapGroup(nodeInterp, childInterp) {
26879
26879
  return function(t) {
26880
- return _object_spread_props(_object_spread({}, nodeInterp(t)), {
26880
+ return _object_spread_props$1(_object_spread$1({}, nodeInterp(t)), {
26881
26881
  children: childInterp(t)
26882
26882
  });
26883
26883
  };
@@ -27037,15 +27037,15 @@
27037
27037
  */ function interpolateScene(prev, next, log) {
27038
27038
  var rootInterp = interpolateChildren(prev ? prev.root.children : [], next.root.children, log);
27039
27039
  return function(t) {
27040
- return _object_spread_props(_object_spread({}, next), {
27041
- root: _object_spread_props(_object_spread({}, next.root), {
27040
+ return _object_spread_props$1(_object_spread$1({}, next), {
27041
+ root: _object_spread_props$1(_object_spread$1({}, next.root), {
27042
27042
  children: rootInterp(t)
27043
27043
  })
27044
27044
  });
27045
27045
  };
27046
27046
  }
27047
27047
 
27048
- function _array_like_to_array$8(arr, len) {
27048
+ function _array_like_to_array$9(arr, len) {
27049
27049
  if (len == null || len > arr.length) len = arr.length;
27050
27050
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
27051
27051
  return arr2;
@@ -27081,15 +27081,15 @@
27081
27081
  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
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$8(arr, i) || _non_iterable_rest$7();
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();
27085
27085
  }
27086
- function _unsupported_iterable_to_array$8(o, minLen) {
27086
+ function _unsupported_iterable_to_array$9(o, minLen) {
27087
27087
  if (!o) return;
27088
- if (typeof o === "string") return _array_like_to_array$8(o, minLen);
27088
+ if (typeof o === "string") return _array_like_to_array$9(o, minLen);
27089
27089
  var n = Object.prototype.toString.call(o).slice(8, -1);
27090
27090
  if (n === "Object" && o.constructor) n = o.constructor.name;
27091
27091
  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$8(o, minLen);
27092
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
27093
27093
  }
27094
27094
  var identity$7 = [
27095
27095
  1,
@@ -27381,30 +27381,30 @@
27381
27381
  }
27382
27382
  }
27383
27383
 
27384
- function _array_like_to_array$7(arr, len) {
27384
+ function _array_like_to_array$8(arr, len) {
27385
27385
  if (len == null || len > arr.length) len = arr.length;
27386
27386
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
27387
27387
  return arr2;
27388
27388
  }
27389
- function _array_without_holes$2(arr) {
27390
- if (Array.isArray(arr)) return _array_like_to_array$7(arr);
27389
+ function _array_without_holes$3(arr) {
27390
+ if (Array.isArray(arr)) return _array_like_to_array$8(arr);
27391
27391
  }
27392
- function _iterable_to_array$2(iter) {
27392
+ function _iterable_to_array$3(iter) {
27393
27393
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
27394
27394
  }
27395
- function _non_iterable_spread$2() {
27395
+ function _non_iterable_spread$3() {
27396
27396
  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
27397
  }
27398
- function _to_consumable_array$2(arr) {
27399
- return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$2();
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();
27400
27400
  }
27401
- function _unsupported_iterable_to_array$7(o, minLen) {
27401
+ function _unsupported_iterable_to_array$8(o, minLen) {
27402
27402
  if (!o) return;
27403
- if (typeof o === "string") return _array_like_to_array$7(o, minLen);
27403
+ if (typeof o === "string") return _array_like_to_array$8(o, minLen);
27404
27404
  var n = Object.prototype.toString.call(o).slice(8, -1);
27405
27405
  if (n === "Object" && o.constructor) n = o.constructor.name;
27406
27406
  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$7(o, minLen);
27407
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
27408
27408
  }
27409
27409
  var SVG_NS = "http://www.w3.org/2000/svg";
27410
27410
  /**
@@ -27442,7 +27442,7 @@
27442
27442
  if (k in t) {
27443
27443
  var _t;
27444
27444
  var v = config[k];
27445
- if (Array.isArray(v)) (_t = t)[k].apply(_t, _to_consumable_array$2(v));
27445
+ if (Array.isArray(v)) (_t = t)[k].apply(_t, _to_consumable_array$3(v));
27446
27446
  else t[k](v);
27447
27447
  }
27448
27448
  }
@@ -27469,7 +27469,7 @@
27469
27469
  };
27470
27470
  }
27471
27471
 
27472
- function _array_like_to_array$6(arr, len) {
27472
+ function _array_like_to_array$7(arr, len) {
27473
27473
  if (len == null || len > arr.length) len = arr.length;
27474
27474
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
27475
27475
  return arr2;
@@ -27477,8 +27477,8 @@
27477
27477
  function _array_with_holes$6(arr) {
27478
27478
  if (Array.isArray(arr)) return arr;
27479
27479
  }
27480
- function _array_without_holes$1(arr) {
27481
- if (Array.isArray(arr)) return _array_like_to_array$6(arr);
27480
+ function _array_without_holes$2(arr) {
27481
+ if (Array.isArray(arr)) return _array_like_to_array$7(arr);
27482
27482
  }
27483
27483
  function _class_call_check(instance, Constructor) {
27484
27484
  if (!(instance instanceof Constructor)) {
@@ -27498,7 +27498,7 @@
27498
27498
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
27499
27499
  return Constructor;
27500
27500
  }
27501
- function _define_property(obj, key, value) {
27501
+ function _define_property$1(obj, key, value) {
27502
27502
  if (key in obj) {
27503
27503
  Object.defineProperty(obj, key, {
27504
27504
  value: value,
@@ -27511,7 +27511,7 @@
27511
27511
  }
27512
27512
  return obj;
27513
27513
  }
27514
- function _iterable_to_array$1(iter) {
27514
+ function _iterable_to_array$2(iter) {
27515
27515
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
27516
27516
  }
27517
27517
  function _iterable_to_array_limit$6(arr, i) {
@@ -27541,22 +27541,22 @@
27541
27541
  function _non_iterable_rest$6() {
27542
27542
  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
27543
  }
27544
- function _non_iterable_spread$1() {
27544
+ function _non_iterable_spread$2() {
27545
27545
  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
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$6(arr, i) || _non_iterable_rest$6();
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();
27549
27549
  }
27550
- function _to_consumable_array$1(arr) {
27551
- return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$1();
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();
27552
27552
  }
27553
- function _unsupported_iterable_to_array$6(o, minLen) {
27553
+ function _unsupported_iterable_to_array$7(o, minLen) {
27554
27554
  if (!o) return;
27555
- if (typeof o === "string") return _array_like_to_array$6(o, minLen);
27555
+ if (typeof o === "string") return _array_like_to_array$7(o, minLen);
27556
27556
  var n = Object.prototype.toString.call(o).slice(8, -1);
27557
27557
  if (n === "Object" && o.constructor) n = o.constructor.name;
27558
27558
  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$6(o, minLen);
27559
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
27560
27560
  }
27561
27561
  var raf = typeof requestAnimationFrame === "function" ? function(cb) {
27562
27562
  return requestAnimationFrame(function() {
@@ -27574,44 +27574,44 @@
27574
27574
  function CanvasRenderer() {
27575
27575
  var _this = this;
27576
27576
  _class_call_check(this, CanvasRenderer);
27577
- _define_property(this, "kind", "canvas");
27578
- _define_property(this, "_target", void 0);
27579
- _define_property(this, "_canvas", void 0);
27580
- _define_property(this, "_ctx", void 0);
27581
- /** Sibling host for HtmlOverlayNode mounts (same approach as SvgRenderer). */ _define_property(this, "_overlayHost", void 0);
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);
27582
27582
  /**
27583
27583
  * Cached key→element map for HtmlOverlay reconcile. Mutated as overlays
27584
27584
  * enter/exit so the hot path (every draw, including 60Hz zoom ticks)
27585
27585
  * doesn't pay for `host.querySelectorAll(':scope > .d3plus-render-overlay')`.
27586
- */ _define_property(this, "_overlayMap", new Map());
27587
- _define_property(this, "_ratio", 1);
27588
- _define_property(this, "_width", 0);
27589
- _define_property(this, "_height", 0);
27590
- _define_property(this, "_scene", null);
27591
- /** Per-mark position history for persistent motion trails. */ _define_property(this, "_trailLog", new TrailLog());
27592
- _define_property(this, "_pickIndex", []);
27593
- _define_property(this, "_images", new Map());
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());
27594
27594
  // Token → tiled CanvasPattern (rasterized from the texture's SVG tile), plus
27595
27595
  // the set of tokens whose rasterization is in flight. `_patternResolver` is a
27596
27596
  // pre-bound view passed into the paint path so no closure is allocated per
27597
27597
  // node per frame.
27598
- _define_property(this, "_patterns", new Map());
27599
- _define_property(this, "_patternsPending", new Set());
27600
- _define_property(this, "_patternResolver", function(token) {
27598
+ _define_property$1(this, "_patterns", new Map());
27599
+ _define_property$1(this, "_patternsPending", new Set());
27600
+ _define_property$1(this, "_patternResolver", function(token) {
27601
27601
  return _this._resolvePattern(token);
27602
27602
  });
27603
- _define_property(this, "_handlers", new Set());
27604
- _define_property(this, "_domListeners", {});
27605
- _define_property(this, "_listening", false);
27606
- _define_property(this, "_hoverKey", null);
27607
- _define_property(this, "_frame", 0);
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);
27608
27608
  /**
27609
27609
  * `_cancelAnim(soft?)` — call with `soft=true` to stop the tick loop
27610
27610
  * without snap-painting the target scene; `false`/omitted snaps + paints
27611
27611
  * (so external `handle.cancel()` matches what resize/toSVGString see).
27612
- */ _define_property(this, "_cancelAnim", null);
27613
- _define_property(this, "_invalidatePointerRect", null);
27614
- _define_property(this, "_removePointerRectListeners", null);
27612
+ */ _define_property$1(this, "_cancelAnim", null);
27613
+ _define_property$1(this, "_invalidatePointerRect", null);
27614
+ _define_property$1(this, "_removePointerRectListeners", null);
27615
27615
  }
27616
27616
  _create_class(CanvasRenderer, [
27617
27617
  {
@@ -27779,7 +27779,7 @@
27779
27779
  break;
27780
27780
  }
27781
27781
  }
27782
- var ordered = needsSort ? _to_consumable_array$1(children).sort(function(a, b) {
27782
+ var ordered = needsSort ? _to_consumable_array$2(children).sort(function(a, b) {
27783
27783
  var _a_z, _b_z;
27784
27784
  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
27785
  }) : children;
@@ -28504,7 +28504,7 @@
28504
28504
  "top",
28505
28505
  "bottom"
28506
28506
  ].includes(position);
28507
- const padding = viz.schema.legendPadding() ? viz._padding : {
28507
+ const padding = viz.schema.legendPadding(viz) ? viz._padding : {
28508
28508
  top: 0,
28509
28509
  right: 0,
28510
28510
  bottom: 0,
@@ -28674,7 +28674,7 @@
28674
28674
  panel: null,
28675
28675
  margin: {}
28676
28676
  };
28677
- const usesPadding = viz.schema[opts.paddingMethod]();
28677
+ const usesPadding = viz.schema[opts.paddingMethod](viz);
28678
28678
  const padding = usesPadding ? viz._padding : {
28679
28679
  right: 0,
28680
28680
  left: 0
@@ -28870,7 +28870,7 @@
28870
28870
  let timelinePossible = viz.schema.time && viz.schema.timeline;
28871
28871
  const ticks = timelinePossible ? unique(viz._data.map(viz.schema.time)).map((d)=>date$2(d)) : [];
28872
28872
  timelinePossible = timelinePossible && ticks.length > 1;
28873
- const padding = viz.schema.timelinePadding() ? viz._padding : {
28873
+ const padding = viz.schema.timelinePadding(viz) ? viz._padding : {
28874
28874
  right: 0,
28875
28875
  left: 0
28876
28876
  };
@@ -28953,7 +28953,7 @@
28953
28953
  "bottom"
28954
28954
  ].includes(position);
28955
28955
  const showColorScale = viz.schema.colorScale && position;
28956
- const padding = viz.schema.colorScalePadding() ? viz._padding : {
28956
+ const padding = viz.schema.colorScalePadding(viz) ? viz._padding : {
28957
28957
  top: 0,
28958
28958
  right: 0,
28959
28959
  bottom: 0,
@@ -34827,7 +34827,7 @@
34827
34827
 
34828
34828
  var hyphenatedExports = requireHyphenated();
34829
34829
 
34830
- function _array_like_to_array$5(arr, len) {
34830
+ function _array_like_to_array$6(arr, len) {
34831
34831
  if (len == null || len > arr.length) len = arr.length;
34832
34832
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
34833
34833
  return arr2;
@@ -34835,10 +34835,10 @@
34835
34835
  function _array_with_holes$5(arr) {
34836
34836
  if (Array.isArray(arr)) return arr;
34837
34837
  }
34838
- function _array_without_holes(arr) {
34839
- if (Array.isArray(arr)) return _array_like_to_array$5(arr);
34838
+ function _array_without_holes$1(arr) {
34839
+ if (Array.isArray(arr)) return _array_like_to_array$6(arr);
34840
34840
  }
34841
- function _iterable_to_array(iter) {
34841
+ function _iterable_to_array$1(iter) {
34842
34842
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
34843
34843
  }
34844
34844
  function _iterable_to_array_limit$5(arr, i) {
@@ -34868,22 +34868,22 @@
34868
34868
  function _non_iterable_rest$5() {
34869
34869
  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
34870
  }
34871
- function _non_iterable_spread() {
34871
+ function _non_iterable_spread$1() {
34872
34872
  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
34873
  }
34874
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$5(arr, i) || _non_iterable_rest$5();
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();
34876
34876
  }
34877
- function _to_consumable_array(arr) {
34878
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread();
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();
34879
34879
  }
34880
- function _unsupported_iterable_to_array$5(o, minLen) {
34880
+ function _unsupported_iterable_to_array$6(o, minLen) {
34881
34881
  if (!o) return;
34882
- if (typeof o === "string") return _array_like_to_array$5(o, minLen);
34882
+ if (typeof o === "string") return _array_like_to_array$6(o, minLen);
34883
34883
  var n = Object.prototype.toString.call(o).slice(8, -1);
34884
34884
  if (n === "Object" && o.constructor) n = o.constructor.name;
34885
34885
  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$5(o, minLen);
34886
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
34887
34887
  }
34888
34888
  var cjkRange = /[\u3000-\u9FFF\uF900-\uFAFF]/;
34889
34889
  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");
@@ -34950,7 +34950,7 @@
34950
34950
  var word = _step.value;
34951
34951
  var _result;
34952
34952
  var syllables = hyphenate(word);
34953
- (_result = result).push.apply(_result, _to_consumable_array(syllables));
34953
+ (_result = result).push.apply(_result, _to_consumable_array$1(syllables));
34954
34954
  }
34955
34955
  } catch (err) {
34956
34956
  _didIteratorError = true;
@@ -34969,6 +34969,27 @@
34969
34969
  return result;
34970
34970
  }
34971
34971
 
34972
+ function _array_like_to_array$5(arr, len) {
34973
+ if (len == null || len > arr.length) len = arr.length;
34974
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
34975
+ return arr2;
34976
+ }
34977
+ function _array_without_holes(arr) {
34978
+ if (Array.isArray(arr)) return _array_like_to_array$5(arr);
34979
+ }
34980
+ function _define_property(obj, key, value) {
34981
+ if (key in obj) {
34982
+ Object.defineProperty(obj, key, {
34983
+ value: value,
34984
+ enumerable: true,
34985
+ configurable: true,
34986
+ writable: true
34987
+ });
34988
+ } else {
34989
+ obj[key] = value;
34990
+ }
34991
+ return obj;
34992
+ }
34972
34993
  function _instanceof$2(left, right) {
34973
34994
  "@swc/helpers - instanceof";
34974
34995
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
@@ -34977,6 +34998,61 @@
34977
34998
  return left instanceof right;
34978
34999
  }
34979
35000
  }
35001
+ function _iterable_to_array(iter) {
35002
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
35003
+ }
35004
+ function _non_iterable_spread() {
35005
+ 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
+ }
35007
+ function _object_spread(target) {
35008
+ for(var i = 1; i < arguments.length; i++){
35009
+ var source = arguments[i] != null ? arguments[i] : {};
35010
+ var ownKeys = Object.keys(source);
35011
+ if (typeof Object.getOwnPropertySymbols === "function") {
35012
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
35013
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
35014
+ }));
35015
+ }
35016
+ ownKeys.forEach(function(key) {
35017
+ _define_property(target, key, source[key]);
35018
+ });
35019
+ }
35020
+ return target;
35021
+ }
35022
+ function ownKeys(object, enumerableOnly) {
35023
+ var keys = Object.keys(object);
35024
+ if (Object.getOwnPropertySymbols) {
35025
+ var symbols = Object.getOwnPropertySymbols(object);
35026
+ keys.push.apply(keys, symbols);
35027
+ }
35028
+ return keys;
35029
+ }
35030
+ function _object_spread_props(target, source) {
35031
+ source = source != null ? source : {};
35032
+ if (Object.getOwnPropertyDescriptors) {
35033
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
35034
+ } else {
35035
+ ownKeys(Object(source)).forEach(function(key) {
35036
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
35037
+ });
35038
+ }
35039
+ return target;
35040
+ }
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();
35043
+ }
35044
+ function _type_of$1(obj) {
35045
+ "@swc/helpers - typeof";
35046
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
35047
+ }
35048
+ function _unsupported_iterable_to_array$5(o, minLen) {
35049
+ if (!o) return;
35050
+ if (typeof o === "string") return _array_like_to_array$5(o, minLen);
35051
+ var n = Object.prototype.toString.call(o).slice(8, -1);
35052
+ if (n === "Object" && o.constructor) n = o.constructor.name;
35053
+ 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);
35055
+ }
34980
35056
  var softHyphen = "\u00AD";
34981
35057
  /**
34982
35058
  Coerces value into a String.
@@ -34988,46 +35064,54 @@
34988
35064
  return JSON.stringify(value);
34989
35065
  }
34990
35066
  /**
34991
- Breaks a single sentence into wrapped lines using the resolved style config.
35067
+ Runs the word-flow loop once. `lineWidth(line)` receives the 1-based line
35068
+ number and returns the width allowed for that line, so callers can vary the
35069
+ available width per line — a constant for a rectangle, or the circle's chord
35070
+ at that line's height for a circle.
34992
35071
  @private
34993
- */ function wrapSentence(phrase, config) {
34994
- var fontFamily = config.fontFamily, fontSize = config.fontSize, fontWeight = config.fontWeight, height = config.height, lineHeight = config.lineHeight, maxLines = config.maxLines, overflow = config.overflow, split = config.split, width = config.width;
34995
- var sentence = stringify(phrase);
34996
- var words = split(sentence);
34997
- var style = {
34998
- "font-family": fontFamily,
34999
- "font-size": fontSize,
35000
- "font-weight": fontWeight,
35001
- "line-height": lineHeight
35002
- };
35072
+ */ function flowWords(words, sizes, config, lineWidth) {
35073
+ var height = config.height, lineHeight = config.lineHeight, maxLines = config.maxLines, overflow = config.overflow;
35003
35074
  var line = 1, textProg = "", truncated = false, widthProg = 0;
35004
- var lineData = [], // of the per-word widths the break logic actually compared against
35005
- // `width`, which can differ from re-measuring the finished line as a
35006
- // single string (e.g. a soft hyphen counts toward the break decision but
35007
- // is stripped from the rendered line, and trailing spaces measure as 0).
35008
- lineWidths = [], sizes = d3plusTextWidth(words, style);
35075
+ var lineData = [], // of the per-word widths the break logic actually compared against the
35076
+ // line's allowed width, which can differ from re-measuring the finished
35077
+ // line as a single string (e.g. a soft hyphen counts toward the break
35078
+ // decision but is stripped from the rendered line, and trailing spaces
35079
+ // measure as 0).
35080
+ lineWidths = [];
35009
35081
  for(var i = 0; i < words.length; i++){
35010
35082
  var word = words[i];
35011
- var wordWidth = sizes[words.indexOf(word)];
35083
+ // `sizes` is built parallel to `words`, so index directly — `indexOf`
35084
+ // would rescan the array for every word (O(n²)), and the circle path runs
35085
+ // this loop once per candidate line count.
35086
+ var wordWidth = sizes[i];
35087
+ var width = lineWidth(line);
35012
35088
  // newline if breaking character or not enough width
35013
35089
  if (textProg.slice(-1) === "\n" || widthProg + wordWidth > width) {
35014
35090
  if (!i && !overflow) {
35015
35091
  truncated = true;
35016
35092
  break;
35017
35093
  }
35018
- if (lineData.length >= line) {
35019
- var lineText = lineData[line - 1].trimEnd();
35020
- // Convert trailing soft hyphen to visible hyphen at line breaks
35021
- if (lineText.endsWith(softHyphen)) lineText = lineText.slice(0, -1) + "-";
35022
- lineData[line - 1] = lineText;
35023
- }
35024
- line++;
35025
- if (lineHeight * line > height || wordWidth > width && !overflow || maxLines && line > maxLines) {
35026
- truncated = true;
35027
- break;
35094
+ if (!i) {
35095
+ // The very first word is wider than its line and overflow is allowed:
35096
+ // keep it on the first line instead of breaking. There is no prior line
35097
+ // to leave, and advancing `line` past the empty `lineData` here would
35098
+ // desync the two so later lines read `lineData[line - 1]` as undefined.
35099
+ lineData[0] = word;
35100
+ } else {
35101
+ if (lineData.length >= line) {
35102
+ var lineText = lineData[line - 1].trimEnd();
35103
+ // Convert trailing soft hyphen to visible hyphen at line breaks
35104
+ if (lineText.endsWith(softHyphen)) lineText = lineText.slice(0, -1) + "-";
35105
+ lineData[line - 1] = lineText;
35106
+ }
35107
+ line++;
35108
+ if (lineHeight * line > height || wordWidth > lineWidth(line) && !overflow || maxLines && line > maxLines) {
35109
+ truncated = true;
35110
+ break;
35111
+ }
35112
+ widthProg = 0;
35113
+ lineData.push(word);
35028
35114
  }
35029
- widthProg = 0;
35030
- lineData.push(word);
35031
35115
  } else if (!i) lineData[0] = word;
35032
35116
  else {
35033
35117
  // Strip soft hyphen when syllables stay on the same line
@@ -35040,6 +35124,133 @@
35040
35124
  widthProg += wordWidth;
35041
35125
  lineWidths[line - 1] = widthProg;
35042
35126
  }
35127
+ return {
35128
+ lineData: lineData,
35129
+ lineWidths: lineWidths,
35130
+ truncated: truncated
35131
+ };
35132
+ }
35133
+ /**
35134
+ Builds a per-line width function for `total` vertically-centered lines
35135
+ inside a circle of the given radius. Each line is measured at whichever of
35136
+ its glyph-box edges sits farther from the center (glyphs span roughly the
35137
+ font size, centered in the line box), so the returned chord keeps the whole
35138
+ line within the circle. Lines through the middle get the full diameter;
35139
+ lines near the top and bottom get progressively less.
35140
+
35141
+ The block is assumed to be vertically centered on the circle — which is how
35142
+ TextBox positions circle labels (verticalAlign "middle"). Pairing
35143
+ `shape: "circle"` with a top/bottom alignment would measure lines against
35144
+ chords for a position they aren't rendered at.
35145
+ @private
35146
+ */ function circleLineWidth(radius, total, lineHeight, fontSize) {
35147
+ var blockHeight = total * lineHeight;
35148
+ return function(line) {
35149
+ // Center of this line's box, measured from the circle's center.
35150
+ var center = -blockHeight / 2 + (line - 0.5) * lineHeight;
35151
+ var edge = Math.abs(center) + fontSize / 2;
35152
+ if (edge >= radius) return 0;
35153
+ return 2 * Math.sqrt(radius * radius - edge * edge);
35154
+ };
35155
+ }
35156
+ /**
35157
+ Measures each finished line as it will actually render (soft hyphens
35158
+ stripped). The per-word widths the flow loop compares against exclude
35159
+ trailing spaces, so a line can measure wider than the running total the
35160
+ break decisions used once inter-word spaces are counted.
35161
+ @private
35162
+ */ function measureLines(lineData, style) {
35163
+ return d3plusTextWidth(lineData.map(function(l) {
35164
+ return l.replaceAll(softHyphen, "");
35165
+ }), style);
35166
+ }
35167
+ /**
35168
+ Wraps text to fit inside a circle by giving each line its own width — the
35169
+ chord of the circle at that line's vertical position. The block is kept
35170
+ vertically centered, so the number of lines feeds back into every line's
35171
+ width; this searches upward from a single line for the fewest lines whose
35172
+ real rendered widths all fit inside the circle. If no line count fits (the
35173
+ text is simply too big), it returns the attempt that spills the least and
35174
+ reports truncation, so a resizing caller shrinks the font and tries again.
35175
+ @private
35176
+ */ function flowCircle(words, sizes, config, style) {
35177
+ var _loop = function(n) {
35178
+ var _Math;
35179
+ var pass = flowWords(words, sizes, _object_spread_props(_object_spread({}, config), {
35180
+ maxLines: n
35181
+ }), circleLineWidth(radius, n, lineHeight, fontSize));
35182
+ if (pass.truncated) return "continue";
35183
+ // Validate the real rendered widths against the chords for the ACTUAL line
35184
+ // count: flowWords can settle on fewer lines than the search `n`, and the
35185
+ // block is re-centered to that count at render time, so the chords that
35186
+ // matter belong to `pass.lineData.length`, not `n`.
35187
+ var visibleWidths = measureLines(pass.lineData, style);
35188
+ var chord = circleLineWidth(radius, pass.lineData.length, lineHeight, fontSize);
35189
+ var over = (_Math = Math).max.apply(_Math, [
35190
+ 0
35191
+ ].concat(_to_consumable_array(visibleWidths.map(function(w, i) {
35192
+ return w - chord(i + 1);
35193
+ }))));
35194
+ // `overflow` opts out of containment — let the text spill, as the flag asks.
35195
+ if (overflow || over <= 0) return {
35196
+ v: _object_spread_props(_object_spread({}, pass), {
35197
+ visibleWidths: visibleWidths
35198
+ })
35199
+ };
35200
+ if (over < bestOverflow) {
35201
+ bestOverflow = over;
35202
+ best = _object_spread_props(_object_spread({}, pass), {
35203
+ visibleWidths: visibleWidths
35204
+ });
35205
+ }
35206
+ };
35207
+ var fontSize = config.fontSize, height = config.height, lineHeight = config.lineHeight, maxLines = config.maxLines, overflow = config.overflow, width = config.width;
35208
+ var radius = Math.min(width, height) / 2;
35209
+ // The most lines that can stack vertically within the circle. Bounded by the
35210
+ // token count too — a line holds at least one word, so more passes than there
35211
+ // are words can never fit more text — which also keeps the search finite when
35212
+ // lineHeight is 0 (`verticalMax` would otherwise be Infinity and never end).
35213
+ var verticalMax = Math.max(1, Math.floor(2 * radius / lineHeight));
35214
+ var cap = maxLines ? Math.min(verticalMax, maxLines) : verticalMax;
35215
+ cap = Math.min(cap, words.length);
35216
+ var best = null;
35217
+ var bestOverflow = Infinity;
35218
+ for(var n = 1; n <= cap; n++){
35219
+ var _ret = _loop(n);
35220
+ if (_type_of$1(_ret) === "object") return _ret.v;
35221
+ }
35222
+ if (best) return _object_spread_props(_object_spread({}, best), {
35223
+ truncated: true
35224
+ });
35225
+ // No line count produced even an untruncated layout. Fall back to a plain
35226
+ // full-width flow, and flag truncation so a resizing TextBox drops the font
35227
+ // size and re-wraps into something that fits — returning a non-truncated
35228
+ // result would claim the text fit and leave it overflowing the circle. Empty
35229
+ // input (no words) is genuinely not truncated, so leave that flag alone.
35230
+ var fallback = flowWords(words, sizes, config, function() {
35231
+ return 2 * radius;
35232
+ });
35233
+ return words.length ? _object_spread_props(_object_spread({}, fallback), {
35234
+ truncated: true
35235
+ }) : fallback;
35236
+ }
35237
+ /**
35238
+ Breaks a single sentence into wrapped lines using the resolved style config.
35239
+ @private
35240
+ */ function wrapSentence(phrase, config) {
35241
+ var fontFamily = config.fontFamily, fontSize = config.fontSize, fontWeight = config.fontWeight, shape = config.shape, split = config.split, width = config.width;
35242
+ var sentence = stringify(phrase);
35243
+ var words = split(sentence);
35244
+ var style = {
35245
+ "font-family": fontFamily,
35246
+ "font-size": fontSize,
35247
+ "font-weight": fontWeight,
35248
+ "line-height": config.lineHeight
35249
+ };
35250
+ var sizes = d3plusTextWidth(words, style);
35251
+ var _ref = shape === "circle" ? flowCircle(words, sizes, config, style) : flowWords(words, sizes, config, function() {
35252
+ return width;
35253
+ }), lineData = _ref.lineData, lineWidths = _ref.lineWidths, truncated = _ref.truncated, visibleWidths = _ref.visibleWidths;
35043
35254
  // Clean remaining soft hyphens from all lines
35044
35255
  var lines = lineData.map(function(l) {
35045
35256
  return l.replaceAll(softHyphen, "");
@@ -35047,7 +35258,9 @@
35047
35258
  // Report each line's width as at least the width the break logic consumed,
35048
35259
  // so that re-wrapping the same text at the reported width is stable (a
35049
35260
  // consumer that sizes a box to `max(widths)` won't trigger another break).
35050
- var lineWidthsVisible = d3plusTextWidth(lines, style);
35261
+ // The circle path already measured the finished lines while checking chord
35262
+ // fit, so reuse that instead of measuring the same strings again.
35263
+ var lineWidthsVisible = visibleWidths !== null && visibleWidths !== void 0 ? visibleWidths : d3plusTextWidth(lines, style);
35051
35264
  return {
35052
35265
  lines: lines,
35053
35266
  sentence: sentence,
@@ -35061,7 +35274,7 @@
35061
35274
  /**
35062
35275
  Based on the defined styles and dimensions, breaks a string into an array of strings for each line of text.
35063
35276
  */ function textWrap() {
35064
- var fontFamily = "sans-serif", fontSize = 10, fontWeight = 400, height = 200, lineHeight, maxLines = null, overflow = false, split = textSplit, width = 200;
35277
+ var fontFamily = "sans-serif", fontSize = 10, fontWeight = 400, height = 200, lineHeight, maxLines = null, overflow = false, shape = "square", split = textSplit, width = 200;
35065
35278
  /**
35066
35279
  The inner return object and wraps the text and returns the line data array.
35067
35280
  @private
@@ -35075,6 +35288,7 @@
35075
35288
  lineHeight: lineHeight,
35076
35289
  maxLines: maxLines,
35077
35290
  overflow: overflow,
35291
+ shape: shape,
35078
35292
  split: split,
35079
35293
  width: width
35080
35294
  });
@@ -35114,6 +35328,14 @@
35114
35328
  */ textWrap.overflow = function(_) {
35115
35329
  return arguments.length ? (overflow = _, textWrap) : overflow;
35116
35330
  };
35331
+ /**
35332
+ The bounding shape used when wrapping. `"square"` (default) fills the full
35333
+ [width](#textWrap.width) on every line; `"circle"` treats
35334
+ [width](#textWrap.width)/[height](#textWrap.height) as the diameter and
35335
+ shortens lines near the top and bottom so the text stays inside the circle.
35336
+ */ textWrap.shape = function(_) {
35337
+ return arguments.length ? (shape = _, textWrap) : shape;
35338
+ };
35117
35339
  /**
35118
35340
  The function used to split text into words.
35119
35341
  */ textWrap.split = function(_) {
@@ -41555,6 +41777,14 @@
41555
41777
  id: `${id(d, i)}_${l}`,
41556
41778
  r,
41557
41779
  rotateAnchor,
41780
+ // Wrapping shape rides on the bounds so it stays paired with them:
41781
+ // a shape whose `labelBounds` returns `shape: "circle"` wraps to the
41782
+ // circle, while a chart that supplies its own rectangular bounds
41783
+ // (no `shape`) wraps normally. Stamped under a namespaced key so it
41784
+ // can't collide with a `shape` field a caller's own data might carry.
41785
+ ...b.shape ? {
41786
+ __d3plusWrapShape__: b.shape
41787
+ } : {},
41558
41788
  text: labels[l],
41559
41789
  width: b.width,
41560
41790
  x: xPos + b.x,
@@ -42795,11 +43025,19 @@
42795
43025
  super("circle");
42796
43026
  installFluent(this, circleSchema);
42797
43027
  this._name = "Circle";
43028
+ // Bound the label to the full circle (diameter box) and tag it
43029
+ // `shape: "circle"`, so the label TextBox flows text as circle chords —
43030
+ // lines fill the interior, shorter near the top and bottom and full width
43031
+ // through the middle — rather than being capped to a square inscribed in
43032
+ // the circle. The `shape` hint rides on the bounds (not `labelConfig`) so a
43033
+ // chart that repositions the label with its own `labelBounds` (e.g. Tree's
43034
+ // external node labels) gets ordinary rectangular wrapping.
42798
43035
  this.schema.labelBounds = (_d, _i, s)=>({
42799
- width: s.r * 1.5,
42800
- height: s.r * 1.5,
42801
- x: -s.r * 0.75,
42802
- y: -s.r * 0.75
43036
+ width: s.r * 2,
43037
+ height: s.r * 2,
43038
+ x: -s.r,
43039
+ y: -s.r,
43040
+ shape: "circle"
42803
43041
  });
42804
43042
  this.schema.labelConfig = assign(this.schema.labelConfig, {
42805
43043
  textAnchor: "middle",
@@ -45902,9 +46140,11 @@
45902
46140
  }
45903
46141
  return lineRuns;
45904
46142
  }
45905
- /** Pre-scales the font size to fit the box area before wrapping (resize mode). */ function resizeFontSize(fS, w, h, lH, words, style) {
46143
+ /** Pre-scales the font size to fit the box area before wrapping (resize mode). */ function resizeFontSize(fS, w, h, lH, words, style, shape) {
45906
46144
  const sizes = d3plusTextWidth(words, style);
45907
- const areaMod = 1.165 + w / h * 0.1, boxArea = w * h, maxWidth = max$5(sizes), textArea = sum$2(sizes, (d)=>d * lH) * areaMod;
46145
+ const areaMod = 1.165 + w / h * 0.1, // A circle fills only ~π/4 of its bounding box, so scale the usable area
46146
+ // down to keep the initial font-size guess from overshooting.
46147
+ boxArea = w * h * (shape === "circle" ? Math.PI / 4 : 1), maxWidth = max$5(sizes), textArea = sum$2(sizes, (d)=>d * lH) * areaMod;
45908
46148
  if (maxWidth > w || textArea > boxArea) {
45909
46149
  const areaRatio = Math.sqrt(boxArea / textArea), widthRatio = w / maxWidth;
45910
46150
  const sizeRatio = min$5([
@@ -45974,8 +46214,8 @@
45974
46214
  "line-height": lH
45975
46215
  };
45976
46216
  const padding = parseSides(box.schema.padding(d, i));
45977
- const h = box.schema.height(d, i) - (padding.top + padding.bottom), w = box.schema.width(d, i) - (padding.left + padding.right);
45978
- const wrapper = textWrap().fontFamily(style["font-family"]).fontSize(fS).fontWeight(style["font-weight"]).lineHeight(lH).maxLines(box.schema.maxLines(d, i)).height(h).overflow(box.schema.overflow(d, i)).width(w).split(box.schema.split);
46217
+ const h = box.schema.height(d, i) - (padding.top + padding.bottom), w = box.schema.width(d, i) - (padding.left + padding.right), shape = box.schema.shape(d, i);
46218
+ const wrapper = textWrap().fontFamily(style["font-family"]).fontSize(fS).fontWeight(style["font-weight"]).lineHeight(lH).maxLines(box.schema.maxLines(d, i)).height(h).overflow(box.schema.overflow(d, i)).shape(shape).width(w).split(box.schema.split);
45979
46219
  const fMax = box.schema.fontMax(d, i), fMin = box.schema.fontMin(d, i), vA = box.schema.verticalAlign(d, i), words = box.schema.split(t, i);
45980
46220
  /**
45981
46221
  Figures out the lineData to be used for wrapping.
@@ -46017,7 +46257,7 @@
46017
46257
  }
46018
46258
  }
46019
46259
  if (w > fMin && (h > lH || resize && h > fMin * lHRatio)) {
46020
- if (resize) fS = resizeFontSize(fS, w, h, lH, words, style);
46260
+ if (resize) fS = resizeFontSize(fS, w, h, lH, words, style, shape);
46021
46261
  checkSize();
46022
46262
  }
46023
46263
  if (!lineData.length) return null;
@@ -46157,6 +46397,17 @@
46157
46397
  d.h / 2
46158
46398
  ]
46159
46399
  },
46400
+ // Bounding shape for wrapping: "square" (default) fills the full width on
46401
+ // every line; "circle" treats width/height as the diameter and shortens
46402
+ // lines near the top and bottom to keep text inside the circle. Defaults to
46403
+ // the label record's namespaced `__d3plusWrapShape__` (stamped from a shape's
46404
+ // `labelBounds`) so Circle labels wrap to the circle without callers
46405
+ // configuring anything, while a caller's own `shape` data field is ignored.
46406
+ {
46407
+ key: "shape",
46408
+ coerce: "const",
46409
+ default: (d)=>d.__d3plusWrapShape__ ?? "square"
46410
+ },
46160
46411
  {
46161
46412
  key: "split",
46162
46413
  coerce: "identity",
@@ -48836,7 +49087,7 @@
48836
49087
  ];
48837
49088
  return id;
48838
49089
  })).length;
48839
- const inverted = this.schema.legendFilterInvert.bind(this)();
49090
+ const inverted = this.schema.legendFilterInvert.bind(this)(this);
48840
49091
  if (inverted) {
48841
49092
  if (event.shiftKey) {
48842
49093
  if (hiddenIndex < 0 && !this._solo.length) {
@@ -48994,7 +49245,7 @@
48994
49245
  const hasDeeperLevel = this._drawDepth < this.schema.groupBy.length - 1;
48995
49246
  // only show the hand cursor when the shape has a click event
48996
49247
  this._select.style("cursor", hasUserClick || hasDefaultClick && hasDeeperLevel ? "pointer" : "auto");
48997
- const invertedBehavior = this.schema.legendFilterInvert.bind(this)();
49248
+ const invertedBehavior = this.schema.legendFilterInvert.bind(this)(this);
48998
49249
  const solo = this._solo.includes(id);
48999
49250
  const hidden = this._hidden.includes(id);
49000
49251
  this._tooltipClass.data([