Empirical
|
#include <selection.h>
Public Member Functions | |
Transition | Select (std::string selector) const |
Transition | SelectAll (std::string selector) const |
Transition & | Call (std::string function) |
Transition | Filter (std::string selector) const |
Transition & | Each (std::string function) |
void | Remove () |
Transition | Merge (Transition &other) |
int | GetID () const |
void | Log () const |
Constructors | |
Usually transitions are constructed from selections by calling the selection.MakeTransition() method. In rare cases you may want to construct a new transition, though. | |
Transition () | |
Default constructor - construct empty transition. More... | |
Transition (int id) | |
Advanced: Construct new transition pointing to the [id]th element in js.objects. More... | |
Transition | NewTransition (std::string name="") const |
Setters | |
There are three main types of values you might want to change about a selection: attributes (use Additional traits you can set include text and html. Advanced note: In D3.js, the same functions are used to set and get values (depending on whether an argument is passed). Because C++ needs to have clearly defined return types we need separate getters for each return type. | |
Transition & | SetAttr (std::string name, std::string value) |
Transition & | SetStyle (std::string name, std::string value, bool priority=false) |
Transition & | SetText (std::string text) |
Transition & | SetProperty (std::string name, std::string value) |
Transition & | SetHtml (std::string value) |
Transition & | SetClassed (std::string classname, bool value) |
Getters | |
There are three main types of values you might want to access about a selection: attributes (use Additional traits you can set include text and html. Advanced note: In D3.js, the same functions are used to set and get values (depending on whether an argument is passed). Because C++ needs to have clearly defined return types (and because different macros are required to return different types from Javascript), we need separate getters for each return type. | |
std::string | GetAttrString (std::string name) const |
Get the value of this object's [name] attribute when it's a string. More... | |
int | GetAttrInt (std::string name) const |
Get the value of this object's [name] attribute when it's an int. More... | |
double | GetAttrDouble (std::string name) const |
Get the value of this object's [name] attribute when it's a double. More... | |
std::string | GetStyleString (std::string name) const |
Get the value of this object's [name] style when it's a string. More... | |
int | GetStyleInt (std::string name) const |
Get the value of this object's [name] style when it's an int. More... | |
double | GetStyleDouble (std::string name) const |
Get the value of this object's [name] style when it's a double. More... | |
std::string | GetText () const |
Get this object's text. More... | |
std::string | GetHtml () |
std::string | GetPropertyString (std::string name) |
int | GetPropertyInt (std::string name) |
double | GetPropertyDouble (std::string name) |
bool | Empty () const |
Returns true if there are no elements in this selection (or all elements are null) More... | |
int | Size () const |
Returns number of elements in this selection. More... | |
Protected Attributes | |
int | id |
Transitions are similar to selections, but when you make a change to them (attr or style), it will be animated. For additional discussion of transitions in d3, see this article.
|
inline |
Default constructor - construct empty transition.
|
inline |
Advanced: Construct new transition pointing to the [id]th element in js.objects.
|
inlineinherited |
Call the given function once on the entire selection/transition. [function] can either be a C++ function or a string with the name of a Javascript function in the d3, emp, or current window namespace. To get around the problem of passing selections into C++, this function assumes that the function you are passing expects a single argument: an int, representing the id of the selection to be operated on (which you can then convert to a selection object with D3::Selection(i)
).
|
inlineinherited |
Call the given function on each element of the selection/transition. [function] can either be a C++ function or a string with the name of a Javascript function in the d3, emp, or current window namespace.
|
inlineinherited |
Returns true if there are no elements in this selection (or all elements are null)
|
inlineinherited |
Returns a new selection/transition, representing the current selection/transition filtered by [selector]. [selector] can be a C++ function that returns a bool, a string representing a function in either the d3, emp, or window namespaces that returns a bool, or a string containing a selector to filter by.
For more information see the D3 documentation
|
inlineinherited |
Get the value of this object's [name] attribute when it's a double.
|
inlineinherited |
Get the value of this object's [name] attribute when it's an int.
|
inlineinherited |
Get the value of this object's [name] attribute when it's a string.
|
inlineinherited |
Get this object's html
Advanced note: This is implemented differently for selection vs transitions. As such, calling it on a SelectionOrTransition object directly is not supported.
|
inlineinherited |
|
inlineinherited |
Get the value of this object's [name] property when it's a double
Advanced note: This is implemented differently for selection vs transitions. As such, calling it on a SelectionOrTransition object directly is not supported.
|
inlineinherited |
Get the value of this object's [name] property when it's an int
Advanced note: This is implemented differently for selection vs transitions. As such, calling it on a SelectionOrTransition object directly is not supported.
|
inlineinherited |
Get the value of this object's [name] property when its a string
Advanced note: This is implemented differently for selection vs transitions. As such, calling it on a SelectionOrTransition object directly is not supported.
|
inlineinherited |
Get the value of this object's [name] style when it's a double.
|
inlineinherited |
Get the value of this object's [name] style when it's an int.
|
inlineinherited |
Get the value of this object's [name] style when it's a string.
|
inlineinherited |
Get this object's text.
|
inlineinherited |
|
inlineinherited |
|
inline |
Create a transition from the current transition. If a [name] is specified the transition will be given that name
Note: In D3.js this method is just called transition(), but in C++ that would cause a collision with the constructor
|
inlineinherited |
Remove the elements in this selection/transition from the document For transitions, this happens at the end of the transition.
|
inlineinherited |
Create a new selection/transition containing the first element matching the [selector] string that are within this current selection/transition
|
inlineinherited |
Create a new selection/transition containing all elements matching the [selector] string that are within this current selection/transition
|
inlineinherited |
Assigns [value] to the selection's [name] attribute. Value can be any primitive type, a string, a function object, or a lambda. If a string is passed, it can be a normal string, or the name of a function in d3, emp (such as one created with JSWrap), or the local window. If it is a function name, that function will be run, receiving bound data, if any, as input
|
inlineinherited |
Change whether or not element in this selection have the [classname] class. Example: Add the data-point class with selection.SetClassed("data-point", true); Advanced note: This is implemented differently for selection vs transitions. As such, calling it on a SelectionOrTransition object directly is not supported.
|
inlineinherited |
Sets this selection's inner html to the specified string, or the string returned by running the specified function on the element's bound data
Advanced note: This is implemented differently for selection vs transitions. As such, calling it on a SelectionOrTransition object directly is not supported.
|
inlineinherited |
Sets special properties of DOM elements (e.g. "checked" for checkboxes) Value can be a number, function, string, or string naming a Javascript function See the d3 documentation for more information.
Advanced note: This is implemented differently for selection vs transitions. As such, calling it on a SelectionOrTransition object directly is not supported.
|
inlineinherited |
Sets the selection's [name] style to [value]. This is the same idea as SetAttr, except for CSS styles. Value can be any primitive type, a string, a function object, or a lambda. If a string is passed, it can be a normal string, or the name of a function in d3, emp (such as one created with JSWrap), or the local window. If it is a function name, that function will be run, receiving bound data, if any, as input
There is a third optional argument, a boolean indicating whether you want to give this setting priority.
|
inlineinherited |
Sets this selection's text to the specified string, or the string returned by running the specified function on the element's bound data
|
inlineinherited |
Returns number of elements in this selection.
|
protectedinherited |