Skip to content

frontend-web-editor


Function: createEndStates()

createEndStates(leafNode, nodeWidth, pos, isDefaultNode): object

Defined in: app/hooks/eventTree/useTreeData.ts:33

Create default end-state nodes for a given leaf.

Generates a Sequence ID node, a Frequency node, and a Release Category node, connecting them in order and returning the new nodes and edges. Frequency is initialized to 0.5 for default nodes and 0.0 otherwise.

Parameters

leafNode

Node

The leaf node to attach the end-state chain to.

nodeWidth

number

The width to assign to generated nodes.

pos

The base position used for initial placement of generated nodes.

x

number

y

number

isDefaultNode

boolean = false

Whether to seed frequency with a default (0.5) value.

Returns

object

An object containing the created nodes and edges.

edges

edges: Edge[]

nodes

nodes: Node[]