Skip to content

@graphty/graphty-element / session / SessionGraphStore

Interface: SessionGraphStore ​

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

What the session needs from the one graph-format builder behind it.

It is an interface rather than the concrete GraphStore because the element's DataManager owns the store for a rendered graph and answers exactly these three members, while a headless session builds a GraphStore of its own. Both are "the store" as far as the session is concerned, and the session disposes only the one it made.

Properties ​

directionSettledBy ​

readonly directionSettledBy: DirectionProvenance

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

How the direction of the graph in this store was settled, and by what text.

The store is where the answer lives because the snapshot cannot carry it: a snapshot holds one direction FLAG and no record of who set it, and by the time statistics are computed the importer that read the file has been thrown away.


lastImport? ​

readonly optional lastImport?: LoadReport | null

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

What the last load into this store did: which endpoint spelling answered, how many repeated edges were seen and what the policy did with them, and how many edges the graph holds.

Optional because a store built by a session that nothing ever imported into has never had a load to report on.


positions ​

readonly positions: ReadonlyElementPositions

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

The element-owned node coordinates, indexed by dense node index, read-only.


seededNodeCount ​

readonly seededNodeCount: number

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

How many nodes the DATA arrived carrying a coordinate for.

THE HONEST ANSWER to "did the file that loaded this graph place its nodes", which ReadonlyElementPositions.placedCount cannot give: the position array is written by the importer AND by every running layout, so a moment after a file with no coordinates loads, every node carries a position because the layout put it there. This counts the importer's own seed column, which nothing but the importer writes.

Returns ​

the count, zero for a graph with no data

Methods ​

getSnapshot() ​

getSnapshot(): GraphSnapshot

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

The current snapshot, freezing first when records have arrived since the last one.

Returns ​

GraphSnapshot

the immutable snapshot


undirected() ​

undirected(snapshot): DerivedGraph

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

The undirected view of a snapshot, built once per snapshot and cached.

Parameters ​

snapshot ​

GraphSnapshot

a snapshot this store produced

Returns ​

DerivedGraph

the derived graph