Skip to content

@graphty/graphty-element / session / PlanEffect

Type Alias: PlanEffect ​

PlanEffect = { edges: number; exact: boolean; kind: "match"; nodes: number; sampled?: number; } | { attributesChanged: number; byType?: Readonly<Record<string, number>>; edgesAdded: number; edgesRemoved: number; kind: "mutate"; nodesAdded: number; nodesRemoved: number; } | { fields: readonly FieldDescriptor[]; kind: "write"; } | { bytes: number; elements: number; exact: boolean; kind: "bytes"; } | { bytes: number; height: number; kind: "image"; legendChannels: number; nodesInFrame: number; width: number; } | { kind: "none"; }

Defined in: graphty-element/src/session/planning.ts:122

What a command would change, in the shape that command's own preview takes.

The whole union is declared rather than only the members a command produces today, because a consumer switching on effect.kind must be able to write the switch once and have it stay valid as commands arrive. An algorithm run produces write; a command that previews nothing produces none.

Union Members ​

Type Literal ​

{ edges: number; exact: boolean; kind: "match"; nodes: number; sampled?: number; }

edges ​

readonly edges: number

The edges it would match.

exact ​

readonly exact: boolean

Whether the counts were counted or estimated.

kind ​

readonly kind: "match"

How many elements a selector, filter or search would match.

nodes ​

readonly nodes: number

The nodes it would match.

sampled? ​

readonly optional sampled?: number

How many elements were sampled, when they were estimated.


Type Literal ​

{ attributesChanged: number; byType?: Readonly<Record<string, number>>; edgesAdded: number; edgesRemoved: number; kind: "mutate"; nodesAdded: number; nodesRemoved: number; }

attributesChanged ​

readonly attributesChanged: number

Attribute values it would change.

byType? ​

readonly optional byType?: Readonly<Record<string, number>>

The same counts broken down by record type, when the command knows them.

edgesAdded ​

readonly edgesAdded: number

Edges it would add.

edgesRemoved ​

readonly edgesRemoved: number

Edges it would remove.

kind ​

readonly kind: "mutate"

What a change to the graph would add, remove and alter.

nodesAdded ​

readonly nodesAdded: number

Nodes it would add.

nodesRemoved ​

readonly nodesRemoved: number

Nodes it would remove.


Type Literal ​

{ fields: readonly FieldDescriptor[]; kind: "write"; }

fields ​

readonly fields: readonly FieldDescriptor[]

The fields.

kind ​

readonly kind: "write"

The fields a run would publish.


Type Literal ​

{ bytes: number; elements: number; exact: boolean; kind: "bytes"; }

bytes ​

readonly bytes: number

The byte count.

elements ​

readonly elements: number

How many elements it would carry.

exact ​

readonly exact: boolean

Whether the counts were counted or estimated.

kind ​

readonly kind: "bytes"

How large an export would be.


Type Literal ​

{ bytes: number; height: number; kind: "image"; legendChannels: number; nodesInFrame: number; width: number; }

bytes ​

readonly bytes: number

Its size in bytes.

height ​

readonly height: number

Its height in pixels.

kind ​

readonly kind: "image"

What an image export would contain.

legendChannels ​

readonly legendChannels: number

How many channels the legend would carry.

nodesInFrame ​

readonly nodesInFrame: number

How many nodes would be in the frame.

width ​

readonly width: number

Its width in pixels.


Type Literal ​

{ kind: "none"; }

kind ​

readonly kind: "none"

Nothing to preview.