Browse Source

Some configuration fixes in example 27

flowchartTest
jos 9 years ago
parent
commit
b144a0e04e
2 changed files with 37 additions and 33 deletions
  1. +31
    -30
      examples/network/27_world_cup_network.html
  2. +6
    -3
      examples/network/31_localization.html

+ 31
- 30
examples/network/27_world_cup_network.html View File

@ -95,54 +95,55 @@ Hide nodes on drag:
var options = { var options = {
nodes: { nodes: {
shape: 'dot', shape: 'dot',
radiusMin: 10,
radiusMax: 30,
fontSize: 12,
fontFace: "Tahoma"
scaling: {
min: 10,
max: 30
},
font: {
size: 12,
face: "Tahoma"
}
}, },
edges: { edges: {
width: 0.15, width: 0.15,
inheritColor: "from"
},
tooltip: {
delay: 200,
fontSize: 12,
color: { 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 // Note: data is coming from ./data/WorldCup2014.js
network = new vis.Network(container, data, options); network = new vis.Network(container, data, options);
network.fit({animation: false});
} }
function update() { function update() {
var type = dropdown.value; var type = dropdown.value;
var roundness = roundnessSlider.value; var roundness = roundnessSlider.value;
roundnessScreen.value = roundness; 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() redrawAll()

+ 6
- 3
examples/network/31_localization.html View File

@ -122,8 +122,10 @@
edges: edges edges: edges
}; };
var options = { var options = {
stabilize: false,
dataManipulation: true,
physics: {
stabilization: false
},
manipulation: true,
onAdd: function(data,callback) { onAdd: function(data,callback) {
var span = document.getElementById('operation'); var span = document.getElementById('operation');
var idInput = document.getElementById('node-id'); var idInput = document.getElementById('node-id');
@ -203,7 +205,8 @@
select.onchange(); select.onchange();
} }
</script> </script>
<script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-61231638-1', 'auto');ga('send', 'pageview');</script></head>
<script src="../googleAnalytics.js"></script>
</head>
<body onload="draw();"> <body onload="draw();">
<h2>Editing the dataset (localized)</h2> <h2>Editing the dataset (localized)</h2>

Loading…
Cancel
Save