Skip to content

@graphty/graphty-element / session / SessionEventMap

Interface: SessionEventMap ​

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

What a session publishes to whoever is watching it.

A map rather than a bare handler, so that the events arriving with the layout, the camera and the journal are added without changing a signature. An event that does not fire is not declared here: a consumer discovers the gap by autocomplete finding nothing rather than by subscribing to something silent.

Properties ​

capabilities:changed ​

capabilities:changed: object

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

Every acceleration transition; the document is the one capabilities returns.

capabilities ​

readonly capabilities: AccelerationCapabilities


history:changed ​

history:changed: object

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

The history changed: a step was recorded, merged, undone, redone, restored, evicted or cleared, or the pending work (and so what the next undo will do) changed. Fires synchronously after project:changed. Read session.history for the new state; its version has moved.

reason ​

readonly reason: "pending" | "record" | "size" | "merge" | "restore" | "undo" | "redo" | "clear" | "evict"


journal:appended ​

journal:appended: object

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

A command finished and the journal appended its entry: one event per entry.

entry ​

readonly entry: JournalEntry


note:changed ​

note:changed: NoteChange

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

A note was added, edited or removed: one event per note a write touched, after the write committed. A write that was refused, or that changed nothing, publishes nothing.


progress:changed ​

progress:changed: ProgressChange

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

A load or a run moved on, or stopped: one stream for every progress bar, which a session with no view publishes too. See ProgressChange.


project:changed ​

project:changed: object

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

Project state changed: the slices written and what wrote them. Fires synchronously, as soon as the state has changed and before the picture has caught up; the per-domain events (style:changed and the rest) follow once it has.

cause ​

readonly cause: HistoryCause

slices ​

readonly slices: readonly ProjectSlice[]


project:status ​

project:status: ProjectStatus

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

The project's name or whether it has unsaved changes (session.project.name, .dirty) changed. Mirrored on the element as graphty-project-status.


run:changed ​

run:changed: RunChange

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

A run reached one of the four watched moments.


selection:changed ​

selection:changed: SelectionDelta

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

Elements joined or left the selection.

Only a real movement arrives: selecting what is already selected changes nothing a listener could act on, and is not published.


set:changed ​

set:changed: SetChange

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

A kept set was created, renamed, redefined or removed: one event per set a write touched, after the write committed. A write that was refused publishes nothing.

Membership has no event: a set's members follow the data lazily, so a panel showing counts re-reads them on the events it already watches and on this one.


style:changed ​

style:changed: StyleChange

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

A layer was added, changed, removed or moved, and how much of the picture it repainted.

Published for every verb that changes the stack, including the ones that write several layers at once: one event per EDIT rather than one per layer, because an edit is what a consumer undoes, records and mirrors.


style:problem ​

style:problem: StyleProblem

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

The element tried to paint something of its own and was refused.

THE ONLY STYLE FAILURE A CONSUMER CANNOT OTHERWISE SEE. A style edit a consumer asks for rejects the promise it handed back, so the refusal arrives at the call that caused it. The element also paints on its own account -- a run's suggested encoding lands on the run's first completion, without anybody awaiting it -- and a refusal there had nowhere to go: the work is fire-and-forget by design, because the element must not make a consumer await the picture in order to have started the run. So it arrives here instead.

A graph that quietly kept the picture it had while the element believed it had painted a new one is the exact defect this whole style system replaces. Subscribe to this and a consumer can say "the degree colouring could not be applied" instead of leaving a reader looking at an old picture that reads as an answer.


visibility:changed ​

visibility:changed: VisibilityChange

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

A filter, the time window or the context flag changed what is showing.