public class UpdateSelection extends Selection
Selection.data()
methods. This represents the selected DOM elements that were successfully
bound to the specified data elements.
The update selection also contains a reference to the enter()
and exit()
selections, for adding and removing nodes in correspondence with data. For example, if
the default by-index key is used, and the existing selection contains fewer elements than the specified data, then the enter selection will contain placeholders for the new
data. On the other hand, if the existing contains more elements than the data, then the exit selection will contain the extra elements. And, if the existing selection exactly
matches the data, then both the enter and exit selections will be empty, with all nodes in the update selection.
For more details, see the short tutorial Thinking With Joins.
If a key function is specified, the data operator also affects the index of nodes; this index is passed as the second argument i to any operator function values. However, note
that existing DOM elements are not automatically reordered; use Selection.sort(java.util.Comparator)
or Selection.order()
as needed.
DATA_PROPERTY
Modifier | Constructor and Description |
---|---|
protected |
UpdateSelection() |
Modifier and Type | Method and Description |
---|---|
EnteringSelection |
enter()
Returns the
EnteringSelection :
placeholder nodes for each data element for which no corresponding existing DOM element was found in the current
selection. |
Selection |
exit()
Returns the exiting selection: existing DOM elements in the current selection for which no new data element was
found.
|
attr, attr, attr, attr, attr, attr, classed, classed, classed, data, data, data, data, data, data, data, data, data, data, data, data, data, data, data, data, data, data, data, data, datum, datum, datum, each, filter, filter, html, html, html, interrupt, node, on, on, order, property, property, property, property, property, property, remove, selectAll, selectAll, size, sort, style, style, style, style, style, text, text, text, transition
append, asElementArray, call, empty, groupCount, insert, parentNode, prepend, select, select
public final EnteringSelection enter()
EnteringSelection
:
placeholder nodes for each data element for which no corresponding existing DOM element was found in the current
selection.EnteringSelection
public final Selection exit()
The exiting selection defines all the normal operators, though typically the main one you'll want to use is Selection.remove()
; the other operators exist primarily
so you can define an exiting transition as desired.
Note that the exit operator merely returns a reference to the exiting selection, and it is up to you to remove the new nodes.
Copyright © 2015 gwt-d3. All rights reserved.