Class pvc.data.Data
Extends
Complex.
Constructor Attributes | Constructor Name and Description |
---|---|
The Data class represents a data set.
|
Field Attributes | Field Name and Description |
---|---|
Gets the atoms map of the complex value.
|
|
Gets the unique, sequential identifier of the complex value.
|
|
Gets the key of the complex.
|
|
Gets the label of the complex.
|
|
The owner data set of the complex value.
|
|
Gets the value of the complex.
|
|
DOM | |
The first child data set.
|
|
The last child data set.
|
|
The next sibling data set.
|
|
Gets the parent data set of this data set.
|
|
The previous sibling data set.
|
|
The root data set.
|
Method Attributes | Method Name and Description |
---|---|
contains(datum)
Gets a value that indicates if a given datum is contained by this data set.
|
|
datumByKey(key)
Gets the datum with the given key, if any, or `null`, if none.
|
|
Gets an array with the not-null, selected datums, in an unspecified order.
|
|
Datums | |
count()
Gets the number of contained datums.
|
|
datums(querySpec, keyArgs)
Gets an enumerable for the datums of this data,
possibly filtered according to a given query specification and datum states.
|
|
DOM | |
child(key)
Obtains a child data set given its key.
|
|
Obtains the number of children data sets.
|
|
Gets the index of this data set in relation to its sibling data sets.
|
|
children()
Obtains an enumerable of the child data sets of this data set.
|
|
leafs()
Obtains an enumerable of the leaf data sets of this data set.
|
|
Interactivity | |
Clears the selected state of all datums.
|
|
replaceSelected(datums)
Replaces the currently selected datums with the given datums.
|
|
Gets the number of not-null, selected datums.
|
|
<static> |
pvc.data.Data.setSelected(datums, selected)
Sets the selected state of the given datums to a given state.
|
<static> |
pvc.data.Data.setVisible(datums, visible)
Sets the visible state of the given datums to a given state.
|
<static> |
pvc.data.Data.toggleSelected(datums, any)
Pseudo-toggles the selected state of the given datums.
|
<static> |
pvc.data.Data.toggleVisible(datums)
Pseudo-toggles the visible state of the given datums.
|
Gets the number of not-null, visible datums.
|
- Borrowed from:
- Complex
- Borrowed from:
- Complex
The key is a unique string representation of complex value and is used to index complexes in dictionaries.
For datums, if the complex type has any key dimensions, as per pvc.options.DimensionType#isKey, its key is composed by the keys of the atoms of the key dimensions. Otherwise, their key is the #id.
For data sets, the key is a combination of the Atom#keys of contained #atoms.
- Borrowed from:
- Complex
When a complex contains a single atom, its label is the label of that atom. Otherwise, the "label" of the complex is determined by combining the the Atom#labels of contained #atoms.
- Borrowed from:
- Complex
- Borrowed from:
- Complex
When a complex contains a single atom, its value will be the typed value of that atom. Otherwise, the "value" of a complex is its #key.
- Borrowed from:
- Complex
This is is null for leaf data sets.
This is is null for leaf data sets.
This is null for the last child data set.
This is null for root data sets.
This is null for the first child data set.
The root data set has itself as the value of the root property.
- Arguments:
- {!pvc.data.Datum} datum
- The datum to test for containment.
- Returns:
- {boolean} true if the datum is contained in this data set, or false, otherwise.
- Arguments:
- {string} key
- The datum key.
- Returns:
- {pvc.data.Datum} A datum or `null`.
- Returns:
- {pvc.data.Datum[]} The selected datums.
- Returns:
- {number} The number of datums.
- Arguments:
- {object} querySpec Optional
- A query specification.
A structure with the following form:
// OR of datum filters querySpec = [datumFilter1, datumFilter2, ...] | datumFilter; // AND of dimension filters datumFilter = { // OR of dimension values dimName1: [value1, value2, ...], dimName2: value1, ... }
Values of a datum filter can also directly be atoms.
An example of a query specification:
querySpec = [ // Datums whose series is 'Europe' or 'Australia', // and whose category is 2001 or 2002 {series: ['Europe', 'Australia'], category: [2001, 2002]}, // Union'ed with // Datums whose series is 'America' {series: 'America'}, ];
- {object} keyArgs Optional
- Keyword arguments object.
- {boolean} keyArgs.isNull Optional, Default: null
- Only considers datums with the specified isNull attribute.
- {boolean} keyArgs.visible Optional, Default: null
- Only considers datums that have the specified visible state.
- {boolean} keyArgs.selected Optional, Default: null
- Only considers datums that have the specified selected state.
- {function} keyArgs.where Optional
- An arbitrary datum predicate.
- Arguments:
- {string} key
- The key of the child data set.
- Returns:
- {pvc.data.Data} The child data set with the given key or null.
- Returns:
- {number} The number of children data sets.
This index is 0-based.
When the node is a root node, -1 is returned.
- Returns:
- {number} The child index.
- Returns:
- {boolean} true if any datum changed its selected state; false, otherwise.
- Arguments:
- {!pvc.data.Datum[]|!def.Query} datums
- The new datums to be selected.
- Returns:
- {boolean} true if any datum changed its selected state; false, otherwise.
- Returns:
- {number} The number of datums.
- Arguments:
- {!pvc.data.Datum[]|!def.Query} datums
- The datums to set.
- {boolean} selected
- The desired selected state.
- Returns:
- {boolean} true if any datum changed its selected state; false, otherwise.
- Arguments:
- {!pvc.data.Datum[]|!def.Query} datums
- The datums to set.
- {boolean} visible
- The desired visible state.
- Returns:
- {boolean} true if any datum changed its visible state; false, otherwise.
If all are selected, clears their selected state. Otherwise, selects them all.
If the `any` argument is true, the behavior changes to: if any is selected, clears their selected state. Otherwise, if none are selected, selects them all.
- Arguments:
- {!pvc.data.Datum[]|!def.Query} datums
- The datums to toggle.
- {boolean} any Optional, Default: false
- If only some must be selected to consider the set currently selected or if all must be so.
- Returns:
- {boolean} true if any datum changed its selected state; false, otherwise.
If all are visible, hides them. Otherwise, shows them all.
- Arguments:
- {!pvc.data.Datum[]|!def.Query} datums
- The datums to toggle.
- Returns:
- {boolean} true if any datum changed its visible state; false, otherwise.
- Returns:
- {number} The number of datums.