This commit is contained in:
clay
2024-03-04 19:13:43 +08:00
commit e44edd71c0
350 changed files with 52288 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
/**
* @author: Clay
* @data: 2019/07/18
* @description: 线公共方法
*/
import utils from '../../utils'
export default {
draw(cfg, group) {
const { startPoint, endPoint } = cfg
const keyShape = group.addShape('path', {
className: 'edge-shape',
attrs: {
...cfg.style,
path: [
['M', startPoint.x, startPoint.y],
['L', endPoint.x, endPoint.y]
]
},
name: 'edge-shape'
})
keyShape.attrs.endArrow = true
return keyShape
},
setState(name, value, item) {
// 设置边状态
utils.edge.setState(name, value, item)
}
}

View File

@@ -0,0 +1,18 @@
/**
* @author: clay
* @data: 2019/07/18
* @description: register edges
*/
import topCubic from './top-cubic'
const obj = {
topCubic
}
export default function(G6) {
Object.values(obj).map(item => {
G6.registerEdge(item.name, item.options, item.extendName)
})
}

View File

@@ -0,0 +1,14 @@
/**
* @author: Clay
* @data: 2019/07/18
* @description: 曲线
*/
import base from './base'
export default {
name: 'top-cubic',
extendName: 'cubic',
options: {
...base
}
}