@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: readonlyFieldDescriptor[];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 ​
readonlyedges:number
The edges it would match.
exact ​
readonlyexact:boolean
Whether the counts were counted or estimated.
kind ​
readonlykind:"match"
How many elements a selector, filter or search would match.
nodes ​
readonlynodes:number
The nodes it would match.
sampled? ​
readonlyoptionalsampled?: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 ​
readonlyattributesChanged:number
Attribute values it would change.
byType? ​
readonlyoptionalbyType?:Readonly<Record<string,number>>
The same counts broken down by record type, when the command knows them.
edgesAdded ​
readonlyedgesAdded:number
Edges it would add.
edgesRemoved ​
readonlyedgesRemoved:number
Edges it would remove.
kind ​
readonlykind:"mutate"
What a change to the graph would add, remove and alter.
nodesAdded ​
readonlynodesAdded:number
Nodes it would add.
nodesRemoved ​
readonlynodesRemoved:number
Nodes it would remove.
Type Literal ​
{ fields: readonly FieldDescriptor[]; kind: "write"; }
fields ​
readonlyfields: readonlyFieldDescriptor[]
The fields.
kind ​
readonlykind:"write"
The fields a run would publish.
Type Literal ​
{ bytes: number; elements: number; exact: boolean; kind: "bytes"; }
bytes ​
readonlybytes:number
The byte count.
elements ​
readonlyelements:number
How many elements it would carry.
exact ​
readonlyexact:boolean
Whether the counts were counted or estimated.
kind ​
readonlykind:"bytes"
How large an export would be.
Type Literal ​
{ bytes: number; height: number; kind: "image"; legendChannels: number; nodesInFrame: number; width: number; }
bytes ​
readonlybytes:number
Its size in bytes.
height ​
readonlyheight:number
Its height in pixels.
kind ​
readonlykind:"image"
What an image export would contain.
legendChannels ​
readonlylegendChannels:number
How many channels the legend would carry.
nodesInFrame ​
readonlynodesInFrame:number
How many nodes would be in the frame.
width ​
readonlywidth:number
Its width in pixels.
Type Literal ​
{ kind: "none"; }
kind ​
readonlykind:"none"
Nothing to preview.