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