Skip to content

@graphty/graphty-element / session / CreateGraphSessionOptions

Interface: CreateGraphSessionOptions ​

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

What createGraphSession accepts.

The session is the only writer of its graph and its settings, which is what makes every change undoable: hand data in through session.data.import, addNodes and addEdges, and settings through session.config.set.

Properties ​

acceleration? ​

readonly optional acceleration?: AccelerationControllerLike

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

An acceleration controller to publish capabilities from, so a host that already owns one does not end up with two. When absent the session builds one and disposes it with itself.


config? ​

readonly optional config?: object

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

The configuration. Every part not given takes the element's own default.

acceleration? ​

readonly optional acceleration?: object

The acceleration policy and threshold.

acceleration.minNodes? ​

readonly optional minNodes?: number

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

acceleration.policy? ​

readonly optional policy?: AccelerationPolicy

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

data? ​

readonly optional data?: object

The data configuration the session starts from; any part left out takes its default. Change it later with config.set.

data.algorithms? ​

readonly optional algorithms?: (string | { algorithm: string; as?: string; params?: Record<string, unknown>; seed?: number; style?: boolean | { size?: ... | ... | ... | ...; }; })[]

data.directed? ​

readonly optional directed?: boolean | "auto"

data.knownFields? ​

readonly optional knownFields?: Partial<{ edgeDstIdPath: string | null; edgeIdPath: string | null; edgeSrcIdPath: string | null; edgeTimePath: string | null; edgeWeightPath: string | null; idCoercion: "keep" | "canonical"; nodeIdPath: string; nodeLabelPath: string | null; nodeTimePath: string | null; nodeWeightPath: string | null; positionScale: number; repeatedEdges: "error" | "min" | "max" | "keep" | "first" | "last" | "sum"; }>


runs? ​

readonly optional runs?: SessionRunsOptions

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

How this session runs algorithms.