We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
手动绘制泳道图时发现的问题,自定义分组,在index里面写好了坐标,将坐标数据传入GroupNode.model之后发现有的坐标会被自动添加10个点的坐标,导致图无法对齐,拖动也一样,永远无法拖动到线上对齐,不是自动添加10个点,就是少了10个点的坐标,希望能修复这个问题
demo:
const num = 4 const childrenLaneNodes = []
const childrenlaneWidth = 350 const childrenlaneHeight = 700 for (let i = 0; i < num; i++) { const nodeId = lane_${i + 1} // childrenLanes.push(nodeId) const x = 300 + (i * childrenlaneWidth) childrenLaneNodes.push( { type: 'lane', x: x, y: 400, width: childrenlaneWidth, height: childrenlaneHeight, resizable: false, draggable: false, id: nodeId, }, ) } console.log(childrenLaneNodes) graphData.value = { nodes: [ ...childrenLaneNodes ], } lf.render(graphData.value)
lane_${i + 1}
import { GroupNode } from '@logicflow/extension'
class lane extends GroupNode.view {}
class LaneModel extends GroupNode.model { initNodeData(data: any) { console.log(data, 111) super.initNodeData(data) this.isRestrict = true this.resizable = data.resizable === undefined ? false : data.resizable this.draggable = data.draggable === undefined ? true : data.draggable this.width = data.width ? data.width : 500 this.height = data.height ? data.height : 500 } getNodeStyle() { const style = super.getNodeStyle() style.stroke = '#AEAFAE' style.strokeWidth = 1 return style } getAnchorStyle() { const style: any = super.getAnchorStyle({}) style.stroke = 'transparent' style.fill = 'none' style.hover.stroke = 'transparent' return style } }
export default { type: 'lane', model: LaneModel, view: lane }
The text was updated successfully, but these errors were encountered:
打扰了,是网格的缘故,网格对齐,去掉网格就好了
Sorry, something went wrong.
No branches or pull requests
问题描述
手动绘制泳道图时发现的问题,自定义分组,在index里面写好了坐标,将坐标数据传入GroupNode.model之后发现有的坐标会被自动添加10个点的坐标,导致图无法对齐,拖动也一样,永远无法拖动到线上对齐,不是自动添加10个点,就是少了10个点的坐标,希望能修复这个问题
最简复现
demo:
const num = 4
const childrenLaneNodes = []
const childrenlaneWidth = 350
const childrenlaneHeight = 700
for (let i = 0; i < num; i++) {
const nodeId =
lane_${i + 1}
// childrenLanes.push(nodeId)
const x = 300 + (i * childrenlaneWidth)
childrenLaneNodes.push(
{
type: 'lane',
x: x,
y: 400,
width: childrenlaneWidth,
height: childrenlaneHeight,
resizable: false,
draggable: false,
id: nodeId,
},
)
}
console.log(childrenLaneNodes)
graphData.value = {
nodes: [
...childrenLaneNodes
],
}
lf.render(graphData.value)
import { GroupNode } from '@logicflow/extension'
class lane extends GroupNode.view {}
class LaneModel extends GroupNode.model {
initNodeData(data: any) {
console.log(data, 111)
super.initNodeData(data)
this.isRestrict = true
this.resizable = data.resizable === undefined ? false : data.resizable
this.draggable = data.draggable === undefined ? true : data.draggable
this.width = data.width ? data.width : 500
this.height = data.height ? data.height : 500
}
getNodeStyle() {
const style = super.getNodeStyle()
style.stroke = '#AEAFAE'
style.strokeWidth = 1
return style
}
getAnchorStyle() {
const style: any = super.getAnchorStyle({})
style.stroke = 'transparent'
style.fill = 'none'
style.hover.stroke = 'transparent'
return style
}
}
export default {
type: 'lane',
model: LaneModel,
view: lane
}
The text was updated successfully, but these errors were encountered: