diff --git a/HISTORY.md b/HISTORY.md index bef92593..7dd503c3 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -2,6 +2,15 @@ vis.js history http://visjs.org +## version 0.1.0 + +- Graph now uses an id based set of nodes and edges instead of a row based array + internally. +- Added support for DataSet to Graph. +- Methods getSelection and setSelection of Graph now accept a list with ids + instead of rows. + + ## 2013-06-07, version 0.0.9 - First working version of the Graph imported from the old library. diff --git a/docs/graph.html b/docs/graph.html index 39051935..5d3a41c4 100644 --- a/docs/graph.html +++ b/docs/graph.html @@ -1039,10 +1039,10 @@ var nodes = [
getSelection()
implementation.
- Returns an array with one or multiple selections. Each selection contains
- the property row
. The selections are not ordered.
+ setSelection(selection)
implementation.
- selection
is an array with selection elements. The visualization
- accepts one or multiple selection elements, which must have the property row
.
- Example usage: graph.setSelection([{"row": 3}]);
.
+ selection
is an array with ids of nodes to be selected.
+ The array selection
can contain zero or multiple ids.
+ Example usage: graph.setSelection([3, 5]);
will select
+ nodes with id 3 and 5.
-function onselect() { - var sel = graph.getSelection(); - - var info = 'selected row(s): '; - for (var i = 0; i < sel.length; i++) { - info += sel[i].row + ' '; - } - - alert(info); +function onSelect() { + alert('selected nodes: ' + graph.getSelection()); } -vis.events.addListener(graph, 'select', onselect); +vis.events.addListener(graph, 'select', onSelect);
@@ -1117,9 +1111,8 @@ vis.events.addListener(graph, 'select', onselect);
setSelection
- is executed. The corresponding rows in the Array are selected.
- getSelection
.
+ is executed. The ids of the selected nodes can be retrieved via the
+ method getSelection
.
+ This example demonstrates dynamically adding, updating and removing nodes + using a DataSet. +
+ +
+ Node+
|
+
+ Edge+
|
+
+ Nodes+ + |
+
+
+ Edges+ + |
+
+
+ Graph+ + |
+
diff --git a/examples/graph/16_dynamic_data.html b/examples/graph/16_dynamic_data.html new file mode 100644 index 00000000..ef25e8a8 --- /dev/null +++ b/examples/graph/16_dynamic_data.html @@ -0,0 +1,265 @@ + + +
+
+ + + + + + + + + +
+