Package org.zkoss.chart
Class Node
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.Node
-
- All Implemented Interfaces:
Serializable
,OptionDataListener
,org.zkoss.json.JSONAware
public class Node extends Optionable
A collection of options for the individual nodes. The nodes in a diagram are auto-generated instances of Highcharts.Point, but options can be applied here and linked by the id.- Since:
- 7.2.1.0
- Author:
- rudyhuang
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description Node()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Object
getBorderRadius()
Returns the border radius of the node.String
getColor()
Returns the color of the auto generated node.Number
getColorIndex()
Returns the color index of the auto generated node, especially for use in styled mode.Number
getColumn()
Returns an optional column index of where to place the node.NetworkGraphDataLabels
getDataLabels()
Returns the individual data label for each node, if any.String
getDescription()
Returns the job description for the node card, will be inserted by the default dataLabel.nodeFormatter.String
getId()
Returns the id of the auto-generated node, referring to the from or to setting of the link.String
getImage()
Returns an image for the node card, will be inserted by the default dataLabel.nodeFormatter.String
getLayout()
Returns the layout for the node's children.Number
getLevel()
Returns an optional level index of where to place the node.Marker
getMarker()
Returns the marker of this node, if any.Number
getMass()
Returns the mass of the node.String
getName()
Returns the name to display for the node in data labels and tooltips.Object
getOffset()
In a horizontal layout, returns the vertical offset of a node in terms of weight.Object
getOffsetHorizontal()
The horizontal offset of a node.Object
getOffsetVertical()
The vertical offset of a node.String
getTitle()
Returns the job title for the node card, will be inserted by the default dataLabel.nodeFormatter.void
setBorderRadius(Number borderRadius)
Sets the border radius of the node.void
setBorderRadius(String borderRadius)
Sets the border radius of the node.void
setColor(String color)
Sets the color of the auto generated node.void
setColorIndex(Number colorIndex)
Sets the color index of the auto generated node, especially for use in styled mode.void
setColumn(Number column)
Sets an optional column index of where to place the node.void
setDataLabels(NetworkGraphDataLabels dataLabels)
Sets the individual data label for each node.void
setDescription(String description)
Sets the job description for the node card, will be inserted by the default dataLabel.nodeFormatter.void
setId(String id)
Sets the id of the auto-generated node, referring to the from or to setting of the link.void
setImage(String image)
Sets an image for the node card, will be inserted by the default dataLabel.nodeFormatter.void
setLayout(String layout)
Sets the layout for the node's children.void
setLevel(Number level)
Sets an optional level index of where to place the node.void
setMarker(Marker marker)
Sets the marker of this node.void
setMass(Number mass)
Sets the mass of the node.void
setName(String name)
Sets the name to display for the node in data labels and tooltips.void
setOffset(Number offset)
Deprecated.since 10.2.1.0void
setOffset(String offset)
Deprecated.since 10.2.1.0void
setOffsetHorizontal(Number offsetHorizontal)
The horizontal offset of a node.void
setOffsetHorizontal(String offsetHorizontal)
The horizontal offset of a node.void
setOffsetVertical(Number offsetVertical)
The vertical offset of a node.void
setOffsetVertical(String offsetVertical)
The vertical offset of a node.void
setTitle(String title)
Sets the job title for the node card, will be inserted by the default dataLabel.nodeFormatter.-
Methods inherited from class org.zkoss.chart.Optionable
addExtraAttr, addOptionDataListener, clearOptonDataListener, clone, containsKey, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getAttr, getAttr, getClientState, getExtraAttr, merge, onChange, removeExtraAttr, removeKey, removeOptionDataListener, setAttr, setAttr, setAttr, setAttr, toJSONString, toString
-
-
-
-
Method Detail
-
getBorderRadius
public Object getBorderRadius()
Returns the border radius of the node.
-
setBorderRadius
public void setBorderRadius(Number borderRadius)
Sets the border radius of the node.
-
setBorderRadius
public void setBorderRadius(String borderRadius)
Sets the border radius of the node.
-
getColor
public String getColor()
Returns the color of the auto generated node.Default: null
-
setColor
public void setColor(String color)
Sets the color of the auto generated node.
-
getColorIndex
public Number getColorIndex()
Returns the color index of the auto generated node, especially for use in styled mode.Default: null
-
setColorIndex
public void setColorIndex(Number colorIndex)
Sets the color index of the auto generated node, especially for use in styled mode.
-
getColumn
public Number getColumn()
Returns an optional column index of where to place the node. The default behaviour is to place it next to the preceding node. Note that this option name is counter intuitive in inverted charts, like for example an organization chart rendered top down. In this case the "columns" are horizontal.Default: null
-
setColumn
public void setColumn(Number column)
Sets an optional column index of where to place the node. The default behaviour is to place it next to the preceding node. Note that this option name is counter intuitive in inverted charts, like for example an organization chart rendered top down. In this case the "columns" are horizontal.
-
getDataLabels
public NetworkGraphDataLabels getDataLabels()
Returns the individual data label for each node, if any. Otherwise, create a new one. The options are the same as the ones forSeries.getDataLabels()
.Default: null
-
setDataLabels
public void setDataLabels(NetworkGraphDataLabels dataLabels)
Sets the individual data label for each node. The options are the same as the ones forSeries.getDataLabels()
.
-
getDescription
public String getDescription()
Returns the job description for the node card, will be inserted by the default dataLabel.nodeFormatter.Default: null
-
setDescription
public void setDescription(String description)
Sets the job description for the node card, will be inserted by the default dataLabel.nodeFormatter.
-
getId
public String getId()
Returns the id of the auto-generated node, referring to the from or to setting of the link.Default: null
-
setId
public void setId(String id)
Sets the id of the auto-generated node, referring to the from or to setting of the link.
-
getImage
public String getImage()
Returns an image for the node card, will be inserted by the default dataLabel.nodeFormatter.Default: null
-
setImage
public void setImage(String image)
Sets an image for the node card, will be inserted by the default dataLabel.nodeFormatter.
-
getLayout
public String getLayout()
Returns the layout for the node's children. Ifhanging
, this node's children will hang below their parent, allowing a tighter packing of nodes in the diagram.Default: normal
-
setLayout
public void setLayout(String layout)
Sets the layout for the node's children. Ifhanging
, this node's children will hang below their parent, allowing a tighter packing of nodes in the diagram.
-
getLevel
public Number getLevel()
Returns an optional level index of where to place the node. The default behaviour is to place it next to the preceding node. Alias ofgetColumn()
, but in inverted sankeys and org charts, the levels are laid out as rows.Default: null
-
setLevel
public void setLevel(Number level)
Sets an optional level index of where to place the node. The default behaviour is to place it next to the preceding node. Alias ofgetColumn()
, but in inverted sankeys and org charts, the levels are laid out as rows.
-
getMarker
public Marker getMarker()
Returns the marker of this node, if any. Otherwise, create a new one.
-
setMarker
public void setMarker(Marker marker)
Sets the marker of this node.
-
getMass
public Number getMass()
Returns the mass of the node. By default, each node has mass equal to it's marker radius. Mass is used to determine how two connected nodes should affect each other: Attractive force is multiplied by the ratio of two connected nodes; if a big node has weights twice as the small one, then the small one will move towards the big one twice faster than the big one to the small one.Default: null
-
setMass
public void setMass(Number mass)
Sets the mass of the node. By default, each node has mass equal to it's marker radius. Mass is used to determine how two connected nodes should affect each other: Attractive force is multiplied by the ratio of two connected nodes; if a big node has weights twice as the small one, then the small one will move towards the big one twice faster than the big one to the small one.
-
getName
public String getName()
Returns the name to display for the node in data labels and tooltips. Use this when the name is different from the id. Where the id must be unique for each node, this is not necessary for the name.Default: null
-
setName
public void setName(String name)
Sets the name to display for the node in data labels and tooltips. Use this when the name is different from the id. Where the id must be unique for each node, this is not necessary for the name.
-
getOffset
public Object getOffset()
In a horizontal layout, returns the vertical offset of a node in terms of weight. Positive values shift the node downwards, negative shift it upwards. In a vertical layout, like organization chart, the offset is horizontal. If a percentage string is given, the node is offset by the percentage of the node size plusnodePadding
.Default: 0
-
setOffset
public void setOffset(Number offset)
Deprecated.since 10.2.1.0This option is deprecated, use offsetHorizontal and offsetVertical instead. In a horizontal layout, sets the vertical offset of a node in terms of weight. Positive values shift the node downwards, negative shift it upwards. In a vertical layout, like organization chart, the offset is horizontal.
-
setOffset
public void setOffset(String offset)
Deprecated.since 10.2.1.0This option is deprecated, use offsetHorizontal and offsetVertical instead. In a horizontal layout, sets the vertical offset of a node in terms of weight. In a vertical layout, like organization chart, the offset is horizontal. The node is offset by the percentage of the node size plusnodePadding
.Default: 0
-
getOffsetHorizontal
public Object getOffsetHorizontal()
The horizontal offset of a node. Positive values shift the node right, negative shift it left. If a percantage string is given, the node is offset by the percentage of the node size.Defaults to undefined.
- Since:
- 10.2.1.0
-
setOffsetHorizontal
public void setOffsetHorizontal(String offsetHorizontal)
The horizontal offset of a node. Positive values shift the node right, negative shift it left. If a percantage string is given, the node is offset by the percentage of the node size.Defaults to undefined.
- Since:
- 10.2.1.0
-
setOffsetHorizontal
public void setOffsetHorizontal(Number offsetHorizontal)
The horizontal offset of a node. Positive values shift the node right, negative shift it left. If a percantage string is given, the node is offset by the percentage of the node size.Defaults to undefined.
- Since:
- 10.2.1.0
-
setOffsetVertical
public void setOffsetVertical(String offsetVertical)
The vertical offset of a node. Positive values shift the node down, negative shift it up. If a percantage string is given, the node is offset by the percentage of the node size.Defaults to undefined.
- Since:
- 10.2.1.0
-
getOffsetVertical
public Object getOffsetVertical()
The vertical offset of a node. Positive values shift the node down, negative shift it up. If a percantage string is given, the node is offset by the percentage of the node size.Defaults to undefined.
- Since:
- 10.2.1.0
-
setOffsetVertical
public void setOffsetVertical(Number offsetVertical)
The vertical offset of a node. Positive values shift the node down, negative shift it up. If a percantage string is given, the node is offset by the percentage of the node size.Defaults to undefined.
- Since:
- 10.2.1.0
-
getTitle
public String getTitle()
Returns the job title for the node card, will be inserted by the default dataLabel.nodeFormatter.Default: null
-
setTitle
public void setTitle(String title)
Sets the job title for the node card, will be inserted by the default dataLabel.nodeFormatter.
-
-