![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
butterfly-dag
Advanced tools
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;
}
}
// 线,锚点如此类推,请看具体文档
FAQs
The npm package butterfly-dag receives a total of 1,446 weekly downloads. As such, butterfly-dag popularity was classified as popular.
We found that butterfly-dag demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.