code wiki / _hdl_build / nx_viz_force.nx
nx_viz_force.nx
buildroot/runtime/_hdl_build/nx_viz_force.nx
about
nx_viz_force.nx -- the FORCE layer of the sovereign Nishi viz library (the d3-force equivalent, bits-up).
Fruchterman-Reingold force-directed graph layout, pure integer/fixed-point: repulsion between ALL node pairs
(k^2/d), attraction along edges (d^2/k), temperature cooling. Mutates xs/ys in place; DETERMINISTIC (no RNG).
Turns node+edge data (genealogy / WMS streams / memory link-graph) into a laid-out graph. k = ideal edge
length = isqrt(W*H/n). Closes layout-force. license_tier: ORIGINAL
dependencies 2 imports · 2 importers
imports: nx_viz_trig.nxnx_syscalls.nx
imported by: nx_viz_force_gate.nxnx_viz_graph.nx
structs
| none |
consts
| 8 | const K_MAGIC_32768: i64 = 32768 |
| 9 | const K_MAGIC_100000000: i64 = 100000000 |
functions
| 14 | func vf_layout(n: i64, xs: *i64, ys: *i64, m: i64, ea: *i64, eb: *i64, W: i64, H: i64, iters: i64, grav: i64) -> i64 |
| 91 | func main() -> i64 { return 0 } |