English
@eightkk/vue-weave / core / graphLayoutChangeMetrics
Function: graphLayoutChangeMetrics()
graphLayoutChangeMetrics(
before,after,options?):GraphLayoutChangeMetrics
Defined in: src/core/graphIncremental.ts:449
Measures a layout change for tests and evaluation: how far the nodes that had a position moved, how many box pairs of the new layout overlap, and how many edge paths pass through boxes they do not connect (curves are sampled, so that count is approximate for curves). Boxes go into a bucket grid, so the cost grows with the number of boxes and path segments. It is a diagnostic of one change, not a quality score or benchmark. IDs of before without a box after are ignored, and edges without a path or end box are skipped. Throws RangeError for non-finite coordinates.
Parameters
before
ReadonlyMap<string, GraphPoint>
after
Pick<GraphLayout, "boxes"> & Partial<Pick<GraphLayout, "paths">>