Browse Source

render issue with hierarchical layout

flowchartTest
Alex de Mulder 9 years ago
parent
commit
b413dd5b34
3 changed files with 54 additions and 58 deletions
  1. +0
    -2
      dist/vis.js
  2. +54
    -54
      examples/network/27_world_cup_network.html
  3. +0
    -2
      lib/network/modules/LayoutEngine.js

+ 0
- 2
dist/vis.js View File

@ -24069,7 +24069,6 @@ return /******/ (function(modules) { // webpackBootstrap
});
this.body.emitter.on('_resetHierarchicalLayout', function () {
_this.setupHierarchicalLayout();
_this.body.emitter.emit('fit', { duration: 0 });
});
}
}, {
@ -24095,7 +24094,6 @@ return /******/ (function(modules) { // webpackBootstrap
}
}
this.body.emitter.emit('_resetHierarchicalLayout');
// because the hierarchical system needs it's own physics and smooth curve settings, we adapt the other options if needed.
return this.adaptAllOptions(allOptions);
} else {

+ 54
- 54
examples/network/27_world_cup_network.html View File

@ -69,66 +69,66 @@ Hide nodes on drag:
<div id="mynetwork"></div>
<script type="text/javascript">
var dropdown = document.getElementById("dropdownID");
dropdown.onchange = update;
var roundnessSlider = document.getElementById("roundnessSlider");
roundnessSlider.onchange = update;
var roundnessScreen = document.getElementById("roundnessScreen");
var hideEdgesOnDrag = document.getElementById("hideEdgesOnDrag");
hideEdgesOnDrag.onchange = update;
var hideNodesOnDrag = document.getElementById("hideNodesOnDrag");
hideNodesOnDrag.onchange = update;
var inheritColor = document.getElementById("inheritColor");
inheritColor.onchange = redrawAll;
// var dropdown = document.getElementById("dropdownID");
// dropdown.onchange = update;
//
// var roundnessSlider = document.getElementById("roundnessSlider");
// roundnessSlider.onchange = update;
//
// var roundnessScreen = document.getElementById("roundnessScreen");
// var hideEdgesOnDrag = document.getElementById("hideEdgesOnDrag");
// hideEdgesOnDrag.onchange = update;
// var hideNodesOnDrag = document.getElementById("hideNodesOnDrag");
// hideNodesOnDrag.onchange = update;
// var inheritColor = document.getElementById("inheritColor");
// inheritColor.onchange = redrawAll;
//
var network;
function redrawAll() {
network = null;
var inheritColorVal = inheritColor.value;
// network = null;
//
// var inheritColorVal = inheritColor.value;
var container = document.getElementById('mynetwork');
var options = {
nodes: {
shape: 'dot',
radiusMin: 10,
radiusMax: 30,
fontSize: 12,
fontFace: "Tahoma"
},
edges: {
width: 0.15,
inheritColor: "from"
},
tooltip: {
delay: 200,
fontSize: 12,
color: {
background: "#fff"
}
},
smoothCurves: {dynamic: false, type: "continuous"},
stabilize: false,
physics: {
barnesHut: {
gravitationalConstant: 0,
centralGravity: 0,
springConstant: 0
}
},
hideEdgesOnDrag: true
};
if (inheritColorVal == "false") {
options['edges']['inheritColor'] = false;
}
else {
options['edges']['inheritColor'] = inheritColorVal;
}
var options = {}
// nodes: {
// shape: 'dot',
// radiusMin: 10,
// radiusMax: 30,
// fontSize: 12,
// fontFace: "Tahoma"
// },
// edges: {
// width: 0.15,
// inheritColor: "from"
// },
// tooltip: {
// delay: 200,
// fontSize: 12,
// color: {
// background: "#fff"
// }
// },
// smoothCurves: {dynamic: false, type: "continuous"},
// stabilize: false,
// physics: {
// barnesHut: {
// gravitationalConstant: 0,
// centralGravity: 0,
// springConstant: 0
// }
// },
// hideEdgesOnDrag: true
// };
// 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);

+ 0
- 2
lib/network/modules/LayoutEngine.js View File

@ -31,7 +31,6 @@ class LayoutEngine {
})
this.body.emitter.on('_resetHierarchicalLayout', () => {
this.setupHierarchicalLayout();
this.body.emitter.emit('fit',{duration:0});
});
}
@ -57,7 +56,6 @@ class LayoutEngine {
}
}
this.body.emitter.emit('_resetHierarchicalLayout');
// because the hierarchical system needs it's own physics and smooth curve settings, we adapt the other options if needed.
return this.adaptAllOptions(allOptions);
}

Loading…
Cancel
Save