Classes
- Dataset
Base Dataset class
- Dataset
- WebSocketDataset
A Dataset whose datapoints are received from a websocket.
- Embedding
Base class for all embeddings.
- Embedding
- MeshEmbedding
Base class for embeddings that render Datapoints as individual meshes
- PointsEmbedding
Base class for embedding backed by a Points object (i.e., particle clouds)
- ScatterEmbedding
An embedding in which each datapoint is rendered as a vertex in a THREE.Points object.
- PathEmbedding
A {MeshEmbedding} in which each {Datapoint} is rendered as a Mesh that follows a path defined by waypoints.
- AggregateEmbedding
An embedding that represents an aggregation of a dataset, including many operations from traditional data analytics.
- AggregateEmbedding
Functions
- initScene()
Convenience function to create a responsive THREE scene and related objects. Returns a number of objects that should probably be kept around by the enclosing script.
- animate()
The core animation call that is executed for each frame. Updates all registered embeddings, the pointer controls, and the camera position. Renders the scene using the WebVRManager, which applies the VREffect if in VR mode.
- register(embedding)
Register an embedding so that it will be updated on each animation frame.
- categoricalMap()
Return a function that defines a mapping from values for an attribute to target values. Can be used, for example, to map from attribute values to colors.
Typedefs
- CSVDatasetCallback :
function
A callback that is triggered after the dataset is loaded; typically used to create an embedding based on the dataset.
Dataset
Base Dataset class
Kind: global class
dataset.add(datapoint)
Add a datapoint to the Dataset
Kind: instance method of Dataset
Param | Type |
---|---|
datapoint | Datapoint |
dataset.remove(id)
Remove a datapoint from the Dataset
Kind: instance method of Dataset
Param | Description |
---|---|
id | The id of the datapoint to remove |
dataset.update(id, k)
Modify the value of a datapoint attribute
Kind: instance method of Dataset
Param | Description |
---|---|
id | The id of the datapoint to modify |
k | The key whose value to modify @ @param v - The new value |
dataset.getDatapoints(filter)
Returns the datapoints in the dataset, in id order. This is live data, and should not be modified
Kind: instance method of Dataset
Param | Description |
---|---|
filter | An optional filter function |
Dataset.createFromCSV(url, callback)
Create a {Dataset} from a csv file that can be found at the given url
Kind: static method of Dataset
Param | Type | Description |
---|---|---|
url | String |
The url where the csv file can be found |
callback | CSVDatasetCallback |
Dataset
Kind: global class
dataset.add(datapoint)
Add a datapoint to the Dataset
Kind: instance method of Dataset
Param | Type |
---|---|
datapoint | Datapoint |
dataset.remove(id)
Remove a datapoint from the Dataset
Kind: instance method of Dataset
Param | Description |
---|---|
id | The id of the datapoint to remove |
dataset.update(id, k)
Modify the value of a datapoint attribute
Kind: instance method of Dataset
Param | Description |
---|---|
id | The id of the datapoint to modify |
k | The key whose value to modify @ @param v - The new value |
dataset.getDatapoints(filter)
Returns the datapoints in the dataset, in id order. This is live data, and should not be modified
Kind: instance method of Dataset
Param | Description |
---|---|
filter | An optional filter function |
Dataset.createFromCSV(url, callback)
Create a {Dataset} from a csv file that can be found at the given url
Kind: static method of Dataset
Param | Type | Description |
---|---|---|
url | String |
The url where the csv file can be found |
callback | CSVDatasetCallback |
WebSocketDataset
A Dataset whose datapoints are received from a websocket.
Embedding
Base class for all embeddings.
Kind: global class
new Embedding(scene, dataset, [options])
Embedding base constructor.
Param | Type | Default | Description |
---|---|---|---|
scene | The scene to which the embedding belongs | ||
dataset | Dataset |
The dataset that backs the embedding | |
[options] | Object |
{} |
Options describing the embedding's location and scale |
[options.position.x] | Number |
0 |
x position of the embedding |
[options.position.y] | Number |
0 |
y position of the embedding |
[options.position.z] | Number |
0 |
z position of the embedding |
[options.rotation.x] | Number |
0 |
x rotation of the embedding |
[options.rotation.y] | Number |
0 |
y rotation of the embedding |
[options.rotation.z] | Number |
0 |
z rotation of the embedding |
[options.scale.x] | Number |
1 |
x scale of the embedding |
[options.scale.y] | Number |
1 |
y scale of the embedding |
[options.scale.z] | Number |
1 |
z scale of the embedding |
embedding._map()
Translates from a source property of a datapoint to a target property of an embedding element.
Kind: instance method of Embedding
embedding._mapAttr()
Translates from a source property of a datapoint to a target property of an embedding element.
Kind: instance method of Embedding
embedding.embed()
Render the embedding - must be implemented by each concrete subclass.
Kind: instance abstract method of Embedding
Embedding
Kind: global class
new Embedding(scene, dataset, [options])
Embedding base constructor.
Param | Type | Default | Description |
---|---|---|---|
scene | The scene to which the embedding belongs | ||
dataset | Dataset |
The dataset that backs the embedding | |
[options] | Object |
{} |
Options describing the embedding's location and scale |
[options.position.x] | Number |
0 |
x position of the embedding |
[options.position.y] | Number |
0 |
y position of the embedding |
[options.position.z] | Number |
0 |
z position of the embedding |
[options.rotation.x] | Number |
0 |
x rotation of the embedding |
[options.rotation.y] | Number |
0 |
y rotation of the embedding |
[options.rotation.z] | Number |
0 |
z rotation of the embedding |
[options.scale.x] | Number |
1 |
x scale of the embedding |
[options.scale.y] | Number |
1 |
y scale of the embedding |
[options.scale.z] | Number |
1 |
z scale of the embedding |
embedding._map()
Translates from a source property of a datapoint to a target property of an embedding element.
Kind: instance method of Embedding
embedding._mapAttr()
Translates from a source property of a datapoint to a target property of an embedding element.
Kind: instance method of Embedding
embedding.embed()
Render the embedding - must be implemented by each concrete subclass.
Kind: instance abstract method of Embedding
MeshEmbedding
Base class for embeddings that render Datapoints as individual meshes
meshEmbedding.createObjectForDatapoint()
A default Object3D creator; this can be overriden by subclasses
Kind: instance method of MeshEmbedding
PointsEmbedding
Base class for embedding backed by a Points object (i.e., particle clouds)
ScatterEmbedding
An embedding in which each datapoint is rendered as a vertex in a THREE.Points object.
PathEmbedding
A {MeshEmbedding} in which each {Datapoint} is rendered as a Mesh that follows a path defined by waypoints.
AggregateEmbedding
An embedding that represents an aggregation of a dataset, including many operations from traditional data analytics.
new AggregateEmbedding(attr, scene, dataset, [options])
Create a new AggregateEmbedding.
Param | Type | Default | Description |
---|---|---|---|
attr | string |
The attribute which is being aggregated | |
scene | The scene to which the embedding belongs | ||
dataset | Dataset |
The dataset that backs the embedding | |
[options] | Object |
{} |
Options describing the embedding's location and scale |
[options.filter] | function |
identity |
A filter to apply to the Dataset before applying the aggregator. Default is to keep all datapoints in the Dataset |
[options.groupBy] | function |
AggregateEmbedding.CollapsedGrouping |
A function by whose output the Dataset will be grouped before applyting the aggregator. Default is to place all datapoints into a single group. |
[options.aggregate] | function |
AggregateEmbedding.Aggregates.mean |
The function by which to aggregate the dataset attribute |
AggregateEmbedding
new AggregateEmbedding(attr, scene, dataset, [options])
Create a new AggregateEmbedding.
Param | Type | Default | Description |
---|---|---|---|
attr | string |
The attribute which is being aggregated | |
scene | The scene to which the embedding belongs | ||
dataset | Dataset |
The dataset that backs the embedding | |
[options] | Object |
{} |
Options describing the embedding's location and scale |
[options.filter] | function |
identity |
A filter to apply to the Dataset before applying the aggregator. Default is to keep all datapoints in the Dataset |
[options.groupBy] | function |
AggregateEmbedding.CollapsedGrouping |
A function by whose output the Dataset will be grouped before applyting the aggregator. Default is to place all datapoints into a single group. |
[options.aggregate] | function |
AggregateEmbedding.Aggregates.mean |
The function by which to aggregate the dataset attribute |
initScene()
Convenience function to create a responsive THREE scene and related objects. Returns a number of objects that should probably be kept around by the enclosing script.
animate()
The core animation call that is executed for each frame. Updates all registered embeddings, the pointer controls, and the camera position. Renders the scene using the WebVRManager, which applies the VREffect if in VR mode.
register(embedding)
Register an embedding so that it will be updated on each animation frame.
Kind: global function
Param | Type | Description |
---|---|---|
embedding | Embedding |
The embedding |
categoricalMap()
Return a function that defines a mapping from values for an attribute to target values. Can be used, for example, to map from attribute values to colors.
CSVDatasetCallback : function
A callback that is triggered after the dataset is loaded; typically used to create an embedding based on the dataset.
Kind: global typedef
Param | Type | Description |
---|---|---|
dataset | Dataset |
The Dataset loaded from the csv file |