VlDataset class
A table of rows, built once and given to as many charts as want it.
Rows are JSON objects — the same values the parser produces for
"data": {"values": […]} — so a dataset built here and one read off disk are
the same thing to everything downstream.
The dataset is a value beside the chart rather than a thing inside it: a spreadsheet's selection becomes one dataset and a dashboard's six panels read it.
See also VlChart.
VlDataset data = VlDataset.create();
data.row().str("region", "North").num("sales", 120.0);
data.row().str("region", "South").num("sales", 93.0);
Constructors
Properties
Methods
-
addRow(
VlJson row) → VlDataset - Adds a row that was built elsewhere.
-
count(
) → int - How many rows the dataset holds.
-
fieldType(
String field) → String - What kind of thing a column holds, in Vega-Lite's vocabulary.
-
fromValues(
VlJson values) → VlDataset - Takes the rows of a JSON array as they came out of the parser.
-
hasField(
String field) → bool - Whether any row has this column.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
numbers(
String field, List< double> values) → VlDataset - Fills one numeric column from an array, one value per row.
-
row(
) → VlDataRow - Adds a row and hands it back, ready to be filled.
-
rowAt(
int index) → VlJson - The row at an index, growing the dataset with empty rows if it is not there yet.
-
strings(
String field, List< String> values) → VlDataset - Fills one text column from an array, one value per row.
-
toString(
) → String -
A string representation of this object.
inherited
-
toValues(
) → VlJson -
The dataset as the
datablock of a specification:{"values": […]}.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
) → VlDataset - Builds an empty dataset.
-
looksLikeDate(
String text) → bool