Auto commit: 2026-03-13T16:18:43.826Z
This commit is contained in:
parent
ef8a8d4c27
commit
bc8c102df7
BIN
assets/pasted-20260313-122618-10540224.png
Normal file
BIN
assets/pasted-20260313-122618-10540224.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 MiB |
@ -239,7 +239,42 @@
|
||||
|
||||
const network = new vis.Network(container, data, options);
|
||||
|
||||
function fitNetwork() {
|
||||
|
||||
// Change Layout function
|
||||
function changeLayout(value) {
|
||||
if (value === 'hierarchical') {
|
||||
network.setOptions({
|
||||
layout: {
|
||||
improvedLayout: true,
|
||||
hierarchical: {
|
||||
direction: 'UD',
|
||||
sortMethod: 'directed'
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
network.setOptions({
|
||||
layout: {
|
||||
improvedLayout: true,
|
||||
hierarchical: false
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Zoom In function
|
||||
function zoomIn() {
|
||||
var scale = network.getScale();
|
||||
network.moveTo({ scale: scale * 1.5 });
|
||||
}
|
||||
|
||||
// Zoom Out function
|
||||
function zoomOut() {
|
||||
var scale = network.getScale();
|
||||
network.moveTo({ scale: scale / 1.5 });
|
||||
}
|
||||
|
||||
function fitNetwork() {
|
||||
network.fit({ animation: { duration: 1000, easingFunction: 'easeInOutQuad' } });
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user