From 210e8feae2fb4842bfb2de38666e6c41671fef3c Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Wed, 27 Sep 2017 12:42:48 -0400 Subject: removed lib --- www/lib/vis/docs/data/dataview.html | 413 ------------------------------------ 1 file changed, 413 deletions(-) delete mode 100644 www/lib/vis/docs/data/dataview.html (limited to 'www/lib/vis/docs/data/dataview.html') diff --git a/www/lib/vis/docs/data/dataview.html b/www/lib/vis/docs/data/dataview.html deleted file mode 100644 index 9a98f7f2..00000000 --- a/www/lib/vis/docs/data/dataview.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - - - - - - DataView - vis.js - A dynamic, browser based visualization library. - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -

DataView

- -

Contents

- - - -

Overview

- -

- A DataView offers a filtered and/or formatted view on a - DataSet. - One can subscribe to changes in a DataView, and easily get filtered or - formatted data without having to specify filters and field types all - the time. -

- -

Example

- -

- The following example shows how to use a DataView. -

- -
-// create a DataSet
-var data = new vis.DataSet();
-data.add([
-  {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},
-  {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
-  {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
-  {id: 4, text: 'item 4'}
-]);
-
-// create a DataView
-// the view will only contain items having a property group with value 1,
-// and will only output fields id, text, and date.
-var view = new vis.DataView(data, {
-  filter: function (item) {
-    return (item.group == 1);
-  },
-  fields: ['id', 'text', 'date']
-});
-
-// subscribe to any change in the DataView
-view.on('*', function (event, properties, senderId) {
-  console.log('event', event, properties);
-});
-
-// update an item in the data set
-data.update({id: 2, group: 1});
-
-// get all ids in the view
-var ids = view.getIds();
-console.log('ids', ids); // will output [1, 2]
-
-// get all items in the view
-var items = view.get();
-
- -

Construction

- - -

- A DataView can be constructed as: -

- -
-var data = new vis.DataView(dataset, options)
-
- -

- where: -

- - - -

Methods

- -

DataView contains the following methods.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturn TypeDescription
- get([options] [, data])
- get(id [,options] [, data])
- get(ids [, options] [, data]) -
Object | Array - Get a single item, multiple items, or all items from the DataView. - Usage examples can be found in section Getting Data, and the available options are described in section Data Selection. When no item is found, null is returned when a single item was requested, and and empty Array is returned in case of multiple id's. -
- getDataSet() - DataSet - Get the DataSet to which the DataView is connected. -
- getIds([options]) - Number[] - Get ids of all items or of a filtered set of items. - Available options are described in section Data Selection, except that options fields and type are not applicable in case of getIds. -
off(event, callback)none - Unsubscribe from an event, remove an event listener. See section Subscriptions. -
on(event, callback)none - Subscribe to an event, add an event listener. See section Subscriptions. -
refresh()none - Refresh the filter results of a DataView. Useful when the filter function contains dynamic properties, like: - -
var data = new vis.DataSet(...);
-var view = new vis.DataView(data, {
-  filter: function (item) {
-    return item.value > threshold;
-  }
-});
- In this example, threshold is an external parameter. When the value of threshold changes, the DataView must be notified that the filter results may have changed by calling DataView.refresh(). -
- setData(data) - none - Replace the DataSet of the DataView. Parameter data can be a DataSet or a DataView. -
- - -

Properties

- -

DataView contains the following properties.

- - - - - - - - - - - - - - - - - -
PropertyTypeDescription
lengthNumberThe number of items in the DataView.
- -

Getting Data

- -

- Data of the DataView can be retrieved using the method get. -

- -
-var items = view.get();
-
- -

- Data of a DataView can be filtered and formatted again, in exactly the - same way as in a DataSet. See sections - Data Manipulation and - Data Selection for more - information. -

- -
-var items = view.get({
-  fields: ['id', 'score'],
-  filter: function (item) {
-    return (item.score > 50);
-  }
-});
-
- - - -

Subscriptions

-

- One can subscribe on changes in the DataView. Subscription works exactly - the same as for DataSets. See the documentation on - subscriptions in a DataSet - for more information. -

- -
-// create a DataSet and a view on the data set
-var data = new vis.DataSet();
-var view = new vis.DataView({
-  filter: function (item) {
-    return (item.group == 2);
-  }
-});
-
-// subscribe to any change in the DataView
-view.on('*', function (event, properties, senderId) {
-  console.log('event:', event, 'properties:', properties, 'senderId:', senderId);
-});
-
-// add, update, and remove data in the DataSet...
-
- -
- - - - - - - - - - - - - - - \ No newline at end of file -- cgit v1.2.3