Class: Node

ge.Node(graph, data)

Graph node class.

Constructor

new Node(graph, data)

Graph node constructor.
Parameters:
Name Type Description
graph ge.GraphEditor Graph
data ImportNodeData Node JSON data
Source:
See:
  • ge.GraphEditor.initNode

Members

data :*

User data.
Type:
  • *
Source:

(readonly) elementId :string

SVG element ID.
Type:
  • string
Source:

height :number

Height.
Type:
  • number
Source:

(readonly) id :ID

ID.
Type:
Source:

initSelection

Initialize SVG elements.
Source:

(private, nullable) prevTitle :string

Previous title.
Type:
  • string
Source:

(readonly) selector :Selector

SVG element selector.
Type:
Source:

shape :Shape

Shape.
Type:
  • Shape
Source:

(readonly, nullable) textHeight :number

Text container height.
Type:
  • number
Source:

(readonly) textInside :ge.GraphEditor

True if node title is inside its shape.
Type:
Source:

(readonly) textSize :ge.TextSize

Text size calculator.
Type:
Source:

(readonly, nullable) textWidth :number

Text container width.
Type:
  • number
Source:

(readonly, nullable) textX :number

Text X offset.
Type:
  • number
Source:

(readonly, nullable) textY :number

Text Y offset.
Type:
  • number
Source:

title :string

Title.
Type:
  • string
Source:

(readonly, nullable) transform :string

SVG group transform.
Type:
  • string
Source:

updateSelection

Update SVG elements.
Source:

width :number

Width.
Type:
  • number
Source:

x :number

X coordinate.
Type:
  • number
Source:

y :number

Y coordinate.
Type:
  • number
Source:

Methods

(static) initSelection(nodes, cls)

Initialize SVG elements.
Parameters:
Name Type Description
nodes D3Selection SVG element enter selection.
cls string CSS class.
Source:

(static) updateSelection(nodes, transition, textSize)

Update SVG elements.
Parameters:
Name Type Description
nodes D3Selection SVG element selection.
transition function Transition generator.
textSize ge.TextSize Text size calculator.
Source:

toJson(graph, oxopt, oyopt) → {ExportNodeData}

Convert to JSON.
Parameters:
Name Type Attributes Default Description
graph ge.GraphEditor Graph.
ox number <optional>
0 Origin X coordinate.
oy number <optional>
0 Origin Y coordinate.
Source:
Returns:
JSON data.
Type
ExportNodeData

update() → {boolean}

Update node data.
Source:
Returns:
True if node position changed.
Type
boolean