Comments (5)
现在暂时只支持和react配合使用,暂时还不能和vue配合使用,抱歉
from butterfly.
@noonnightstorm 好的 谢谢回复
from butterfly.
// index.vue
<template>
<div id="dag-canvas"></div>
</template>
<script>
import FlowChartCanvas from './canvas';
import { mockData } from './data';
const Node = require('./node.js');
export default {
name: 'FlowChart',
mounted() {
const root = document.getElementById('dag-canvas');
this.canvas = new FlowChartCanvas({
root,
...
});
this.canvas.draw(mockData, {}, () => {
this.canvas.focusCenterWithAnimate();
});
this.canvas.on('events', (data) => {
console.log(data);
});
},
}
</script>
<style lang="less">
@import '~butterfly-dag/pack/index.css';
@import './node.less';
</style>
// canvas.js
import { Canvas } from 'butterfly-dag/pack/index';
class FlowChartCanvas extends Canvas {
constructor(...args) {
super(...args);
this.listenEventProxy();
}
listenEventProxy() {}
...
}
export default FlowChartCanvas;
node.js 和example里的基本一样
from butterfly.
// index.vue <template> <div id="dag-canvas"></div> </template> <script> import FlowChartCanvas from './canvas'; import { mockData } from './data'; const Node = require('./node.js'); export default { name: 'FlowChart', mounted() { const root = document.getElementById('dag-canvas'); this.canvas = new FlowChartCanvas({ root, ... }); this.canvas.draw(mockData, {}, () => { this.canvas.focusCenterWithAnimate(); }); this.canvas.on('events', (data) => { console.log(data); }); }, } </script> <style lang="less"> @import '~butterfly-dag/pack/index.css'; @import './node.less'; </style>
// canvas.js import { Canvas } from 'butterfly-dag/pack/index'; class FlowChartCanvas extends Canvas { constructor(...args) { super(...args); this.listenEventProxy(); } listenEventProxy() {} ... } export default FlowChartCanvas;
node.js 和example里的基本一样
我这两天会写一个react最佳实践,请问到时候方便贡献一下文档,提供个vue最佳实践呢?
from butterfly.
// index.vue <template> <div id="dag-canvas"></div> </template> <script> import FlowChartCanvas from './canvas'; import { mockData } from './data'; const Node = require('./node.js'); export default { name: 'FlowChart', mounted() { const root = document.getElementById('dag-canvas'); this.canvas = new FlowChartCanvas({ root, ... }); this.canvas.draw(mockData, {}, () => { this.canvas.focusCenterWithAnimate(); }); this.canvas.on('events', (data) => { console.log(data); }); }, } </script> <style lang="less"> @import '~butterfly-dag/pack/index.css'; @import './node.less'; </style>
// canvas.js import { Canvas } from 'butterfly-dag/pack/index'; class FlowChartCanvas extends Canvas { constructor(...args) { super(...args); this.listenEventProxy(); } listenEventProxy() {} ... } export default FlowChartCanvas;
node.js 和example里的基本一样
我这两天会写一个react最佳实践,请问到时候方便贡献一下文档,提供个vue最佳实践呢?
好的,这个组件挺好用的,赞
from butterfly.
Related Issues (20)
- node的render重写。数据更新后界面未更新 HOT 3
- 有考虑支持blazor服务端吗? HOT 2
- HotKeyPlugin 包里出现大小写问题,unFocus()跟unfocus() HOT 1
- 面板是否能提供插入node前的事件监听
- node节点添加自定义锚点dom,出现初始化卡顿。 HOT 9
- TreeCanvas类型,layout为compactBox。我如果不调用draw,手动去调用autoLayout方法的话,有疑问 HOT 1
- Uncaught ReferenceError: _drawPath is not defined HOT 10
- draw跟redraw的渲染问题 HOT 3
- Setting of coordinates or "d" attr values for Manhattan edges HOT 5
- canvas.draw / canvas.redraw always triggers event 'system.link.connect' HOT 2
- Missing function Group.addGroup / Group.addGroups HOT 9
- Redraw node / group HOT 5
- Moving union ingores groups HOT 2
- Invert zooming by wheel scrolling HOT 4
- Issue in next js HOT 2
- 基于react-lineage-dag 插件如何实现表层级流程得高亮 HOT 1
- 删除连线后,撤回删除,重新恢复的连线无法再用拖动的方式删除
- Future Support?
- interval导致内存泄露
- butterfly-vue 中 canvasData 是异步的,页面没渲染
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from butterfly.