Animator
The Animator
class implements the commands to create, destroy, move and scale components (nodes, edges or tokens) in an animated graph.
Value parameters
- graph
-
the directed graph to be animated
Attributes
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Create an edge at the given location.
Create an edge at the given location.
Value parameters
- color
-
the color of the token
- eid
-
the external id for the edge
- from_eid
-
the eid of the origination node
- label
-
the label for the created edge
- primary
-
whether it is a primary (true) or secondary (false)
- pts
-
the coordinates and dimensions of the edge
- shape
-
the shape (curve) of the edge
- shift
-
amount of distance to shift the edge to accommodate, e.g., a bundle of edges in a composite edge
- to_eid
-
the eid of the destination node
Attributes
Create a node at the given location.
Create a node at the given location.
Value parameters
- color
-
the color of the node
- eid
-
the external id for the node
- label
-
the label for the created node
- primary
-
whether node is primary/transition (true) or secondary/place (false)
- pts
-
the coordinates and dimensions of the node
- shape
-
the shape of the node
Attributes
Create a token at the given location.
Create a token at the given location.
Value parameters
- color
-
the color of the token
- eid
-
the external id for the token
- label
-
the label for the created token
- on_eid
-
the eid of the node it is on
- primary
-
whether it is a primary (true) or secondary (false)
- pts
-
the coordinates and dimensions of the token
- shape
-
the shape of the token
Attributes
Destroy the edge with the given id.
Destroy the edge with the given id.
Value parameters
- eid
-
the edges's external id
Attributes
Destroy the node with the given id.
Destroy the node with the given id.
Value parameters
- eid
-
the node's external id
Attributes
Destroy the token with the given id.
Destroy the token with the given id.
Value parameters
- eid
-
the token's external id
Attributes
Move the node to a new (x, y) location. Edges cannot be moved directly, but must adjust to node movements.
Move the node to a new (x, y) location. Edges cannot be moved directly, but must adjust to node movements.
Value parameters
- eid
-
the external id of the node to move
- pts
-
the new x, y -coordinates
Attributes
Move the token to a new (x, y) location.
Move the token to a new (x, y) location.
Value parameters
- eid
-
the external id of the token to move
- pts
-
the new x, y -coordinates
Attributes
Move the token along the curve for an edge and return false if at end of curve.
Move the token along the curve for an edge and return false if at end of curve.
Value parameters
- edge_eid
-
the external id for edge to move along
- eid
-
the external id for the token to move
- step
-
the length of step
Attributes
Move the token onto the new node.
Move the token onto the new node.
Value parameters
- eid
-
the external id of the token to move
- node_eid
-
the external id of the node to move onto
Attributes
Move number tokens of color color from node from_eid to node to_eid.
Move number tokens of color color from node from_eid to node to_eid.
Value parameters
- color
-
the color of the tokens to move
- from_eid
-
the external id of the node tokens are to be taken from
- pts
-
one dimensional array containing number of tokens to move
- to_eid
-
the external id of the node the tokens are to be moved to
Attributes
Scale the node, i.e., make it larger or smaller. Edges cannot be scaled directly, but must adjust to node scaling.
Scale the node, i.e., make it larger or smaller. Edges cannot be scaled directly, but must adjust to node scaling.
Value parameters
- eid
-
the external id of the node to scale
- pts
-
the new width, height dimensions
Attributes
Scale the token, i.e., make it larger or smaller.
Scale the token, i.e., make it larger or smaller.
Value parameters
- eid
-
the external id of the token to scale
- pts
-
the new width, height dimensions
Attributes
Move amount tokens/fluids of color color from node from_eid to node to_eid by increasing the size of tokens at to_eid while decreasing the size at from_eid.
Move amount tokens/fluids of color color from node from_eid to node to_eid by increasing the size of tokens at to_eid while decreasing the size at from_eid.
Value parameters
- color
-
the color of the tokens/fluids to move
- from_eid
-
the external id of the node tokens/fluids are to be taken from
- pts
-
one dimensional array containing amount of fluids to move
- to_eid
-
the external id of the node tokens/fluids are to be moved to
Attributes
Set the paint color for the edge.
Set the paint color for the edge.
Value parameters
- color
-
the new color for the node
- eid
-
the external id for node to paint
Attributes
Set the paint color for the node.
Set the paint color for the node.
Value parameters
- color
-
the new color for the node
- eid
-
the external id for node to paint
Attributes
Set the paint color for the token.
Set the paint color for the token.
Value parameters
- color
-
the new color for the node
- eid
-
the external id for node to paint
Attributes
Adjust the time dilation: >1 slows down animation, <1 speeds up animation.
Adjust the time dilation: >1 slows down animation, <1 speeds up animation.
Value parameters
- pts
-
one dimensional array containing the new time dilation factor
Attributes
Get the time dilation factor.
Get the time dilation factor.
Attributes
Inherited methods
Move/translate the shape to location (x, y).
Move/translate the shape to location (x, y).
Value parameters
- p
-
the point (x, y)-coordinates
- shape
-
the shape/object to move
Attributes
- Inherited from:
- Transform
Move/translate the shape to location (x, y).
Move/translate the shape to location (x, y).
Value parameters
- shape
-
the shape/object to move
- x
-
the x-coordinate
- y
-
the y-coordinate
Attributes
- Inherited from:
- Transform
Rotate the shape by theta radians.
Rotate the shape by theta radians.
Value parameters
- shape
-
the shape/object to rotate
- theta
-
the rotation angle in radians
Attributes
- Inherited from:
- Transform
Scale/resize the shape to the new width and height parameters.
Scale/resize the shape to the new width and height parameters.
Value parameters
- p
-
the point (w, h) parameters
- shape
-
the shape/object to scale (change size)
Attributes
- Inherited from:
- Transform
Scale/resize the shape to the new width and height parameters.
Scale/resize the shape to the new width and height parameters.
Value parameters
- h
-
the height
- shape
-
the shape/object to scale (change size)
- w
-
the width
Attributes
- Inherited from:
- Transform