From 65e763c7a284d7bdf6efb14073f7a854e726868b Mon Sep 17 00:00:00 2001
From: josdejong
Date: Thu, 20 Jun 2013 16:02:07 +0200
Subject: [PATCH] Examples upated
---
examples/graph/02_random_nodes.html | 2 +-
examples/graph/07_selections.html | 19 +-
.../graph/15_dot_language_playground.html | 11 +-
examples/graph/16_dynamic_data.html | 265 ++++++++++++++++++
examples/graph/graphviz/graphviz_gallery.html | 2 -
examples/timeline/02_dataset.html | 8 +-
examples/timeline/03_much_data.html | 2 +-
examples/timeline/05_groups.html | 7 +-
img/gallery/graph/16_dynamic_data.png | Bin 0 -> 17832 bytes
index.html | 6 +
10 files changed, 291 insertions(+), 31 deletions(-)
create mode 100644 examples/graph/16_dynamic_data.html
create mode 100644 img/gallery/graph/16_dynamic_data.png
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]);
+
@@ -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 {
}
-
-