-
Notifications
You must be signed in to change notification settings - Fork 722
First Project
Hermann Plass edited this page Feb 22, 2018
·
6 revisions
npm install litegraph.js
<html>
<head>
<script type="text/javascript" src="/litegraph.js"></script>
</head>
<body style='width:100%; height:100%'>
<canvas id='mycanvas' width='1024' height='720' style='border: 1px solid'></canvas>
<script>
var graph = new LGraph();
var canvas = new LGraphCanvas("#mycanvas", graph);
var node_const = LiteGraph.createNode("basic/const");
node_const.pos = [200,200];
graph.add(node_const);
node_const.setValue(4.5);
var node_watch = LiteGraph.createNode("basic/watch");
node_watch.pos = [700,200];
graph.add(node_watch);
node_const.connect(0, node_watch, 0 );
graph.start()
</script>
</body>
</html>
From this point you may check the list of available Node types or the guide to Creating custom Nodes.
For more info about methods and properties check the available documentation.