diff --git a/examples/graph/02_random_nodes.html b/examples/graph/02_random_nodes.html index a3de91a5..b048a69d 100755 --- a/examples/graph/02_random_nodes.html +++ b/examples/graph/02_random_nodes.html @@ -88,7 +88,7 @@ // add event listeners vis.events.addListener(graph, 'select', function(params) { document.getElementById('selection').innerHTML = - 'Selection: ' + JSON.stringify(graph.getSelection()); + 'Selection: ' + graph.getSelection(); }); } diff --git a/examples/graph/07_selections.html b/examples/graph/07_selections.html index 25c761e2..421c3794 100644 --- a/examples/graph/07_selections.html +++ b/examples/graph/07_selections.html @@ -52,24 +52,13 @@ // add event listener function onSelect() { - var selection = graph.getSelection(); - - var info = 'selection: '; - selection.forEach(function (s) { - info += s.row + ' '; - }); - - document.getElementById('info').innerHTML += info + '
'; + document.getElementById('info').innerHTML += + 'selection: ' + graph.getSelection().join(', ') + '
'; } vis.events.addListener(graph, 'select', onSelect); - // set initial selection (row based, zero-based) - var selection = [ - {'row': 2}, - {'row': 3}, - {'row': 4} - ]; - graph.setSelection(selection); + // set initial selection (id's of some nodes) + graph.setSelection([3, 4, 5]); diff --git a/examples/graph/15_dot_language_playground.html b/examples/graph/15_dot_language_playground.html index a6e96c86..bf757cd8 100644 --- a/examples/graph/15_dot_language_playground.html +++ b/examples/graph/15_dot_language_playground.html @@ -48,7 +48,7 @@ } - + @@ -140,8 +140,7 @@ digraph { A -> A[label=0.5]; B -> B[label=1.2] -> C[label=0.7] -- A; B -> D; - D -> B; - D -> C; + D -> {B; C} D -> E[label=0.2]; F -> F; A [ @@ -199,11 +198,5 @@ digraph G { } - - diff --git a/examples/graph/16_dynamic_data.html b/examples/graph/16_dynamic_data.html new file mode 100644 index 00000000..b4ccb596 --- /dev/null +++ b/examples/graph/16_dynamic_data.html @@ -0,0 +1,265 @@ + + + + Graph | DataSet + + + + + + + + + + + +

+ This example demonstrates dynamically adding, updating and removing nodes + and edges using a DataSet. +

+ +

Adjust

+
+ + + + + +
+

Node

+ + + + + + + + + + + + + + + + +
Action + + + +
+
+

Edge

+ + + + + + + + + + + + + + + + + + + + + +
Action + + + +
+
+ +

View

+ + + + + + + + + + + + + +
+

Nodes

+

+        
+

Edges

+

+        
+

Graph

+
+
+ + + diff --git a/examples/graph/graphviz/graphviz_gallery.html b/examples/graph/graphviz/graphviz_gallery.html index c5d96ed2..3260187d 100644 --- a/examples/graph/graphviz/graphviz_gallery.html +++ b/examples/graph/graphviz/graphviz_gallery.html @@ -57,9 +57,7 @@ -

diff --git a/examples/timeline/02_dataset.html b/examples/timeline/02_dataset.html index 81c1d0dd..c1987abd 100644 --- a/examples/timeline/02_dataset.html +++ b/examples/timeline/02_dataset.html @@ -7,12 +7,15 @@ body, html { font-family: arial, sans-serif; font-size: 11pt; + height: 100%; + margin: 0; + padding: 0; } #visualization { box-sizing: border-box; width: 100%; - height: 300px; + height: 100%; } @@ -26,7 +29,7 @@ // create a dataset with items var items = new vis.DataSet({ - fieldTypes: { + convert: { start: 'Date', end: 'Date' } @@ -44,6 +47,7 @@ var options = { start: now.clone().add('days', -3), end: now.clone().add('days', 7), + orientation: 'top', height: '100%' }; diff --git a/examples/timeline/03_much_data.html b/examples/timeline/03_much_data.html index 36221ad7..5d778975 100644 --- a/examples/timeline/03_much_data.html +++ b/examples/timeline/03_much_data.html @@ -27,7 +27,7 @@ // create a dataset with items var now = moment().minutes(0).seconds(0).milliseconds(0); var items = new vis.DataSet({ - fieldTypes: { + convert: { start: 'Date', end: 'Date' } diff --git a/examples/timeline/05_groups.html b/examples/timeline/05_groups.html index 42ae2d1c..880a7326 100644 --- a/examples/timeline/05_groups.html +++ b/examples/timeline/05_groups.html @@ -19,6 +19,11 @@ +

+ This example demonstrate using groups. Note that a DataSet is used for both + items and groups, allowing to dynamically add, update or remove both items + and groups via the DataSet. +