Skip to content

@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 ​

readonly acceleration: object

Defined in: graphty-element/src/session/types.ts:1347

What the consumer asked of the hardware.

minNodes ​

readonly minNodes: number

The node count at or above which accelerated work actually uses the accelerator.

policy ​

readonly policy: AccelerationPolicy

Use an accelerator when one is available, never look, or refuse to run without one.


author? ​

readonly optional author?: 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 ​

ProjectConfig.author


background ​

readonly background: { 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 ​

ProjectConfig.background


data ​

readonly data: SessionDataConfig

Defined in: graphty-element/src/session/types.ts:1283

Inherited from ​

ProjectConfig.data


layoutBehavior ​

readonly layoutBehavior: 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 ​

readonly minDelta: number

The movement below which a simulation counts as settled.

preSteps ​

readonly preSteps: number

Simulation steps run before the first frame is drawn.

stepMultiplier ​

readonly stepMultiplier: number

Simulation steps per frame.

Inherited from ​

ProjectConfig.layoutBehavior


name? ​

readonly optional name?: 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 ​

ProjectConfig.name


runAlgorithmsOnLoad ​

readonly runAlgorithmsOnLoad: 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 ​

readonly selectionStyle: 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 ​

ProjectConfig.selectionStyle

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 ​

ProjectConfigPatch

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.