@d3plus/core 3.0.14 → 3.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1645,13 +1645,16 @@ This is a global class, and extends all of the methods and functionality of [<co
1645
1645
  * [Sankey](#Sankey) ⇐ [<code>Viz</code>](#Viz)
1646
1646
  * [new Sankey()](#new_Sankey_new)
1647
1647
  * [.hover([*value*])](#Sankey.hover) ↩︎
1648
+ * [.iterations([*value*])](#Sankey.iterations) ↩︎
1648
1649
  * [.links(*links*)](#Sankey.links) ↩︎
1650
+ * [.linkSort([*value*])](#Sankey.linkSort) ↩︎
1649
1651
  * [.linksSource([*value*])](#Sankey.linksSource) ↩︎
1650
1652
  * [.linksTarget([*value*])](#Sankey.linksTarget) ↩︎
1651
1653
  * [.nodeAlign([*value*])](#Sankey.nodeAlign) ↩︎
1652
1654
  * [.nodeId([*value*])](#Sankey.nodeId) ↩︎
1653
1655
  * [.nodes(*nodes*)](#Sankey.nodes) ↩︎
1654
1656
  * [.nodePadding([*value*])](#Sankey.nodePadding) ↩︎
1657
+ * [.nodeSort([*value*])](#Sankey.nodeSort) ↩︎
1655
1658
  * [.nodeWidth([*value*])](#Sankey.nodeWidth) ↩︎
1656
1659
  * [.value(*value*)](#Sankey.value)
1657
1660
 
@@ -1664,7 +1667,7 @@ Creates a sankey visualization based on a defined set of nodes and links. [Click
1664
1667
 
1665
1668
 
1666
1669
 
1667
- <a name="Sankey.hover" href="#Sankey.hover">#</a> Sankey.**hover**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L215)
1670
+ <a name="Sankey.hover" href="#Sankey.hover">#</a> Sankey.**hover**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L231)
1668
1671
 
1669
1672
  If *value* is specified, sets the hover method to the specified function and returns the current class instance.
1670
1673
 
@@ -1672,7 +1675,15 @@ If *value* is specified, sets the hover method to the specified function and ret
1672
1675
  This is a static method of [<code>Sankey</code>](#Sankey), and is chainable with other methods of this Class.
1673
1676
 
1674
1677
 
1675
- <a name="Sankey.links" href="#Sankey.links">#</a> Sankey.**links**(*links*) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L232)
1678
+ <a name="Sankey.iterations" href="#Sankey.iterations">#</a> Sankey.**iterations**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L245)
1679
+
1680
+ A pass-through for the d3-sankey [iterations](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_iterations) function.
1681
+
1682
+
1683
+ This is a static method of [<code>Sankey</code>](#Sankey), and is chainable with other methods of this Class.
1684
+
1685
+
1686
+ <a name="Sankey.links" href="#Sankey.links">#</a> Sankey.**links**(*links*) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L258)
1676
1687
 
1677
1688
  A predefined *Array* of edges that connect each object passed to the [node](#Sankey.node) method. The `source` and `target` keys in each link need to map to the nodes in one of one way:
1678
1689
  1. A *String* value matching the `id` of the node.
@@ -1683,7 +1694,15 @@ The value passed should be an *Array* of data. An optional formatting function c
1683
1694
  This is a static method of [<code>Sankey</code>](#Sankey), and is chainable with other methods of this Class.
1684
1695
 
1685
1696
 
1686
- <a name="Sankey.linksSource" href="#Sankey.linksSource">#</a> Sankey.**linksSource**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L246)
1697
+ <a name="Sankey.linkSort" href="#Sankey.linkSort">#</a> Sankey.**linkSort**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L272)
1698
+
1699
+ A pass-through for the d3-sankey [linkSort](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_linkSort) function.
1700
+
1701
+
1702
+ This is a static method of [<code>Sankey</code>](#Sankey), and is chainable with other methods of this Class.
1703
+
1704
+
1705
+ <a name="Sankey.linksSource" href="#Sankey.linksSource">#</a> Sankey.**linksSource**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L282)
1687
1706
 
1688
1707
  The key inside of each link Object that references the source node.
1689
1708
 
@@ -1691,7 +1710,7 @@ The key inside of each link Object that references the source node.
1691
1710
  This is a static method of [<code>Sankey</code>](#Sankey), and is chainable with other methods of this Class.
1692
1711
 
1693
1712
 
1694
- <a name="Sankey.linksTarget" href="#Sankey.linksTarget">#</a> Sankey.**linksTarget**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L256)
1713
+ <a name="Sankey.linksTarget" href="#Sankey.linksTarget">#</a> Sankey.**linksTarget**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L294)
1695
1714
 
1696
1715
  The key inside of each link Object that references the target node.
1697
1716
 
@@ -1699,7 +1718,7 @@ The key inside of each link Object that references the target node.
1699
1718
  This is a static method of [<code>Sankey</code>](#Sankey), and is chainable with other methods of this Class.
1700
1719
 
1701
1720
 
1702
- <a name="Sankey.nodeAlign" href="#Sankey.nodeAlign">#</a> Sankey.**nodeAlign**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L266)
1721
+ <a name="Sankey.nodeAlign" href="#Sankey.nodeAlign">#</a> Sankey.**nodeAlign**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L306)
1703
1722
 
1704
1723
  Sets the nodeAlign property of the sankey layout, which can either be "left", "right", "center", or "justify".
1705
1724
 
@@ -1707,7 +1726,7 @@ Sets the nodeAlign property of the sankey layout, which can either be "left", "r
1707
1726
  This is a static method of [<code>Sankey</code>](#Sankey), and is chainable with other methods of this Class.
1708
1727
 
1709
1728
 
1710
- <a name="Sankey.nodeId" href="#Sankey.nodeId">#</a> Sankey.**nodeId**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L278)
1729
+ <a name="Sankey.nodeId" href="#Sankey.nodeId">#</a> Sankey.**nodeId**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L319)
1711
1730
 
1712
1731
  If *value* is specified, sets the node id accessor(s) to the specified array of values and returns the current class instance. If *value* is not specified, returns the current node group accessor.
1713
1732
 
@@ -1715,7 +1734,7 @@ If *value* is specified, sets the node id accessor(s) to the specified array of
1715
1734
  This is a static method of [<code>Sankey</code>](#Sankey), and is chainable with other methods of this Class.
1716
1735
 
1717
1736
 
1718
- <a name="Sankey.nodes" href="#Sankey.nodes">#</a> Sankey.**nodes**(*nodes*) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L292)
1737
+ <a name="Sankey.nodes" href="#Sankey.nodes">#</a> Sankey.**nodes**(*nodes*) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L333)
1719
1738
 
1720
1739
  The list of nodes to be used for drawing the network. The value passed must be an *Array* of data.
1721
1740
 
@@ -1725,7 +1744,7 @@ Additionally, a custom formatting function can be passed as a second argument to
1725
1744
  This is a static method of [<code>Sankey</code>](#Sankey), and is chainable with other methods of this Class.
1726
1745
 
1727
1746
 
1728
- <a name="Sankey.nodePadding" href="#Sankey.nodePadding">#</a> Sankey.**nodePadding**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L306)
1747
+ <a name="Sankey.nodePadding" href="#Sankey.nodePadding">#</a> Sankey.**nodePadding**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L347)
1729
1748
 
1730
1749
  If *value* is specified, sets the padding of the node and returns the current class instance. If *value* is not specified, returns the current nodePadding. By default, the nodePadding size is 8.
1731
1750
 
@@ -1733,7 +1752,15 @@ If *value* is specified, sets the padding of the node and returns the current cl
1733
1752
  This is a static method of [<code>Sankey</code>](#Sankey), and is chainable with other methods of this Class.
1734
1753
 
1735
1754
 
1736
- <a name="Sankey.nodeWidth" href="#Sankey.nodeWidth">#</a> Sankey.**nodeWidth**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L317)
1755
+ <a name="Sankey.nodeSort" href="#Sankey.nodeSort">#</a> Sankey.**nodeSort**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L359)
1756
+
1757
+ A pass-through for the d3-sankey [nodeSort](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_nodeSort) function.
1758
+
1759
+
1760
+ This is a static method of [<code>Sankey</code>](#Sankey), and is chainable with other methods of this Class.
1761
+
1762
+
1763
+ <a name="Sankey.nodeWidth" href="#Sankey.nodeWidth">#</a> Sankey.**nodeWidth**([*value*]) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L369)
1737
1764
 
1738
1765
  If *value* is specified, sets the width of the node and returns the current class instance. If *value* is not specified, returns the current nodeWidth. By default, the nodeWidth size is 30.
1739
1766
 
@@ -1741,7 +1768,7 @@ If *value* is specified, sets the width of the node and returns the current clas
1741
1768
  This is a static method of [<code>Sankey</code>](#Sankey), and is chainable with other methods of this Class.
1742
1769
 
1743
1770
 
1744
- <a name="Sankey.value" href="#Sankey.value">#</a> Sankey.**value**(*value*) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L330)
1771
+ <a name="Sankey.value" href="#Sankey.value">#</a> Sankey.**value**(*value*) [<>](https://github.com/d3plus/d3plus/blob/main/packages/core/src/charts/Sankey.js#L382)
1745
1772
 
1746
1773
  If *value* is specified, sets the width of the links and returns the current class instance. If *value* is not specified, returns the current value accessor.
1747
1774
 
@@ -115,8 +115,11 @@ var Sankey = /*#__PURE__*/ function(Viz) {
115
115
  _class_call_check(this, Sankey);
116
116
  var _this;
117
117
  _this = _call_super(this, Sankey);
118
+ _this._iterations = 6;
118
119
  _this._nodeId = accessor("id");
120
+ _this._nodeSort = undefined;
119
121
  _this._links = accessor("links");
122
+ _this._linkSort = undefined;
120
123
  _this._linksSource = "source";
121
124
  _this._linksTarget = "target";
122
125
  _this._noDataMessage = false;
@@ -235,7 +238,7 @@ var Sankey = /*#__PURE__*/ function(Viz) {
235
238
  return obj;
236
239
  }, {});
237
240
  var transform = "translate(".concat(this._margin.left, ", ").concat(this._margin.top, ")");
238
- this._sankey.nodeAlign(this._nodeAlign).nodePadding(this._nodePadding).nodeWidth(this._nodeWidth).nodes(nodes).links(links).size([
241
+ this._sankey.nodeAlign(this._nodeAlign).nodePadding(this._nodePadding).nodeWidth(this._nodeWidth).nodes(nodes).nodeSort(this._nodeSort).links(links).linkSort(this._linkSort).iterations(this._iterations).size([
239
242
  width,
240
243
  height
241
244
  ])();
@@ -291,6 +294,17 @@ var Sankey = /*#__PURE__*/ function(Viz) {
291
294
  {
292
295
  /**
293
296
  @memberof Sankey
297
+ @desc A pass-through for the d3-sankey [iterations](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_iterations) function.
298
+ @param {Number} [*value* = 6]
299
+ @chainable
300
+ */ key: "iterations",
301
+ value: function iterations(_) {
302
+ return arguments.length ? (this._iterations = _, this) : this._iterations;
303
+ }
304
+ },
305
+ {
306
+ /**
307
+ @memberof Sankey
294
308
  @desc A predefined *Array* of edges that connect each object passed to the [node](#Sankey.node) method. The `source` and `target` keys in each link need to map to the nodes in one of one way:
295
309
  1. A *String* value matching the `id` of the node.
296
310
 
@@ -309,6 +323,17 @@ The value passed should be an *Array* of data. An optional formatting function c
309
323
  {
310
324
  /**
311
325
  @memberof Sankey
326
+ @desc A pass-through for the d3-sankey [linkSort](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_linkSort) function.
327
+ @param {Function|undefined} [*value* = undefined]
328
+ @chainable
329
+ */ key: "linkSort",
330
+ value: function linkSort(_) {
331
+ return arguments.length ? (this._linkSort = _, this) : this._linkSort;
332
+ }
333
+ },
334
+ {
335
+ /**
336
+ @memberof Sankey
312
337
  @desc The key inside of each link Object that references the source node.
313
338
  @param {String} [*value* = "source"]
314
339
  @chainable
@@ -381,6 +406,17 @@ Additionally, a custom formatting function can be passed as a second argument to
381
406
  {
382
407
  /**
383
408
  @memberof Sankey
409
+ @desc A pass-through for the d3-sankey [nodeSort](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_nodeSort) function.
410
+ @param {Function|undefined} [*value* = undefined]
411
+ @chainable
412
+ */ key: "nodeSort",
413
+ value: function nodeSort(_) {
414
+ return arguments.length ? (this._nodeSort = _, this) : this._nodeSort;
415
+ }
416
+ },
417
+ {
418
+ /**
419
+ @memberof Sankey
384
420
  @desc If *value* is specified, sets the width of the node and returns the current class instance. If *value* is not specified, returns the current nodeWidth. By default, the nodeWidth size is 30.
385
421
  @param {Number} [*value* = 30]
386
422
  @chainable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d3plus/core",
3
- "version": "3.0.14",
3
+ "version": "3.0.15",
4
4
  "description": "Data visualization made easy. A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -34,13 +34,13 @@
34
34
  "test": "eslint index.js src/**/*.js && eslint --global=it test && mocha 'test/**/*-test.js'"
35
35
  },
36
36
  "dependencies": {
37
- "@d3plus/color": "3.0.14",
38
- "@d3plus/data": "3.0.14",
39
- "@d3plus/dom": "3.0.14",
40
- "@d3plus/format": "3.0.14",
41
- "@d3plus/locales": "3.0.14",
42
- "@d3plus/math": "3.0.14",
43
- "@d3plus/text": "3.0.14",
37
+ "@d3plus/color": "3.0.15",
38
+ "@d3plus/data": "3.0.15",
39
+ "@d3plus/dom": "3.0.15",
40
+ "@d3plus/format": "3.0.15",
41
+ "@d3plus/locales": "3.0.15",
42
+ "@d3plus/math": "3.0.15",
43
+ "@d3plus/text": "3.0.15",
44
44
  "@popperjs/core": "^2.11.8",
45
45
  "d3-array": "^3.2.4",
46
46
  "d3-brush": "^3.0.0",
@@ -1,7 +1,7 @@
1
1
  /*
2
- @d3plus/core v3.0.14
2
+ @d3plus/core v3.0.15
3
3
  Data visualization made easy. A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.
4
- Copyright (c) 2025 D3plus - https://d3plus.org
4
+ Copyright (c) 2026 D3plus - https://d3plus.org
5
5
  @license MIT
6
6
  */
7
7
 
@@ -56305,7 +56305,7 @@
56305
56305
  return obj;
56306
56306
  }, {});
56307
56307
  const transform = `translate(${this._margin.left}, ${this._margin.top})`;
56308
- this._sankey.nodeAlign(this._nodeAlign).nodePadding(this._nodePadding).nodeWidth(this._nodeWidth).nodes(nodes).links(links).size([
56308
+ this._sankey.nodeAlign(this._nodeAlign).nodePadding(this._nodePadding).nodeWidth(this._nodeWidth).nodes(nodes).nodeSort(this._nodeSort).links(links).linkSort(this._linkSort).iterations(this._iterations).size([
56309
56309
  width,
56310
56310
  height
56311
56311
  ])();
@@ -56342,6 +56342,14 @@
56342
56342
  if (this._legend) this._legendClass.hover(_);
56343
56343
  return this;
56344
56344
  }
56345
+ /**
56346
+ @memberof Sankey
56347
+ @desc A pass-through for the d3-sankey [iterations](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_iterations) function.
56348
+ @param {Number} [*value* = 6]
56349
+ @chainable
56350
+ */ iterations(_) {
56351
+ return arguments.length ? (this._iterations = _, this) : this._iterations;
56352
+ }
56345
56353
  /**
56346
56354
  @memberof Sankey
56347
56355
  @desc A predefined *Array* of edges that connect each object passed to the [node](#Sankey.node) method. The `source` and `target` keys in each link need to map to the nodes in one of one way:
@@ -56357,6 +56365,14 @@
56357
56365
  }
56358
56366
  return this._links;
56359
56367
  }
56368
+ /**
56369
+ @memberof Sankey
56370
+ @desc A pass-through for the d3-sankey [linkSort](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_linkSort) function.
56371
+ @param {Function|undefined} [*value* = undefined]
56372
+ @chainable
56373
+ */ linkSort(_) {
56374
+ return arguments.length ? (this._linkSort = _, this) : this._linkSort;
56375
+ }
56360
56376
  /**
56361
56377
  @memberof Sankey
56362
56378
  @desc The key inside of each link Object that references the source node.
@@ -56411,6 +56427,14 @@
56411
56427
  */ nodePadding(_) {
56412
56428
  return arguments.length ? (this._nodePadding = _, this) : this._nodePadding;
56413
56429
  }
56430
+ /**
56431
+ @memberof Sankey
56432
+ @desc A pass-through for the d3-sankey [nodeSort](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_nodeSort) function.
56433
+ @param {Function|undefined} [*value* = undefined]
56434
+ @chainable
56435
+ */ nodeSort(_) {
56436
+ return arguments.length ? (this._nodeSort = _, this) : this._nodeSort;
56437
+ }
56414
56438
  /**
56415
56439
  @memberof Sankey
56416
56440
  @desc If *value* is specified, sets the width of the node and returns the current class instance. If *value* is not specified, returns the current nodeWidth. By default, the nodeWidth size is 30.
@@ -56436,8 +56460,11 @@
56436
56460
  @private
56437
56461
  */ constructor(){
56438
56462
  super();
56463
+ this._iterations = 6;
56439
56464
  this._nodeId = accessor("id");
56465
+ this._nodeSort = undefined;
56440
56466
  this._links = accessor("links");
56467
+ this._linkSort = undefined;
56441
56468
  this._linksSource = "source";
56442
56469
  this._linksTarget = "target";
56443
56470
  this._noDataMessage = false;