mxMorphing

Implements animation for morphing cells.  Here is an example of using this class for animating the result of a layout algorithm:

graph.getModel().beginUpdate();
try
{
  let circleLayout = new mxCircleLayout(graph);
  circleLayout.execute(graph.getDefaultParent());
}
finally
{
  let morph = new mxMorphing(graph);
  morph.addListener(mxEvent.DONE, function()
  {
    graph.getModel().endUpdate();
  });

  morph.startAnimation();
}
Summary
mxMorphingImplements animation for morphing cells.
Functions
mxMorphingConstructs an animation.
Variables
graphSpecifies the delay between the animation steps.
stepsSpecifies the maximum number of steps for the morphing.
stepContains the current step.
easeEase-off for movement towards the given vector.
cellsOptional array of cells to be animated.
Functions
updateAnimationAnimation step.
showShows the changes in the given mxCellStatePreview.
animateCellAnimates the given cell state using mxCellStatePreview.moveState.
stopRecursionReturns true if the animation should not recursively find more deltas for children if the given parent state has been animated.
getDeltaReturns the vector between the current rendered state and the future location of the state after the display will be updated.
getOriginForCellReturns the top, left corner of the given cell.

Functions

mxMorphing

function mxMorphing(graph,
steps,
ease,
delay)

Constructs an animation.

Parameters

graphReference to the enclosing mxGraph.
stepsOptional number of steps in the morphing animation.  Default is 6.
easeOptional easing constant for the animation.  Default is 1.5.
delayOptional delay between the animation steps.  Passed to mxAnimation.

Variables

graph

mxMorphing.prototype.graph

Specifies the delay between the animation steps.  Defaul is 30ms.

steps

mxMorphing.prototype.steps

Specifies the maximum number of steps for the morphing.

step

mxMorphing.prototype.step

Contains the current step.

ease

mxMorphing.prototype.ease

Ease-off for movement towards the given vector.  Larger values are slower and smoother.  Default is 4.

cells

mxMorphing.prototype.cells

Optional array of cells to be animated.  If this is not specified then all cells are checked and animated if they have been moved in the current transaction.

Functions

updateAnimation

mxMorphing.prototype.updateAnimation = function()

Animation step.

show

mxMorphing.prototype.show = function(move)

Shows the changes in the given mxCellStatePreview.

animateCell

mxMorphing.prototype.animateCell = function(cell,
move,
recurse)

Animates the given cell state using mxCellStatePreview.moveState.

stopRecursion

mxMorphing.prototype.stopRecursion = function(state,
delta)

Returns true if the animation should not recursively find more deltas for children if the given parent state has been animated.

getDelta

mxMorphing.prototype.getDelta = function(state)

Returns the vector between the current rendered state and the future location of the state after the display will be updated.

getOriginForCell

mxMorphing.prototype.getOriginForCell = function(cell)

Returns the top, left corner of the given cell.  TODO: Improve performance by using caching inside this method as the result per cell never changes during the lifecycle of this object.

function mxMorphing(graph,
steps,
ease,
delay)
Constructs an animation.
mxMorphing.prototype.graph
Specifies the delay between the animation steps.
mxMorphing.prototype.steps
Specifies the maximum number of steps for the morphing.
mxMorphing.prototype.step
Contains the current step.
mxMorphing.prototype.ease
Ease-off for movement towards the given vector.
mxMorphing.prototype.cells
Optional array of cells to be animated.
mxMorphing.prototype.updateAnimation = function()
Animation step.
mxMorphing.prototype.show = function(move)
Shows the changes in the given mxCellStatePreview.
Implements a live preview for moving cells.
mxMorphing.prototype.animateCell = function(cell,
move,
recurse)
Animates the given cell state using mxCellStatePreview.moveState.
mxCellStatePreview.prototype.moveState = function(state,
dx,
dy,
add,
includeEdges)
mxMorphing.prototype.stopRecursion = function(state,
delta)
Returns true if the animation should not recursively find more deltas for children if the given parent state has been animated.
mxMorphing.prototype.getDelta = function(state)
Returns the vector between the current rendered state and the future location of the state after the display will be updated.
mxMorphing.prototype.getOriginForCell = function(cell)
Returns the top, left corner of the given cell.
Extends mxEventSource to implement a graph component for the browser.
Implements a basic animation in JavaScript.
Close