From b144a0e04e9ca86ed59d6e6850f58e17be0fde54 Mon Sep 17 00:00:00 2001 From: jos Date: Thu, 30 Apr 2015 17:20:22 +0200 Subject: [PATCH] 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)