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?
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?