Package org.zkoss.chart.plotOptions
Class PackedBubbleParentNodeOptions
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.plotOptions.PackedBubbleParentNodeOptions
-
- All Implemented Interfaces:
Serializable
,OptionDataListener
,org.zkoss.json.JSONAware
public class PackedBubbleParentNodeOptions extends Optionable
Layout algorithm options for parent nodes.- 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 PackedBubbleParentNodeOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Number
getBubblePadding()
Returns the distance between two bubbles, when the algorithm starts to treat two bubbles as overlapping.Number
getFriction()
Returns the friction applied on forces to prevent nodes rushing to fast to the desired positions.Number
getGravitationalConstant()
Returns the gravitational const used in the barycenter force of the algorithm.Number
getInitialPositionRadius()
When initialPositions are set to 'circle', initialPositionRadius is a distance from the center of circle, in which nodes are created.String
getIntegration()
Returns the integration type.Number
getLinkLength()
Returns the ideal length (px) of the link between two nodes.Marker
getMarker()
Returns the styling options for parentNodes markers, if any.Number
getMaxIterations()
Returns the max number of iterations before algorithm will stop.Number
getMaxSpeed()
Returns the max speed that node can get in one iteration.String
getType()
Returns the type of the algorithm used when positioning nodes.boolean
isSeriesInteraction()
Returns whether series should interact with each other or not.void
setBubblePadding(Number bubblePadding)
Sets the distance between two bubbles, when the algorithm starts to treat two bubbles as overlapping.void
setFriction(Number friction)
Sets the friction applied on forces to prevent nodes rushing to fast to the desired positions.void
setGravitationalConstant(Number gravitationalConstant)
Sets the gravitational const used in the barycenter force of the algorithm.void
setInitialPositionRadius(Number initialPositionRadius)
When initialPositions are set to 'circle', initialPositionRadius is a distance from the center of circle, in which nodes are created.void
setIntegration(String integration)
Sets the integration type.void
setLinkLength(Number linkLength)
Sets the ideal length (px) of the link between two nodes.void
setMarker(Marker marker)
Sets the styling options for parentNodes markers.void
setMaxIterations(Number maxIterations)
Sets the max number of iterations before algorithm will stop.void
setMaxSpeed(Number maxSpeed)
Sets the max speed that node can get in one iteration.void
setSeriesInteraction(boolean seriesInteraction)
Sets whether series should interact with each other or not.void
setType(String type)
Sets the type of the algorithm used when positioning nodes.-
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
-
getBubblePadding
public Number getBubblePadding()
Returns the distance between two bubbles, when the algorithm starts to treat two bubbles as overlapping. The bubblePadding is also the expected distance between all the bubbles on simulation end.Default: 5
-
setBubblePadding
public void setBubblePadding(Number bubblePadding)
Sets the distance between two bubbles, when the algorithm starts to treat two bubbles as overlapping. The bubblePadding is also the expected distance between all the bubbles on simulation end.
-
getFriction
public Number getFriction()
Returns the friction applied on forces to prevent nodes rushing to fast to the desired positions.Default: -0.981.
-
setFriction
public void setFriction(Number friction)
Sets the friction applied on forces to prevent nodes rushing to fast to the desired positions.
-
getGravitationalConstant
public Number getGravitationalConstant()
Returns the gravitational const used in the barycenter force of the algorithm.Default: 0.01
-
setGravitationalConstant
public void setGravitationalConstant(Number gravitationalConstant)
Sets the gravitational const used in the barycenter force of the algorithm.
-
getInitialPositionRadius
public Number getInitialPositionRadius()
When initialPositions are set to 'circle', initialPositionRadius is a distance from the center of circle, in which nodes are created.Default: 20
-
setInitialPositionRadius
public void setInitialPositionRadius(Number initialPositionRadius)
When initialPositions are set to 'circle', initialPositionRadius is a distance from the center of circle, in which nodes are created.
-
getIntegration
public String getIntegration()
Returns the integration type. Available options are 'euler' and 'verlet'. Integration determines how forces are applied on particles. In Euler integration, force is applied direct asnewPosition += velocity;
. In Verlet integration, new position is based on a previous position without velocity:newPosition += previousPosition - newPosition
. Note that different integrations give different results as forces are different.Default: "euler"
-
setIntegration
public void setIntegration(String integration)
Sets the integration type. Available options are 'euler' and 'verlet'. Integration determines how forces are applied on particles. In Euler integration, force is applied direct asnewPosition += velocity;
. In Verlet integration, new position is based on a previous position without velocity:newPosition += previousPosition - newPosition
. Note that different integrations give different results as forces are different.
-
getLinkLength
public Number getLinkLength()
Returns the ideal length (px) of the link between two nodes. When not defined, length is calculated as:Math.pow(availableWidth * availableHeight / nodesLength, 0.4);
Note: Because of the algorithm specification, length of each link might be not exactly as specified.Default: null
-
setLinkLength
public void setLinkLength(Number linkLength)
Sets the ideal length (px) of the link between two nodes. When not defined, length is calculated as:Math.pow(availableWidth * availableHeight / nodesLength, 0.4);
Note: Because of the algorithm specification, length of each link might be not exactly as specified.
-
getMarker
public Marker getMarker()
Returns the styling options for parentNodes markers, if any. Otherwise, create a new one. Similar toline.marker
options.
-
setMarker
public void setMarker(Marker marker)
Sets the styling options for parentNodes markers. Similar toline.marker
options.
-
getMaxIterations
public Number getMaxIterations()
Returns the max number of iterations before algorithm will stop. In general, algorithm should find positions sooner, but when rendering huge number of nodes, it is recommended to increase this value as finding perfect graph positions can require more time.Default: 1000
-
setMaxIterations
public void setMaxIterations(Number maxIterations)
Sets the max number of iterations before algorithm will stop. In general, algorithm should find positions sooner, but when rendering huge number of nodes, it is recommended to increase this value as finding perfect graph positions can require more time.
-
getMaxSpeed
public Number getMaxSpeed()
Returns the max speed that node can get in one iteration. In terms of simulation, it's a maximum translation (in pixels) that a node can move (in both, x and y, dimensions). While friction is applied on all nodes, max speed is applied only for nodes that move very fast, for example small or disconnected ones.Default: 5
-
setMaxSpeed
public void setMaxSpeed(Number maxSpeed)
Sets the max speed that node can get in one iteration. In terms of simulation, it's a maximum translation (in pixels) that a node can move (in both, x and y, dimensions). While friction is applied on all nodes, max speed is applied only for nodes that move very fast, for example small or disconnected ones.
-
isSeriesInteraction
public boolean isSeriesInteraction()
Returns whether series should interact with each other or not. When parentNodeLimit is set to true, thi option should be set to false to avoid sticking points in wrong series parentNode.Default: true
-
setSeriesInteraction
public void setSeriesInteraction(boolean seriesInteraction)
Sets whether series should interact with each other or not. When parentNodeLimit is set to true, thi option should be set to false to avoid sticking points in wrong series parentNode.
-
getType
public String getType()
Returns the type of the algorithm used when positioning nodes.Default: "reingold-fruchterman"
-
setType
public void setType(String type)
Sets the type of the algorithm used when positioning nodes.
-
-