Repository navigation
OnlyWorlds Unity SDK 0.42.0
The default layout method: a world's default picture and one element's, the same points as the
TypeScript SDK and the Python package. A minor release: it adds public API.
Added
OWLayout.LayoutByKind(graph)andOWLayout.LayoutAround(graph, focus, steps = 1): a world's default
picture and one element's, the TypeScript SDK'slayoutByKindandlayoutAround(4.167.0) and the Python package's
layout_by_kindandlayout_around(0.127.0). By kind: each kind of element gets a point on a circle, links act as
springs and neighbours push apart for a fixed number of seeded steps, and the answer is fitted into a frame of -1 to- Around: the focus at 0, 0, its neighbours on rings round it, and with
steps2 their neighbours fanned out
beyond. Each takes anOWWorldGraphor aJObject{nodes, edges}in the TypeScript SDK's words, puts it in one
order first (so the order it is handed in moves nothing), and answersOWLayoutByKindorOWLayoutAround(Method,
Version1,Pointsin the order the nodes were handed in). A graph it cannot read is anArgumentException
naming what. The same graph gives the same points as the two packages: by kind to the last bit, around within
1e-12 (its cosines and sines are the runtime's). The kinds' anchors on the circle are a table of bit patterns
(OWLayout.Anchors.cs, generated bycodegen/generate_layout_anchors.pyfrom the shared fixture), never computed,
andMath.minandMath.maxare JavaScript's (Mono'sMath.Minanswers its second argument on a tie of +0 and
-0). The shared fixture (test/fixtures/layout/by-kind.json, sha25606a023ea…, vendored in
Tests/Editor/Fixtures/layout/) runs whole: its 12 by-kind cases bit for bit and its 7 around cases. Checked
against the TypeScript SDK on 1,500 random graphs as well: 159,081 by-kind points equal to the bit and 705 around
runs within 1e-12.
- Around: the focus at 0, 0, its neighbours on rings round it, and with