@graphty/graphty-element / extend / LayoutDefinition
Interface: LayoutDefinition<O> ​
Defined in: graphty-element/src/simple/types.ts:332
What defineLayout takes: an id, options in short form and place.
Extends ​
Type Parameters ​
O ​
O extends OptionsShorthand
Properties ​
description? ​
readonlyoptionaldescription?:string
Defined in: graphty-element/src/simple/types.ts:87
One sentence for pickers and the catalogue. Default: "".
Inherited from ​
dimensions? ​
readonlyoptionaldimensions?:2|3
Defined in: graphty-element/src/simple/types.ts:334
The most dimensions the layout uses. Default 3.
id ​
readonlyid:string
Defined in: graphty-element/src/simple/types.ts:83
Permanent id: lower case, hyphenated, vendor-prefixed ("acme-hop-reach"). Kept unchanged when the extension graduates.
Inherited from ​
name? ​
readonlyoptionalname?:string
Defined in: graphty-element/src/simple/types.ts:85
What pickers show. Default: the id in sentence case ("acme-hop-reach" reads "Acme hop reach").
Inherited from ​
options? ​
readonlyoptionaloptions?:O
Defined in: graphty-element/src/simple/types.ts:89
The options a reader may set, in short form: { spacing: 2, weight: { type: "attribute", on: "edge" } }.
Inherited from ​
place ​
readonlyplace: (graph,context) =>ReadonlyMap<NodeId,Point|null> |Promise<ReadonlyMap<NodeId,Point|null>>
Defined in: graphty-element/src/simple/types.ts:343
Where each node goes, in scene units (a node at the default size is 1 unit across; +x is right and +y is up, as in the scene). A node missing from the map, or mapped to null or to a non-finite number, is UNPLACED. A value for a pinned or held node is ignored.
Parameters ​
graph ​
context ​
LayoutContext<OptionValuesOf<O>>
Returns ​
ReadonlyMap<NodeId, Point | null> | Promise<ReadonlyMap<NodeId, Point | null>>
random? ​
readonlyoptionalrandom?:boolean
Defined in: graphty-element/src/simple/types.ts:336
True when the result should change from run to run; the element then draws and records a seed.
version? ​
readonlyoptionalversion?:string
Defined in: graphty-element/src/simple/types.ts:91
The extension's own semver version, recorded as provenance.