T - public class PropertyValueFunction<T> extends Object implements DatumFunction<T>
DatumFunction which returns the value of a specified property
for each datum.
| Constructor and Description |
|---|
PropertyValueFunction(String propertyName) |
| Modifier and Type | Method and Description |
|---|---|
T |
apply(com.google.gwt.dom.client.Element context,
Value d,
int index)
Apply the function for the given
Element at the specified index
of the Selection mapped to the given Datum. |
static <X> PropertyValueFunction<X> |
forProperty(String propertyName)
Create a
PropertyValueFunction which returns the value of the property
with the given name |
public PropertyValueFunction(String propertyName)
public static <X> PropertyValueFunction<X> forProperty(String propertyName)
PropertyValueFunction which returns the value of the property
with the given namepropertyName - the name of the property the value should be returned ofpublic T apply(com.google.gwt.dom.client.Element context, Value d, int index)
DatumFunctionElement at the specified index
of the Selection mapped to the given Datum.
Note that if no datum is mapped to the element, Datum#isUndefined() will return true.
apply in interface DatumFunction<T>context - the current element, may be irrelevant or null in some context.d - the datumindex - the index of the element in the selectionCopyright © 2015 gwt-d3. All rights reserved.