litegraph实现一个节点工作流效果代码

代码语言:html

所属分类:图表

代码描述:litegraph实现一个节点工作流效果代码

代码标签: 节点 工作流 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<html>
<head>
    <meta charset="UTF-8">
    <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/litegraph.css">
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/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);


        //node constructor class
        function MyAddNode() {
            this.addInput("A", "number");
            this.addInput("B", "number");
            this.addOutput("A+B", "number");
            this.properties = {
                precision: 1
            };
        }

        //name to show
        MyAddNode.title = "测试";

        //function to call when the node is execute.........完整代码请登录后点击上方下载按钮下载查看

网友评论0