New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

butterfly-dag

Package Overview
Dependencies
Maintainers
1
Versions
523
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

butterfly-dag

一个基于数据驱动的节点式编排组件库,让你有方便快捷定制可视化流程图表

  • 2.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
400
decreased by-80.74%
Maintainers
1
Weekly downloads
 
Created
Source

小蝴蝶

一个基于JS的数据驱动的节点式编排组件库

Build Status CircleCI

特性

  • 开箱即用的参考DEMO,可在线调试
  • 全方位管理画布,开发者只需要更专注定制化的需求
  • 灵活性,可塑性,拓展性优秀

安装

npm install butterfly-dag

快速上手

生成画布

const Canvas = require('butterfly-dag').Canvas;
let canvas = new Canvas({
  root: dom,              //canvas的根节点(必传)
  zoomable: true,         //可缩放(可传)
  moveable: true,         //可平移(可传)
  draggable: true,        //节点可拖动(可传)
});
canvas.draw({
  groups: [],  //分组信息
  nodes: [],  //节点信息
  edges: []  // 连线信息
})

定制元素(节点组,节点,线,锚点)

// 定制节点
const Node = require('butterfly-dag').Node;
class ANode extend Node {
  draw() {
    // 这里定制您需要的节点并返回一个dom
    let div = document.createElement("div"); 
    div.innerHTML('helloworld');
    return div
  }
}

// 定制节点组
const Group = require('butterfly-dag').Group;
class AGroup extend Group {
  draw() {
    // 这里定制您需要的节点组并返回一个dom
    let container = document.createElement("div"); 
    container.className = 'container';
    let title = document.createElement('p');
    title.innerHTML = 'group name'
    container.appendChild(title);
    return container;
  }
}

// 线,锚点如此类推,请看具体文档

API文档

Keywords

FAQs

Package last updated on 11 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc