GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - lkiarest/flow-chart: 流程图工具

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
demo
demo
 
 
libs
libs
 
 
test
test
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
chart.css
chart.css
 
 
chart.js
chart.js
 
 
chart.less
chart.less
 
 
grid.png
grid.png
 
 

Repository files navigation

flow-chart

流程图工具

Demo演示:https://lkiarest.github.io/flow-chart/demo/demo.html

基于 jsplumb 封装一个使用十分简单的流程图处理类。

样式使用less处理

引入依赖文件

<link rel="stylesheet" type="text/css" href="../chart.css">
<script src="../libs/jquery.min.js"></script>
<script src="../libs/jsPlumb.min.js"></script>
<script src='../chart.js'></script>

常用操作

Chart.ready(() => { // 初始化
    // 创建画布
    let chart = new Chart($('#div1'), {
        onNodeClick (data) { // 点击节点时触发的事件
            console.log(data);
        }
    });

    // 添加节点
    let nodeStart = chart.addNode('开始', basicX, startY, {
        class: 'node-start', // 自定义节点样式
        data: { // 节点绑定数据,在click事件中可以获取
            name: '开始',
            nodeType: 0
        }
    });
    // 添加端口
    nodeStart.addPort({
        isSource: true
    });

    // 获取所有节点
    console.log(chart.getNodes());

    // 序列化用以保存
    console.log(JSON.stringify(chart.toJson()));

    // 删除节点 - 1
    nodeStart.dispose();
    // 删除节点 - 2
    chart.removeNode(nodeStart.getId());
});

About

流程图工具

Resources

Readme
MIT license
Activity

Stars

164 stars

Watchers

11 watching

Forks

61 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.