@graphty/graphty-element / session / SessionConfig
Interface: SessionConfig ​
Defined in: graphty-element/src/session/types.ts:1337
The session's settings as they are now: every project setting, read live, and the acceleration policy, which is a preference about this machine and not saved in a project.
Extends ​
Properties ​
acceleration ​
readonlyacceleration:object
Defined in: graphty-element/src/session/types.ts:1347
What the consumer asked of the hardware.
minNodes ​
readonlyminNodes:number
The node count at or above which accelerated work actually uses the accelerator.
policy ​
readonlypolicy:AccelerationPolicy
Use an accelerator when one is available, never look, or refuse to run without one.
author? ​
readonlyoptionalauthor?:string
Defined in: graphty-element/src/session/types.ts:1307
Who is writing: stamped on each note added from now on. Absent when no name is set, never blank. A claim, never a verified identity.
Inherited from ​
background ​
readonlybackground: {backgroundType:"color";color:string|undefined; } | {backgroundType:"skybox";data:string; }
Defined in: graphty-element/src/session/types.ts:1287
What the graph is drawn against: a colour or a skybox.
Inherited from ​
data ​
readonlydata:SessionDataConfig
Defined in: graphty-element/src/session/types.ts:1283
Inherited from ​
layoutBehavior ​
readonlylayoutBehavior:object
Defined in: graphty-element/src/session/types.ts:1295
The layout-behaviour settings a project file saves. The rest of the element's layoutBehavior (label declutter, pin on drag, throughput tuning) is a preference of the view and not a project setting.
minDelta ​
readonlyminDelta:number
The movement below which a simulation counts as settled.
preSteps ​
readonlypreSteps:number
Simulation steps run before the first frame is drawn.
stepMultiplier ​
readonlystepMultiplier:number
Simulation steps per frame.
Inherited from ​
name? ​
readonlyoptionalname?:string
Defined in: graphty-element/src/session/types.ts:1309
The project's name, which a project file carries. Absent when none is set, never blank.
Inherited from ​
runAlgorithmsOnLoad ​
readonlyrunAlgorithmsOnLoad:boolean
Defined in: graphty-element/src/session/types.ts:1285
Whether the algorithms in data.algorithms run once data has loaded.
Inherited from ​
ProjectConfig.runAlgorithmsOnLoad
selectionStyle ​
readonlyselectionStyle:object
Defined in: graphty-element/src/session/types.ts:1289
What a selected node's halo looks like.
color ​
color:
string
The halo's colour. Any colour the element understands; normalised to hex on parse.
opacity ​
opacity:
number
How solid the halo is, in [0, 1]. Low enough to read as a highlight rather than a node.
scale ​
scale:
number
How much of the node's own size the halo is drawn at.
Greater than 1 puts a ring around the node, which is what a highlight reads as. Below 1 the halo disappears inside the node it is meant to mark, so the schema takes any positive number and the default stands a little clear of the node.
Inherited from ​
Methods ​
set() ​
set(
values):Promise<void>
Defined in: graphty-element/src/session/types.ts:1345
Change project settings. One step, which undo takes back.
Parameters ​
values ​
The settings to change.
Returns ​
Promise<void>
Settles once the step is recorded and the picture has caught up.
Throws ​
A GraphtyError (as a rejection) with E_BAD_COMMAND when a key is not a project setting or a value is one its setting refuses; nothing is changed then.