hatvis.layout.layout_force#

hatvis.layout.layout_force(H, iterations=500, repulsion=250.0, spring_length=30.0, spring_constant=0.1, damping=0.9, max_step=50.0, size=600.0, init=None, random_state=None)[source]#

Force-directed layout of HyperGodot (Ficsor et al. 2025).

In every iteration each vertex is pulled towards the centroid \(\mathbf{c}_e\) of each of its hyperedges by a Hooke spring of rest length \(l_0\) (spring_length) and constant \(k_s\), and pushed away from every other vertex by a force of magnitude \(k_r/\|\mathbf{p}_i-\mathbf{p}_j\|^2\) (repulsion; the inverse-square law of the HyperGodot source code); positions move by the damped net force. The defaults are the HyperGodot configuration (500 iterations, \(k_r=250\), \(l_0=30\), pixel units). max_step caps a single displacement for numerical safety.