forked from alibaba/butterfly
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d9eff5
commit fea1857
Showing
3 changed files
with
76 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
'use strict'; | ||
import React, {Component} from 'react'; | ||
require('./index.less'); | ||
require('butterfly-dag/dist/index.css'); | ||
|
||
const IndustryCanvas = require('./canvas'); | ||
const mockData = require('./data.js'); | ||
|
||
class Industry extends Component { | ||
constructor() { | ||
super(); | ||
} | ||
componentDidMount() { | ||
let root = document.getElementById('dag-canvas'); | ||
this.canvas = new IndustryCanvas({ | ||
root: root, | ||
disLinkable: true, // 可删除连线 | ||
linkable: false, // 可连线 | ||
draggable: true, // 可拖动 | ||
zoomable: true, // 可放大 | ||
moveable: true, // 可平移 | ||
css: { | ||
groupHoverClass: 'datac-group-drag-hover', // 节点移动到上面新增的class | ||
groupActiveClass: 'datac-group-drag-active' // 节点可移动到上面新增的class | ||
}, | ||
theme: { | ||
edge: { | ||
type: 'AdvancedBezier' | ||
}, | ||
} | ||
}); | ||
this.canvas.draw(mockData); | ||
|
||
} | ||
render() { | ||
return ( | ||
<div className='industry-page'> | ||
<div className="industry-canvas" id="dag-canvas"> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
module.exports = Industry; | ||
'use strict'; | ||
import React, {Component} from 'react'; | ||
require('./index.less'); | ||
require('butterfly-dag/dist/index.css'); | ||
|
||
const IndustryCanvas = require('./canvas'); | ||
const mockData = require('./data.js'); | ||
|
||
class Industry extends Component { | ||
constructor() { | ||
super(); | ||
} | ||
componentDidMount() { | ||
let root = document.getElementById('dag-canvas'); | ||
this.canvas = new IndustryCanvas({ | ||
root: root, | ||
disLinkable: true, // 可删除连线 | ||
linkable: false, // 可连线 | ||
draggable: true, // 可拖动 | ||
zoomable: true, // 可放大 | ||
moveable: true, // 可平移 | ||
css: { | ||
groupHoverClass: 'datac-group-drag-hover', // 节点移动到上面新增的class | ||
groupActiveClass: 'datac-group-drag-active' // 节点可移动到上面新增的class | ||
}, | ||
theme: { | ||
edge: { | ||
type: 'AdvancedBezier' | ||
}, | ||
} | ||
}); | ||
this.canvas.draw(mockData); | ||
|
||
} | ||
render() { | ||
return ( | ||
<div className='industry-page'> | ||
<div className="industry-canvas" id="dag-canvas"> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
module.exports = Industry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters