@ac-kit/math-graph 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +183 -0
  2. package/LICENSE +28 -0
  3. package/README.md +118 -2
  4. package/dist/index.d.ts +12 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +11 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/layout/_force-forces.d.ts +227 -0
  9. package/dist/layout/_force-forces.d.ts.map +1 -0
  10. package/dist/layout/_force-forces.js +1572 -0
  11. package/dist/layout/_force-forces.js.map +1 -0
  12. package/dist/layout/_hierarchy-table.d.ts +34 -0
  13. package/dist/layout/_hierarchy-table.d.ts.map +1 -0
  14. package/dist/layout/_hierarchy-table.js +131 -0
  15. package/dist/layout/_hierarchy-table.js.map +1 -0
  16. package/dist/layout/_index-graph.d.ts +32 -0
  17. package/dist/layout/_index-graph.d.ts.map +1 -0
  18. package/dist/layout/_index-graph.js +51 -0
  19. package/dist/layout/_index-graph.js.map +1 -0
  20. package/dist/layout/_layer-order.d.ts +138 -0
  21. package/dist/layout/_layer-order.d.ts.map +1 -0
  22. package/dist/layout/_layer-order.js +954 -0
  23. package/dist/layout/_layer-order.js.map +1 -0
  24. package/dist/layout/_layered-acyclic.d.ts +28 -0
  25. package/dist/layout/_layered-acyclic.d.ts.map +1 -0
  26. package/dist/layout/_layered-acyclic.js +179 -0
  27. package/dist/layout/_layered-acyclic.js.map +1 -0
  28. package/dist/layout/_layered-position.d.ts +56 -0
  29. package/dist/layout/_layered-position.d.ts.map +1 -0
  30. package/dist/layout/_layered-position.js +369 -0
  31. package/dist/layout/_layered-position.js.map +1 -0
  32. package/dist/layout/_layered-rank.d.ts +58 -0
  33. package/dist/layout/_layered-rank.d.ts.map +1 -0
  34. package/dist/layout/_layered-rank.js +529 -0
  35. package/dist/layout/_layered-rank.js.map +1 -0
  36. package/dist/layout/_tree-common.d.ts +38 -0
  37. package/dist/layout/_tree-common.d.ts.map +1 -0
  38. package/dist/layout/_tree-common.js +73 -0
  39. package/dist/layout/_tree-common.js.map +1 -0
  40. package/dist/layout/_treemap-tiling.d.ts +73 -0
  41. package/dist/layout/_treemap-tiling.d.ts.map +1 -0
  42. package/dist/layout/_treemap-tiling.js +247 -0
  43. package/dist/layout/_treemap-tiling.js.map +1 -0
  44. package/dist/layout/circular-layout.d.ts +27 -0
  45. package/dist/layout/circular-layout.d.ts.map +1 -0
  46. package/dist/layout/circular-layout.js +35 -0
  47. package/dist/layout/circular-layout.js.map +1 -0
  48. package/dist/layout/create-force-step.d.ts +127 -0
  49. package/dist/layout/create-force-step.d.ts.map +1 -0
  50. package/dist/layout/create-force-step.js +167 -0
  51. package/dist/layout/create-force-step.js.map +1 -0
  52. package/dist/layout/dendrogram-layout.d.ts +32 -0
  53. package/dist/layout/dendrogram-layout.d.ts.map +1 -0
  54. package/dist/layout/dendrogram-layout.js +110 -0
  55. package/dist/layout/dendrogram-layout.js.map +1 -0
  56. package/dist/layout/force-directed-layout.d.ts +42 -0
  57. package/dist/layout/force-directed-layout.d.ts.map +1 -0
  58. package/dist/layout/force-directed-layout.js +112 -0
  59. package/dist/layout/force-directed-layout.js.map +1 -0
  60. package/dist/layout/layered-layout.d.ts +109 -0
  61. package/dist/layout/layered-layout.d.ts.map +1 -0
  62. package/dist/layout/layered-layout.js +124 -0
  63. package/dist/layout/layered-layout.js.map +1 -0
  64. package/dist/layout/partition-layout.d.ts +31 -0
  65. package/dist/layout/partition-layout.d.ts.map +1 -0
  66. package/dist/layout/partition-layout.js +78 -0
  67. package/dist/layout/partition-layout.js.map +1 -0
  68. package/dist/layout/phyllotaxis-layout.d.ts +17 -0
  69. package/dist/layout/phyllotaxis-layout.d.ts.map +1 -0
  70. package/dist/layout/phyllotaxis-layout.js +32 -0
  71. package/dist/layout/phyllotaxis-layout.js.map +1 -0
  72. package/dist/layout/sankey-layout.d.ts +113 -0
  73. package/dist/layout/sankey-layout.d.ts.map +1 -0
  74. package/dist/layout/sankey-layout.js +641 -0
  75. package/dist/layout/sankey-layout.js.map +1 -0
  76. package/dist/layout/tidy-tree-layout.d.ts +25 -0
  77. package/dist/layout/tidy-tree-layout.d.ts.map +1 -0
  78. package/dist/layout/tidy-tree-layout.js +197 -0
  79. package/dist/layout/tidy-tree-layout.js.map +1 -0
  80. package/dist/layout/treemap-layout.d.ts +63 -0
  81. package/dist/layout/treemap-layout.d.ts.map +1 -0
  82. package/dist/layout/treemap-layout.js +126 -0
  83. package/dist/layout/treemap-layout.js.map +1 -0
  84. package/dist/layout/types.d.ts +90 -0
  85. package/dist/layout/types.d.ts.map +1 -0
  86. package/dist/layout/types.js +2 -0
  87. package/dist/layout/types.js.map +1 -0
  88. package/package.json +68 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,183 @@
1
+ # @ac-kit/math-graph
2
+
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 0b4fe43: `forceDirectedLayout` is a d3-force-style simulation that no longer inherits
8
+ d3-force's Barnes–Hut limits. A node's own charge is never applied (a cell
9
+ holding the node is always opened), `distanceMax` applies to each body (a cell
10
+ straddling it is opened), and the positive and negative charges of a cell are
11
+ kept apart, so each monopole's error is bounded as for same-sign charges (a
12
+ node's error relative to its unsigned contributions, Σ |q| / d, not to its net
13
+ force) and a cell whose charges sum to zero still acts. Every force and the
14
+ integration keep positions and velocities finite for any finite inputs and
15
+ options, across the whole binary64 range: differences, sums, means, squares,
16
+ products, the `distanceMin` clamp, ratios and shares are scaled by powers of
17
+ two where they would leave the doubles (each end's share applied before
18
+ scaling back), positions beyond ±1e150 are indexed in a scaled quadtree, and
19
+ a position or velocity whose exact value lies beyond the doubles saturates at
20
+ ±`Number.MAX_VALUE`, in either approximation and with `compatibility:
21
+ "d3-force"`. Collisions never
22
+ miss a pair a node was pushed into earlier in the same pass nor one the active
23
+ node moved into by its own pushes, every node of a chain of coincident nodes
24
+ collides, and a self-link exerts no force. `compatibility: "d3-force"`
25
+ reproduces d3-force 3 instead, quirks included: with the same random source the
26
+ Barnes–Hut mode then matches d3-force's (same θ) and the `"exact"` mode
27
+ d3-force with θ = 0, to rounding. `createForceStep` allocates nothing per step
28
+ once warmed up.
29
+ - 0b4fe43: `layeredLayout` reduces crossings by sweeps, transposition and, with the new
30
+ `orderingEffort: "thorough"` (the default), by sifting each vertex to its best
31
+ slot, which leaves the local minima the sweeps stop in. It never has more
32
+ weighted crossings than `orderingEffort: "fast"`, which skips the sifting; where
33
+ rounded counts are too close to tell two orders apart, the exact weighted totals
34
+ decide. Each layer pair's weighted count is the exact `Σ wᵢ·wⱼ` over its
35
+ crossing pairs rounded once, for any finite weights ≥ 0, at the cost of the
36
+ compensated count it replaces wherever a rigorous bound certifies that
37
+ rounding. Network-simplex ranking charges the work budget, and yields, before each
38
+ exact scan that settles a cut value. `sankeyLayout` accepts `ordering:
39
+ "crossings"` to order its nodes with the layered crossing reduction and its
40
+ `orderingEffort`, instead of d3-sankey's relaxation.
41
+ - 0b4fe43: `treemapLayout` reserves a parent's own value in every tiling, so the area of a
42
+ cell is proportional to its value and small children keep their share beside a
43
+ huge one. `compatibility: "d3-hierarchy"` reproduces d3-hierarchy's binary
44
+ tiling, which does not.
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [0b4fe43]
49
+ - Updated dependencies [0b4fe43]
50
+ - Updated dependencies [0b4fe43]
51
+ - Updated dependencies [0b4fe43]
52
+ - Updated dependencies [0b4fe43]
53
+ - Updated dependencies [0b4fe43]
54
+ - Updated dependencies [0b4fe43]
55
+ - Updated dependencies [0b4fe43]
56
+ - Updated dependencies [0b4fe43]
57
+ - Updated dependencies [0b4fe43]
58
+ - Updated dependencies [0b4fe43]
59
+ - Updated dependencies [0b4fe43]
60
+ - Updated dependencies [0b4fe43]
61
+ - Updated dependencies [0b4fe43]
62
+ - Updated dependencies [0b4fe43]
63
+ - Updated dependencies [0b4fe43]
64
+ - Updated dependencies [0b4fe43]
65
+ - Updated dependencies [0b4fe43]
66
+ - Updated dependencies [0b4fe43]
67
+ - Updated dependencies [0b4fe43]
68
+ - Updated dependencies [0b4fe43]
69
+ - Updated dependencies [0b4fe43]
70
+ - Updated dependencies [0b4fe43]
71
+ - Updated dependencies [0b4fe43]
72
+ - Updated dependencies [0b4fe43]
73
+ - Updated dependencies [0b4fe43]
74
+ - Updated dependencies [0b4fe43]
75
+ - Updated dependencies [0b4fe43]
76
+ - Updated dependencies [0b4fe43]
77
+ - Updated dependencies [0b4fe43]
78
+ - Updated dependencies [0b4fe43]
79
+ - Updated dependencies [0b4fe43]
80
+ - Updated dependencies [0b4fe43]
81
+ - Updated dependencies [0b4fe43]
82
+ - Updated dependencies [0b4fe43]
83
+ - Updated dependencies [0b4fe43]
84
+ - Updated dependencies [0b4fe43]
85
+ - Updated dependencies [0b4fe43]
86
+ - Updated dependencies [0b4fe43]
87
+ - Updated dependencies [0b4fe43]
88
+ - @ac-kit/algo@0.6.0
89
+ - @ac-kit/core@0.13.0
90
+ - @ac-kit/data@0.5.0
91
+ - @ac-kit/math-geometry@0.4.0
92
+ - @ac-kit/math-linear@0.4.0
93
+ - @ac-kit/math-scalar@0.4.0
94
+
95
+ ## 0.1.0
96
+
97
+ ### Minor Changes
98
+
99
+ - 34e8cfa: New package `@ac-kit/math-graph`, numerical graph theory, starting with layouts.
100
+ Hierarchy layouts take a `childrenOf` callback and return a pre-order table
101
+ (`nodes`, `parentIndices`, `depths`, geometry), with an optional work budget on
102
+ untrusted input: `partitionLayout` (icicle, flamegraph), `treemapLayout`
103
+ (squarified by default, other tilings selectable), `tidyTreeLayout`
104
+ (Reingold–Tilford in linear time) and `dendrogramLayout`. `circularLayout` and
105
+ `phyllotaxisLayout` place a given number of points on a circle and on a
106
+ sunflower spiral, as `x, y` pairs in a `Float64Array`.
107
+
108
+ Network layouts take explicit links (`sourceOf`, `targetOf` indices into
109
+ `nodes`) and return columnar results in input order, no object per node.
110
+ `layeredLayout` is a Sugiyama drawing (cycle removal, network-simplex or
111
+ longest-path ranking, crossing reduction, Brandes–Köpf coordinates) in four
112
+ directions: it accepts cycles by reversing links (flagged in `reversed`) and
113
+ gives a self-loop an empty path, returning a `LayeredLayout` (`positions`,
114
+ `ranks`, `orders`, `edgePoints` with `edgeStarts`, `reversed`, `width`,
115
+ `height`). `sankeyLayout` draws a flow diagram: a `SankeyLayout` of
116
+ `nodeBoxes`, `nodeValues`, `columns`, `linkWidths` and `linkEnds`, with the
117
+ four d3-sankey alignments and its relaxation. It needs an acyclic flow: a cycle
118
+ or a self-loop throws a `RangeError` naming a link on it, as does a negative,
119
+ non-finite or over-1e150 value, or a fixed node value below its flow.
120
+ `forceDirectedLayout` runs d3-force's simulation (link, many-body with
121
+ Barnes–Hut or exact summation, collision, gravity, centring, pins, velocity
122
+ decay) for a fixed iteration count and returns positions as a `Float64Array`.
123
+ With the same random source its Barnes–Hut mode matches d3-force's Barnes–Hut
124
+ (same θ) and its `"exact"` mode matches d3-force with θ = 0, to rounding; it
125
+ keeps d3's Barnes–Hut limits (self-cell approximation at large θ, no error
126
+ bound for mixed-sign charges, `distanceMax` applied per cell). `random` is
127
+ required, and `budget` is charged per step. `createForceStep` returns one velocity-Verlet step
128
+ over caller-owned `positions` and `velocities`, for an animation loop.
129
+ `forceDirectedLayoutAsync`, `layeredLayoutAsync` and `sankeyLayoutAsync` give the same results in time
130
+ slices, yield between steps, and reject with `signal.reason` when aborted at
131
+ the next step, discarding the work.
132
+
133
+ ### Patch Changes
134
+
135
+ - Updated dependencies [34e8cfa]
136
+ - Updated dependencies [34e8cfa]
137
+ - Updated dependencies [34e8cfa]
138
+ - Updated dependencies [34e8cfa]
139
+ - Updated dependencies [34e8cfa]
140
+ - Updated dependencies [34e8cfa]
141
+ - Updated dependencies [34e8cfa]
142
+ - Updated dependencies [34e8cfa]
143
+ - Updated dependencies [34e8cfa]
144
+ - Updated dependencies [34e8cfa]
145
+ - Updated dependencies [34e8cfa]
146
+ - Updated dependencies [34e8cfa]
147
+ - Updated dependencies [34e8cfa]
148
+ - Updated dependencies [34e8cfa]
149
+ - Updated dependencies [34e8cfa]
150
+ - Updated dependencies [34e8cfa]
151
+ - Updated dependencies [34e8cfa]
152
+ - Updated dependencies [34e8cfa]
153
+ - Updated dependencies [34e8cfa]
154
+ - Updated dependencies [34e8cfa]
155
+ - Updated dependencies [34e8cfa]
156
+ - Updated dependencies [34e8cfa]
157
+ - Updated dependencies [34e8cfa]
158
+ - Updated dependencies [34e8cfa]
159
+ - Updated dependencies [34e8cfa]
160
+ - Updated dependencies [34e8cfa]
161
+ - Updated dependencies [34e8cfa]
162
+ - Updated dependencies [34e8cfa]
163
+ - Updated dependencies [34e8cfa]
164
+ - Updated dependencies [34e8cfa]
165
+ - Updated dependencies [34e8cfa]
166
+ - Updated dependencies [34e8cfa]
167
+ - Updated dependencies [34e8cfa]
168
+ - Updated dependencies [34e8cfa]
169
+ - Updated dependencies [34e8cfa]
170
+ - Updated dependencies [34e8cfa]
171
+ - Updated dependencies [34e8cfa]
172
+ - Updated dependencies [34e8cfa]
173
+ - Updated dependencies [34e8cfa]
174
+ - Updated dependencies [34e8cfa]
175
+ - Updated dependencies [34e8cfa]
176
+ - Updated dependencies [34e8cfa]
177
+ - Updated dependencies [34e8cfa]
178
+ - @ac-kit/algo@0.5.0
179
+ - @ac-kit/core@0.12.0
180
+ - @ac-kit/math-scalar@0.3.0
181
+ - @ac-kit/data@0.4.0
182
+ - @ac-kit/math-linear@0.3.0
183
+ - @ac-kit/math-geometry@0.3.0
package/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024-2026 Anthony Champagne and contributors
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
@@ -1,3 +1,119 @@
1
- # Temporary Holding Version
1
+ # @ac-kit/math-graph
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Numerical graph theory: what is _computed_ over a graph — positions today,
4
+ scores and partitions later. Traversals, shortest paths and structural
5
+ predicates stay in `@ac-kit/algo`.
6
+
7
+ Portable: no Node.js built-ins. Depends on `@ac-kit/core`, `@ac-kit/algo`,
8
+ `@ac-kit/data`, `@ac-kit/math-scalar`, `@ac-kit/math-linear` and
9
+ `@ac-kit/math-geometry`.
10
+
11
+ Every hierarchy layout takes its structure as callbacks (`childrenOf`,
12
+ `ownValueOf`, `separationOf`, `heightOf`, depending on the layout) and returns a
13
+ table in pre-order: the caller's `nodes`, `parentIndices` into the same table,
14
+ `depths` and the geometry (`positions` or `boxes`). Pre-order is draw order, so
15
+ a renderer iterates the result directly.
16
+
17
+ ```ts
18
+ import { hierarchyFromParents } from "@ac-kit/algo";
19
+ import { treemapLayout } from "@ac-kit/math-graph";
20
+ ```
21
+
22
+ ## Contents
23
+
24
+ | Symbol | Description |
25
+ | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
26
+ | `partitionLayout(root, traits, options)` | Stacked bars along one axis: icicle and flamegraph |
27
+ | `treemapLayout(root, traits, options)` | Treemap with a choice of tiling, squarified by default |
28
+ | `tidyTreeLayout(root, traits, options)` | Reingold–Tilford node placement, linear time |
29
+ | `dendrogramLayout(root, traits, options)` | Leaf placement for a merge tree |
30
+ | `circularLayout(count, options)`, `phyllotaxisLayout(count, options)` | Deterministic placements on a circle and on a sunflower spiral, as `x, y` pairs in a `Float64Array` |
31
+ | `sankeyLayout(nodes, links, traits, options)`, `sankeyLayoutAsync(…)` | Flow diagram: columns, node heights by value, stacked link bands, d3-sankey's relaxation |
32
+ | `layeredLayout(nodes, links, traits, options)`, `layeredLayoutAsync(…)` | Sugiyama drawing: ranks, crossing reduction, Brandes–Köpf coordinates |
33
+ | `forceDirectedLayout(nodes, links, traits, options)`, `forceDirectedLayoutAsync(…)` | d3-force's simulation run to a fixed iteration count, positions as `Float64Array` |
34
+ | `createForceStep(nodes, links, traits, options)` | One velocity-Verlet step over caller-owned arrays, for an animation loop |
35
+ | `ForceTraits`, `ForceOptions`, `ForceStep`, `ForceDirectedLayoutOptions` | The force layout's traits, options and step types |
36
+ | `HierarchyTable`, `HierarchyPointLayout`, `HierarchyBoxLayout`, `TreeTraits`, … | The shared result and traits types |
37
+
38
+ ## Force layout
39
+
40
+ Network layouts take explicit links (`sourceOf`, `targetOf` return indices into
41
+ `nodes`) and return `Float64Array` buffers in input order. The force layout
42
+ applies link, many-body (Barnes–Hut by default, `"exact"` on request),
43
+ collision, gravity and centring forces, then velocity decay, as d3-force does.
44
+ `random` is required: pass a seeded generator such as `mulberry32(seed)`, which
45
+ separates coincident nodes reproducibly.
46
+
47
+ Barnes–Hut is a bounded approximation of `"exact"` whose error tends to 0 with
48
+ θ (Barnes and Hut 1986). A cell is never summarised while the node lies inside
49
+ it, enlarged by 20 % as in GADGET-2 (Springel 2005), so a node never feels its
50
+ own charge however large θ is, the failure Salmon and Warren (1994) show
51
+ unbounds the plain criterion. Each cell keeps its positive and its negative
52
+ charges as two monopoles, so each monopole's error is bounded as for same-sign
53
+ charges and a cell whose charges sum to zero still acts: a node's error is
54
+ bounded relative to its unsigned contributions, Σ |q| / d over the other
55
+ bodies, not relative to its net force, which cancelling charges can make far
56
+ smaller than that error. `distanceMax` applies to each body: a cell straddling
57
+ it is opened. Differences, means, distances, the cutoff, the `distanceMin`
58
+ clamp and the force are scaled by powers of two wherever they, a square or the
59
+ clamp's product would underflow or overflow, cell centres are running means,
60
+ and positions beyond the quadtree's ±1e150 are indexed scaled, so any finite
61
+ coordinates and charges keep their force. Every force and the integration keep
62
+ positions and velocities finite for any finite inputs and options: one whose
63
+ exact value lies beyond the doubles saturates at ±`Number.MAX_VALUE`.
64
+ Collisions widen their pruning by how far any node
65
+ has moved in the pass (the skin of Verlet's neighbour lists), so a node pushed
66
+ into another's reach earlier in the same pass is still caught; the active
67
+ node's own prediction is refreshed after each push and its walk repeated on it,
68
+ so its later pairs are tested where it now stands. A self-link exerts no force.
69
+
70
+ `compatibility: "d3-force"` reproduces d3-force 3 to rounding instead, quirks
71
+ included: with the same random source, Barnes–Hut mode then matches d3-force's
72
+ own Barnes–Hut (same θ) and `"exact"` mode matches d3-force with θ = 0. A
73
+ pinned axis keeps its pin even when the node has no initial position (d3-force
74
+ would replace it with the phyllotaxis coordinate until the first tick).
75
+
76
+ ```ts
77
+ import { forceDirectedLayout, createForceStep } from "@ac-kit/math-graph";
78
+ import { mulberry32 } from "@ac-kit/math-random";
79
+
80
+ const nodes = ["a", "b", "c", "d"];
81
+ const links: [number, number][] = [
82
+ [0, 1],
83
+ [1, 2],
84
+ [2, 3],
85
+ [3, 0],
86
+ ];
87
+ const traits = {
88
+ sourceOf: (link: [number, number]) => link[0],
89
+ targetOf: (link: [number, number]) => link[1],
90
+ };
91
+ const positions = forceDirectedLayout(nodes, links, traits, {
92
+ random: mulberry32(1),
93
+ });
94
+
95
+ // An animation loop owns the state and ticks the step.
96
+ const step = createForceStep(nodes, links, traits, { random: mulberry32(1) });
97
+ const velocities = new Float64Array(positions.length);
98
+ step(positions, velocities, 0.3);
99
+ ```
100
+
101
+ `forceDirectedLayout` takes an optional `budget` charged `n + m` per step;
102
+ `forceDirectedLayoutAsync` takes `signal` and `sliceMs`, yields between steps
103
+ and returns the same result.
104
+
105
+ ## Layered layout
106
+
107
+ `layeredLayout` reduces crossings with barycentre and median sweeps (Sugiyama,
108
+ Tagawa and Toda 1981; Eades and Wormald 1994) and adjacent transpositions
109
+ (Gansner et al. 1993) from two depth-first starting orders. With
110
+ `orderingEffort: "thorough"`, the default, it then sifts (Matuszewski,
111
+ Schönfeld and Molitor 1999): each vertex in turn moves to the slot of its layer
112
+ with the fewest crossings, which leaves the local minima the sweeps stop in, at
113
+ O(k · e) per round and layer of k vertices and e segments. `"fast"` stops after
114
+ the sweeps. Either effort returns the fewest-crossing order it saw, and
115
+ `"thorough"` never has more crossings than `"fast"`. `sankeyLayout`'s
116
+ `ordering: "crossings"` takes the same `orderingEffort`.
117
+
118
+ See the [generated API docs](https://anthochamp.pages.grenadine.io/node-essentials/api/math-graph/)
119
+ for the full reference.
@@ -0,0 +1,12 @@
1
+ export * from "./layout/circular-layout.js";
2
+ export * from "./layout/create-force-step.js";
3
+ export * from "./layout/dendrogram-layout.js";
4
+ export * from "./layout/force-directed-layout.js";
5
+ export * from "./layout/layered-layout.js";
6
+ export * from "./layout/partition-layout.js";
7
+ export * from "./layout/phyllotaxis-layout.js";
8
+ export * from "./layout/sankey-layout.js";
9
+ export * from "./layout/tidy-tree-layout.js";
10
+ export * from "./layout/treemap-layout.js";
11
+ export type { AsyncLayoutOptions, HierarchyBoxLayout, HierarchyOrder, HierarchyPointLayout, HierarchyTable, HierarchyWalkOptions, NetworkTraits, TreeSizeOptions, TreeTraits, ValuedHierarchyTraits, } from "./layout/types.js";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,YAAY,EACX,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,UAAU,EACV,qBAAqB,GACrB,MAAM,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ export * from "./layout/circular-layout.js";
2
+ export * from "./layout/create-force-step.js";
3
+ export * from "./layout/dendrogram-layout.js";
4
+ export * from "./layout/force-directed-layout.js";
5
+ export * from "./layout/layered-layout.js";
6
+ export * from "./layout/partition-layout.js";
7
+ export * from "./layout/phyllotaxis-layout.js";
8
+ export * from "./layout/sankey-layout.js";
9
+ export * from "./layout/tidy-tree-layout.js";
10
+ export * from "./layout/treemap-layout.js";
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,227 @@
1
+ import type { RandomFn } from "@ac-kit/core";
2
+ export type LinkForceData = {
3
+ readonly sources: Uint32Array;
4
+ readonly targets: Uint32Array;
5
+ readonly distances: Float64Array;
6
+ readonly strengths: Float64Array;
7
+ /** Share of the correction taken by the target. */
8
+ readonly biases: Float64Array;
9
+ readonly iterations: number;
10
+ };
11
+ /**
12
+ * Springs between linked nodes, on positions advanced by their velocities (the
13
+ * velocity-Verlet predictor); the correction goes to the velocities. A link
14
+ * whose squared length, ratio `(l − d) / l` or move would leave the doubles is
15
+ * settled on lengths scaled by a power of two, each end's share applied before
16
+ * scaling back, so that it pulls or pushes wherever its share of the move is
17
+ * finite (a rest length of `Number.MAX_VALUE` included).
18
+ */
19
+ export declare function applyLinkForce(positions: Float64Array, velocities: Float64Array, alpha: number, data: LinkForceData, random: RandomFn): void;
20
+ export type ManyBodyOptions = {
21
+ readonly approximation: "barnesHut" | "exact";
22
+ readonly theta: number;
23
+ readonly distanceMin: number;
24
+ readonly distanceMax: number;
25
+ readonly random: RandomFn;
26
+ /** D3-force's Barnes–Hut criterion and its quirks (`compatibility`). */
27
+ readonly isD3: boolean;
28
+ };
29
+ /**
30
+ * Charges repelling or attracting each other with strength / distance, every
31
+ * pair in `"exact"` mode or Barnes–Hut (Barnes and Hut, "A hierarchical O(N log
32
+ * N) force-calculation algorithm", Nature 324, 1986) over a `Quadtree`.
33
+ *
34
+ * Each cell keeps two monopoles: the sum of its positive charges at their
35
+ * centre, and the sum of its negative charges at theirs. A cell is summarised
36
+ * only when each of its monopoles looks small enough from the node (width / θ <
37
+ * the distance to that monopole's centre, d3-force's form of the criterion), so
38
+ * each monopole's error is bounded relative to its own charge over its
39
+ * distance, as for same-sign charges, and a cell is never skipped because its
40
+ * charges sum to 0. The error of a node's force is therefore bounded relative
41
+ * to its unsigned contributions, Σ |q_j| / d_j over the other bodies, not
42
+ * relative to the net force: where contributions of opposite signs cancel, the
43
+ * net force can be any number of times smaller than that error. A cell is
44
+ * always opened when the node lies inside it, enlarged by 20 % (Springel, "The
45
+ * cosmological simulation code GADGET-2", MNRAS 364, 2005, §3.1), so no node
46
+ * feels its own charge however large θ is: the self-interaction that Salmon and
47
+ * Warren ("Skeletons from the treecode closet", J. Comput. Phys. 111, 1994)
48
+ * show unbounds the error of the plain criterion. A cell that straddles
49
+ * `distanceMax` is opened too, so the cutoff applies to each body, as in
50
+ * `"exact"` mode. Centres are running charge-weighted means (a convex
51
+ * combination where a step would overflow), differences beyond the doubles are
52
+ * taken from halves, distances, the cutoff, the clamp and the force are scaled
53
+ * by powers of two wherever a square would underflow or overflow, a cell's
54
+ * charge sums by the power of two that keeps the total of every |charge|
55
+ * finite, and positions beyond the quadtree's ±1e150 are indexed scaled by a
56
+ * power of two (the cells scaled back), so any finite coordinates, distances
57
+ * down to the least subnormal and charges up to the double range keep their
58
+ * force; a velocity beyond the doubles saturates at ±`Number.MAX_VALUE`.
59
+ *
60
+ * `isD3` keeps d3-force's own approximation instead: one signed monopole at the
61
+ * |charge|-weighted centre, a cell summarised even when it holds the node,
62
+ * `distanceMax` tested against the cell's centre, cells whose charges sum to 0
63
+ * skipped, and coincident offsets drawn whenever one axis difference is 0.
64
+ */
65
+ export declare class ManyBodyForce {
66
+ private readonly charges;
67
+ private readonly options;
68
+ private readonly tree;
69
+ /** Positive charge of each cell (its signed sum when `isD3`). */
70
+ private values;
71
+ private centersX;
72
+ private centersY;
73
+ /** Negative charge of each cell (unused when `isD3`). */
74
+ private negativeValues;
75
+ private negativeCentersX;
76
+ private negativeCentersY;
77
+ private readonly scratch;
78
+ private positions;
79
+ private velocities;
80
+ private readonly order;
81
+ private orderLength;
82
+ private readonly isExact;
83
+ private readonly isD3;
84
+ private readonly isInert;
85
+ private readonly theta2;
86
+ private readonly distanceMin2;
87
+ private readonly distanceMax2;
88
+ /**
89
+ * The charges a cell sums, scaled down by `monopoleScale`, a power of two
90
+ * from 1 up: so far that the sum of every |charge| stays finite, and no
91
+ * further, so a charge loses no digit unless it is subnormal already.
92
+ */
93
+ private readonly scaledCharges;
94
+ private readonly monopoleScale;
95
+ /**
96
+ * Positions scaled into the quadtree's range when one lies beyond it (grown,
97
+ * then reused), and the power of two the tree's cells are to be multiplied
98
+ * by: 1 while the positions are indexed as they are.
99
+ */
100
+ private treePositions;
101
+ private cellScale;
102
+ constructor(charges: Float64Array, options: ManyBodyOptions);
103
+ apply(positions: Float64Array, velocities: Float64Array, alpha: number): void;
104
+ /**
105
+ * Indexes the positions, scaled by a power of two into the quadtree's range
106
+ * where one lies beyond it: the cells are then `cellScale` times the tree's,
107
+ * and every force still reads the positions themselves.
108
+ */
109
+ private assignTree;
110
+ /**
111
+ * Every pair, the others taken in the tree's leaf order: the order the
112
+ * Barnes–Hut walk sums them in, so exact and approximate runs differ only by
113
+ * the approximation, not by rounding that chaotic dynamics would amplify.
114
+ */
115
+ private applyExact;
116
+ private readonly collectLeaves;
117
+ /**
118
+ * `isD3`: signed charge and |charge|-weighted centre of every cell, children
119
+ * first.
120
+ */
121
+ private readonly accumulateD3;
122
+ /**
123
+ * Positive and negative charge of every cell, scaled down by `monopoleScale`,
124
+ * each at its own charge-weighted centre, children first. A sign with no
125
+ * charge has its centre at the origin; it is never read.
126
+ */
127
+ private readonly accumulate;
128
+ /**
129
+ * The Barnes–Hut walk for the node in `scratch`: a cell is summarised by its
130
+ * two monopoles, opened, or skipped whole (no charge, or every body beyond
131
+ * `distanceMax`); a leaf is summed body by body.
132
+ */
133
+ private readonly visit;
134
+ /**
135
+ * Every body of the leaf `node` but the node in `scratch`, as `"exact"` sums
136
+ * them: the cutoff per body, coincident bodies parted by a jiggle.
137
+ */
138
+ private applyLeaf;
139
+ /** `isD3`: d3-force's walk, quirks included (see the class). */
140
+ private readonly visitD3;
141
+ /**
142
+ * {@link visitD3} for a cell whose centre is so far from the node that the
143
+ * difference leaves the doubles (taken from halves in `PAIR_`): d3-force's
144
+ * tests on scaled lengths, and the force from `addPull_`. No offset is drawn,
145
+ * as the two cannot coincide.
146
+ */
147
+ private visitD3Wide;
148
+ }
149
+ /**
150
+ * Pushes overlapping discs apart, nodes tested on their predicted positions
151
+ * (position + velocity). The tree prunes cells by their largest radius, so the
152
+ * result is exact whatever the many-body approximation. The pruning is widened
153
+ * by how far any prediction has moved since the pass started (the "skin" of
154
+ * Verlet's neighbour lists: Verlet, Phys. Rev. 159, 1967), so a node pushed
155
+ * into another's reach by an earlier pair of the same pass is still tested, and
156
+ * every pair of a chain of coincident nodes collides. The active node's own
157
+ * prediction is refreshed after each push, and its walk repeated on the moved
158
+ * prediction (skipping the pairs already pushed) until a walk pushes none, so
159
+ * no later pair is tested on where it no longer stands. Where a squared radius,
160
+ * reach or distance would overflow or underflow, the pair is settled on lengths
161
+ * scaled by a power of two and the shares on the ratio of the radii, each
162
+ * node's share applied before scaling back, so any finite radii and distances
163
+ * push (radii of `Number.MAX_VALUE` included) and only a node's part of a
164
+ * displacement beyond the doubles overflows.
165
+ *
166
+ * `isD3` keeps d3-force's behaviour instead: cells bounded on the predictions
167
+ * made when the pass starts, so such a pair is missed until the next pass, and
168
+ * only the newest node of a coincident chain tested (and its radius taken as
169
+ * the leaf's).
170
+ */
171
+ export declare class CollideForce {
172
+ private readonly radii;
173
+ private readonly strength;
174
+ private readonly iterations;
175
+ private readonly random;
176
+ private readonly isD3;
177
+ private readonly tree;
178
+ private readonly predicted;
179
+ /**
180
+ * Per node, the walk (`scratch[7]`) that last pushed it against the active
181
+ * node.
182
+ */
183
+ private readonly pushedIn;
184
+ private cellRadii;
185
+ private readonly scratch;
186
+ private positions;
187
+ private velocities;
188
+ /** The power of two the tree's cells are to be multiplied by. */
189
+ private cellScale;
190
+ constructor(radii: Float64Array, strength: number, iterations: number, random: RandomFn, isD3: boolean);
191
+ apply(positions: Float64Array, velocities: Float64Array): void;
192
+ /**
193
+ * Indexes the predictions `position + velocity`, scaled by a power of two
194
+ * into the quadtree's range where one lies beyond it (or beyond the doubles):
195
+ * the cells are then `cellScale` times the tree's.
196
+ */
197
+ private assignTree;
198
+ /**
199
+ * Writes the node's prediction into `scratch[0]` and `scratch[1]`, for the
200
+ * pruning test: saturated at ±`Number.MAX_VALUE` beyond the doubles, which
201
+ * only prunes less.
202
+ */
203
+ private notePrediction;
204
+ /** Largest radius under every cell (`isD3`: a leaf's newest node's). */
205
+ private readonly prepare;
206
+ private readonly visit;
207
+ /**
208
+ * Cells were bounded on the predictions made at the start of the pass; the
209
+ * pruning test widens them by how far any prediction has moved since (in the
210
+ * tree's units, scaled back: beyond the doubles it only prunes less).
211
+ */
212
+ private noteShift;
213
+ }
214
+ /** Pull of strength · alpha toward `(centerX, centerY)` on each axis. */
215
+ export declare function applyGravity(positions: Float64Array, velocities: Float64Array, alpha: number, strength: number, centerX: number, centerY: number): void;
216
+ /**
217
+ * Shifts every position so that their mean moves `strength` of the way to the
218
+ * centre.
219
+ */
220
+ export declare function applyCentering(positions: Float64Array, strength: number, centerX: number, centerY: number): void;
221
+ /**
222
+ * Velocity Verlet: v ← v · keep, x ← x + v; a pinned axis (finite entry of
223
+ * `fixedPositions`) is set to its pin with zero velocity. A position beyond the
224
+ * doubles saturates at ±`Number.MAX_VALUE`.
225
+ */
226
+ export declare function integrate(positions: Float64Array, velocities: Float64Array, keep: number, fixedPositions: Float64Array | undefined): void;
227
+ //# sourceMappingURL=_force-forces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_force-forces.d.ts","sourceRoot":"","sources":["../../src/layout/_force-forces.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AA8H7C,MAAM,MAAM,aAAa,GAAG;IAC3B,QAAQ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