You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
layout_by_kind(graph) (new): a world nobody laid out, laid out from its graph as world_graph answers it. Each kind gets an anchor on a circle, links act as springs and neighbours push apart for 320 seeded steps (160 past 2,000 elements), then the points are fitted into a frame of -1 to 1. Answers {"method": "by-kind", "version": 1, "points": [{"id", "x", "y"}, ...]} in the caller's node order. The graph is first put in one order (nodes by id; edges by source, field, index, then target, by code point), so a graph handed in another order gives the same points by id. The anchors are a baked table, never computed with the runtime's cosine and sine, so the points equal the npm SDK's layoutByKind to the last bit; the shared fixture tests/fixtures/layout/by-kind.json is replayed exactly.
layout_around(graph, focus, *, steps=1) (new): one element at 0, 0, its neighbours on rings round it in colour group, type and name order (names by code point), and with steps=2 their neighbours fanned out beyond. Answers {"method": "around", "version": 1, "points": [{"id", "depth", "x", "y"}, ...]} in the caller's node order, only the elements within the steps, from the same one order; within 1e-12 of the npm SDK's layoutAround. A focus that is not a node or a steps other than 1 or 2 is a ValueError.