You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working with vis.js to create a complex diagram, and I've encountered an issue that persists even in a simplified version of my project. The core of the problem is that, when I draw a large diagram, it seems to automatically add extra padding at the top, effectively pushing the diagram down.
This issue becomes more pronounced as the size of the diagram increases. For example, with var number_of_nodes = 100, the diagram gets pushed down by approximately half of the screen's height. However, with var number_of_nodes = 10, the extra padding is much less noticeable.
var xScale = 1;
var yScale = 10;
var number_of_nodes = 100. // This is the value makes the issue visible. But less visible when using 10
var graph = new Graph(document.getElementById('mynetwork'), xScale, yScale, theme, number_of_nodes);
To reproduce the issue, you'll need to set number_of_nodes to 100. I've created a complete example on jsfiddle, which can be found here: https://jsfiddle.net/master_chief/zy1Lfx2q/. Note: The number_of_nodes value needs to be updated to 100 in the example to observe the issue as described.
I have attempted step-by-step debugging but haven't been able to identify the cause of this unwanted padding. Does anyone see any obvious mistakes in my code, or has anyone encountered a similar issue and found a solution?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've been working with vis.js to create a complex diagram, and I've encountered an issue that persists even in a simplified version of my project. The core of the problem is that, when I draw a large diagram, it seems to automatically add extra padding at the top, effectively pushing the diagram down.
This issue becomes more pronounced as the size of the diagram increases. For example, with var number_of_nodes = 100, the diagram gets pushed down by approximately half of the screen's height. However, with var number_of_nodes = 10, the extra padding is much less noticeable.
To reproduce the issue, you'll need to set number_of_nodes to 100. I've created a complete example on jsfiddle, which can be found here: https://jsfiddle.net/master_chief/zy1Lfx2q/. Note: The number_of_nodes value needs to be updated to 100 in the example to observe the issue as described.
I have attempted step-by-step debugging but haven't been able to identify the cause of this unwanted padding. Does anyone see any obvious mistakes in my code, or has anyone encountered a similar issue and found a solution?
Beta Was this translation helpful? Give feedback.
All reactions