From 6aebfcf60244de0798357c8cf28d6ba2ee72d9db Mon Sep 17 00:00:00 2001 From: jos Date: Thu, 30 Apr 2015 17:04:37 +0200 Subject: [PATCH 1/2] Some updates in example 29 30 --- .../network/29_neighbourhood_highlight.html | 5 +- examples/network/30_importing_from_gephi.html | 254 ++++++++++-------- 2 files changed, 151 insertions(+), 108 deletions(-) diff --git a/examples/network/29_neighbourhood_highlight.html b/examples/network/29_neighbourhood_highlight.html index 8c04a349..704cf333 100644 --- a/examples/network/29_neighbourhood_highlight.html +++ b/examples/network/29_neighbourhood_highlight.html @@ -15,7 +15,8 @@ border: 1px solid lightgray; } - + + @@ -213,6 +214,4 @@ redrawAll() - - diff --git a/examples/network/30_importing_from_gephi.html b/examples/network/30_importing_from_gephi.html index b7c9e131..7d070dd7 100644 --- a/examples/network/30_importing_from_gephi.html +++ b/examples/network/30_importing_from_gephi.html @@ -1,107 +1,148 @@ - - Dynamic Data - Importing from Gephi (JSON) - - - - - + pre { + padding: 5px; + margin: 5px; + } + + .string { + color: green; + } + + .number { + color: darkorange; + } + + .boolean { + color: blue; + } + + .null { + color: magenta; + } + + .key { + color: red; + } + + +

Dynamic Data - Importing from Gephi (JSON)

+
- This example shows how to import a JSON file exported by Gephi. The two options available for the import are - available through the checkboxes. You can download the Gephi JSON exporter here: - https://marketplace.gephi.org/plugin/json-exporter/. - All of Gephi's attributes are also contained within the node elements. This means you can access all of this data through the DataSet. -
+ This example shows how to import a JSON file exported by Gephi. The two + options available for the import are + available through the checkboxes. You can download the Gephi JSON exporter + here: + https://marketplace.gephi.org/plugin/json-exporter/. + All of Gephi's attributes are also contained within the node elements. This + means you can access all of this data through the DataSet. +
+

+
+ +

-: Allow to move after import.
-: Parse the color instead of copy (adds borders, highlights etc.)
-

Node Content:

+

Node Content:

+

+
- - + + From b144a0e04e9ca86ed59d6e6850f58e17be0fde54 Mon Sep 17 00:00:00 2001 From: jos Date: Thu, 30 Apr 2015 17:20:22 +0200 Subject: [PATCH 2/2] Some configuration fixes in example 27 --- examples/network/27_world_cup_network.html | 61 +++++++++++----------- examples/network/31_localization.html | 9 ++-- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/examples/network/27_world_cup_network.html b/examples/network/27_world_cup_network.html index fac2d30e..da8c1a94 100644 --- a/examples/network/27_world_cup_network.html +++ b/examples/network/27_world_cup_network.html @@ -95,54 +95,55 @@ Hide nodes on drag: var options = { nodes: { shape: 'dot', - radiusMin: 10, - radiusMax: 30, - fontSize: 12, - fontFace: "Tahoma" + scaling: { + min: 10, + max: 30 + }, + font: { + size: 12, + face: "Tahoma" + } }, edges: { width: 0.15, - inheritColor: "from" - }, - tooltip: { - delay: 200, - fontSize: 12, color: { - background: "#fff" + inherit: (inheritColorVal == "false") ? false : inheritColorVal + }, + smooth: { + dynamic: false, + type: "continuous" } }, - smoothCurves: {dynamic: false, type: "continuous"}, - stabilize: false, - physics: { - barnesHut: { - gravitationalConstant: 0, - centralGravity: 0, - springConstant: 0 - } + interaction: { + tooltipDelay: 200 }, - hideEdgesOnDrag: true + rendering: { + hideEdgesOnDrag: true + }, + physics: false }; - if (inheritColorVal == "false") { - options['edges']['inheritColor'] = false; - } - else { - options['edges']['inheritColor'] = inheritColorVal; - } - // Note: data is coming from ./data/WorldCup2014.js network = new vis.Network(container, data, options); + network.fit({animation: false}); } function update() { var type = dropdown.value; var roundness = roundnessSlider.value; roundnessScreen.value = roundness; - var options = {smoothCurves: {type: type, roundness: roundness}} - options['hideEdgesOnDrag'] = hideEdgesOnDrag.checked; - options['hideNodesOnDrag'] = hideNodesOnDrag.checked; + var options = { + edges: { + smooth: { + type: type, + roundness: roundness + } + } + }; + options.rendering.hideEdgesOnDrag = hideEdgesOnDrag.checked; + options.rendering.hideNodesOnDrag = hideNodesOnDrag.checked; - //network.setOptions(options); + network.setOptions(options); } redrawAll() diff --git a/examples/network/31_localization.html b/examples/network/31_localization.html index f096955b..dfa5daf3 100644 --- a/examples/network/31_localization.html +++ b/examples/network/31_localization.html @@ -122,8 +122,10 @@ edges: edges }; var options = { - stabilize: false, - dataManipulation: true, + physics: { + stabilization: false + }, + manipulation: true, onAdd: function(data,callback) { var span = document.getElementById('operation'); var idInput = document.getElementById('node-id'); @@ -203,7 +205,8 @@ select.onchange(); } - + +

Editing the dataset (localized)