hatvis.layout#

Vertex layouts for node-link hypergraph drawings.

  • layout_similarity() — the HAT-VIS layout (Czvetkó and Abonyi 2024): vertex similarity, transitive closure, classical multidimensional scaling (or Sammon mapping); positions carry meaning, close vertices are similar;

  • layout_force() — the force-directed layout of HyperGodot (Ficsor et al. 2025): springs between every vertex and the centroid of each of its hyperedges, inverse-square repulsion between all vertices;

  • layout_membership() — a new membership-aware layout of this package: stress majorization towards the similarity distances, interleaved with a projection step that pushes non-member vertices out of the disc of every hyperedge, so that hulls contain fewer foreign vertices;

  • circular, grid, radial (breadth-first from the most central vertex), spectral and bipartite (star-expansion spring) layouts.

All functions return dict label -> numpy.ndarray([x, y]) scaled to the unit box \([0,1]^2\) (aspect ratio kept).

Similarity (HAT-VIS), force-directed (HyperGodot), membership-aware, circular, radial, spectral and bipartite layouts; layout quality.

Functions#

classical_mds(D[, dim])

Classical (Torgerson) multidimensional scaling.

sammon(D[, dim, init, max_iter, tol, max_halves])

Sammon mapping (Sammon 1969) of a dissimilarity matrix.

layout_similarity(H[, measure, transitive, ...])

Similarity-preserving layout (HAT-VIS).

layout_force(H[, iterations, repulsion, ...])

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

layout_membership(H[, init, n_iter, ...])

Membership-aware layout (new in hatvis).

layout_circular(H[, order])

Vertices evenly on a circle; order="seriation" uses the barycentric order to shorten hyperedge spans.

layout_grid(H[, order])

Vertices on a square grid (row-major, in vertex order or the given order).

layout_radial(H[, center])

Radial layout: the most central vertex (largest degree) in the middle, the others on rings by graph distance.

layout_spectral(H[, kind])

Coordinates from the two leading non-trivial Laplacian eigenvectors (Zhou et al. 2006).

layout_bipartite(H[, iterations, k, ...])

Spring layout of the star expansion; hyperedges act as hidden attractor nodes.

edge_centroids(H, pos)

Centroid of the member positions of every non-empty hyperedge.

layout_quality(H, pos[, pad, measure, ...])

Quality of a layout for hypergraph drawing.

normalize_layout(Y, labels[, margin])

Scale coordinates to the unit box (keeping the aspect ratio) and return a label dict.