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 want to fix the nodes at the top position of the canvas, but no matter how I adjust the node.y value, they are always positioned closer to the middle of the canvas.
Below is my page code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF8" />
<title>Vis Network Example Applications </title>
<script type="text/javascript" src="js/vis-network.min.js"></script>
<style type="text/css">
#mynetwork {
width: 100px;
height: 600px;
border: 1px solid lightgray;
}
</style>
</head>
<body>
<div id="mynetwork"></div>
<script type="text/javascript">
var nodes = new vis.DataSet([
{id: 1, label: 'Node 1', fixed: true, x:-140, y:-180},
{id: 2, label: 'Node 2', fixed: true, x:-140, y:-120},
]);
var edges = new vis.DataSet([]);
var options = { physics: false};
var container = document.getElementById('mynetwork');
var data = { nodes: nodes, edges: edges };
var network = new vis.Network(container, data, options);
</script>
</body>
</html>
How can I modify it so that the node be placed at the top of the canvas?
The text was updated successfully, but these errors were encountered:
joylix
changed the title
How to fix the node at the top of the canvas
node can not be fixed to the top of the canvas
Jul 9, 2024
I want to fix the nodes at the top position of the canvas, but no matter how I adjust the node.y value, they are always positioned closer to the middle of the canvas.
Below is my page code:
How can I modify it so that the node be placed at the top of the canvas?
The text was updated successfully, but these errors were encountered: