Represents a selection of entities in a display that will be animated by a transition.
User's do not construct TransitionSelections directly. Call thinkmap.display.DisplaySelection.transition() to create TransitionSelections instead.
Transition the position of the entities backed by this selection. This is used to animate the position of entities.
The function called to get the final position of the entity. This value represents the end point of the animation.
this TransitionSelection
Transition the rotation of the entities backed by this selection. This is used to animate the rotation of entities.
The function called to get the final rotation of the entity. This value represents the end point of the animation.
this TransitionSelection
Drag the elements backed by this DisplaySelection
the amount to drag this selection along the x axis
the amount to drag this selection along the y axis
returns this DisplaySelection
display.select().drag(2,10)
Returns an DOM selection that contains the root SVGElements for each entity backed by this DisplaySelection
a DOM selection containing the SVG elements representing the entities backed by this DisplaySelection
Freeze the entities backed by this DisplaySelection.
Entities can have two different levels of frozen. They can be frozen in place but still dragged by the mouse. Or they can be frozen completely so that users are unable to drag them.
Entities can also be frozen along a single axis, allowing them to move in one direction but not another.
The optional parameter when set to true will freeze the entities in this selection along the x axis. If undefined, the value is true.
The optional parameter when set to true will freeze the entities in this selection along the y axis. If undefined, the value is true.
true if the entities should also be frozen for dragging
this DisplaySelection
display.select().freeze();
display.select().freeze(false,true,true);
Invalidates the entities backed by this DisplaySelection
this DisplaySelection
Releases the frozen elements backed by this DisplaySelection
returns this DisplaySelection
Returns a new TransitionSelection that can be used to animate the entities backed by this DisplaySelection
Updates the SVG associated the entities backed by this DisplaySelection. This calls the update() method of the templates associated with the entities in this selection, invalidates them, and schedules the display to be redrawn.
this DisplaySelection
Add all of the bits in this selection to the given BitSet.
Tests if all entities in this selection can be removed from the graph associated with this selection. Entities may not be able to be removed because retention policies may have been set that prevent them from being removed.
true if all the entities in this selection can be removed from the graph associated with this selection.
Returns a clone of this selection. The BitSet that underlies this Selection is cloned.
a new selection, a clone of this selection.
Returns a new Selection, that is the complement of this selection and the given selection. The new selection is associated with this graph. The complement contains entities that are in the given selection, but are NOT in this selection.
the selection to complement with this selection. Note, this selection can be associated with a different graph.
a new selection, associated with this graph, containing the complement of the two selections.
Returns true if the given entity is contained in this selection
the entity
true if the entity is in this selection
Tell the graph associated with this selection that all the entities in this selection have had their data updated. This may trigger additional events such as display redrawing and index updating.
this selection
Returns a new Selection, that is the set difference of this selection and the given selection. The new selection is associated with this graph. The set difference contains entities that are in this selection, but are NOT in the given selection.
the selection to complement with this selection. Note, this selection can be associated with a different graph.
a new selection, associated with this graph, containing the set difference of the two selections.
Return a new Selection (associated with this graph) that is the result of filtering this selection with the given function.
the function to call, if it return true, entites will be included in the returned selection
an optional object to use as the "this" parameter to the given function
a new, filtered selection
Returns the first entity in this selection, or undefined, if this selection is empty. Please note that the order of entities in a selection is undefined.
Calls a function once for each Entity in the selection
the function to call, once for each entity in this selection
an optional object to use as the "this" parameter to the function
this selection
Get the graph that this selection is associated with.
Returns a new Selection, that is the set intersection of this selection and the given selection. The new selection is associated with this graph. The set intersection contains all the entities from this selection and the given selection.
the selection to intersect with this selection. Note, this selection can be associated with a different graph.
a new selection, associated with this graph, containing the set intersection of the two selections.
Create an array that consists of the output of calling the given function once for every entity in this selection.
a function to call once, for each entity
optional argument, the this pointer to use when calling the provided function
an array with the output of the given function, one for each entity
Returns a mirror of this selection. The BitSet that underlies this Selection is shared with this selection.
a new selection, a copy of this selection, that shares a bitset with the original selection.
Removes all the entities in this selection from the associated graph.
this selection
Remove all of the bits in this selection from the given BitSet.
Sets a retention policy for all the entities contained in this selection.
A retention policy is a function that is passed an Entity and returns true if that Entity may not be removed from the graph.
a policy function that will prevent entities from being removed if it returns true.
this selection
Create a sub-selection on this selection, narrowing by the given criteria.
valid query criteria
a new selection which is a sub-set of this selection
Convert this selection to an array of Entitys
Returns a new Selection, that is the union of this selection and the given selection. The new selection is associated with this graph.
the selection to union with this selection. Note, this selection can be associated with a different graph.
a new selection, associated with this graph, containing the union of the two selections.
Ensures that this transition does not begin until the given future completes.
this transition
Adds an animator function with a name. These animator functions are called on each tick of the transition.
The name serves as a key to ensure that no two transitions conflict with each other.
the name associated with this animator function. The name serves as a key to prevent animator functions from conflicting
Sets or gets the function to execute when this transition completes
returns this transition if setting the atEnd function, else the current atEnd function is returned
Sets or gets the delay for this transition.
The delay can be either a number or a function that returns a number for each individual item in this transition.
If no delay is explicitly set, the default delay for transitions is used.
returns this transition if setting the delay, else the current delay is returned
Sets or gets the duration for this transition.
The duration can be either a number or a function that returns a number for each individual item in this transition.
If no duration is explicitly set, the default duration for transitions is used.
returns this transition if setting the duration, else the current duration is returned
Sets or gets the easing function to be used on this Transition.
the easing function used for this transition
this Transition if setting the easing function or the current Easing function
Lends the methods of this Transition to another object. Because many classes depend on animation and we can only extend once, this is a handy way to offer the methods of transition to another object that needs them for managing animations
the object to lend the methods to
this transition
Sets or gets the function to execute on each 'tick' or 'step' of this transition
returns this transition if setting the tick function, else the current tick function is returned
Binds a this argument to the future which will be passed to listeners when this Future is called.
returns this future
Cancels this future, causing it to go into the Future.CANCELLED state.
the optional value that will be passed to this futures cancel listeners
returns this Future
Fails this future, with the given reason. Users should never call this method directly.
returns this future
Fulfills this future which marks the future as being successfully completed.
an optional value that was created by the future.
Register a function to be called if this Future completes. The function will be called with the value of the future as the argument.
Note this API does not currently support removing the listener.
this future
Register a function to be called if this Future fails.
Note this API does not currently support removing the listener.
this future
Register a function to be called as progress events occur on this Future. The function will be called with the value of the progress as the argument.
Note this API does not currently support removing the listener.
this future
Progresses this future, with the given arguments. Users should never call this method directly.
optional value that will be passed this future's progress listeners
returns this future
Registers a set of listeners that are called as this future progresses. And returns a new future that is fulfilled by the return value of the oncomplete handler. In this way, Futures can be chained.
the function to call when this Future is complete.
the function to call if this Future encounters an error. This will only be called one or zero times.
the function to call as this Future progresses. This is not guaranteed to be called.
thinkmap.async.later(function() { return 5; },2000)
.then(function(x) { return v + 2; })
.then(function(v) { alert(v); });
Add a listener to this EventSource
the name of the event to listen for
the callback to add
this eventsource
Dispatch an event from this EventSource, supplying arguments to the listeners via an Array, rather than var-args.
the name of the event to dispatch
this EventSource
Dispatch an event from this EventSource
the name of the event to dispatch
optional arguments sent to the event listeners
this EventSource
Fire an event from this EventSource
the name of the event to dispatch
optional arguments sent to the event listeners
this EventSource
Remove a listener from this EventSource
the name of the event to remove the listener for
the callback to remove
this eventsource
Add a listener to this EventSource
the name of the event to listen for
the callback
this eventsource
Add a listener to this EventSource, which will be called at most once and will be removed the first time the given event fires.
the name of the event to listen for
the callback to add
this eventsource
Remove a listener from this EventSource
the name of the event to remove the listener for
the callback to remove
this eventsource
fired when this future completes. The arguments to this event are the arguments used to fulfill (complete) this future
fired when this future is cancelled. The arguments to this event are the arguments passed to the cancel method of this future
fired when this future encounters an error. The arguments to this event are the error which caused this future from being unable to complete.
fired when this future has been notified of progress. The arguments to this event are the arguments passed to this futures progress method.