|
|
@ -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() |
|
|
|