|
|
@ -97,8 +97,6 @@ function initG6(){ |
|
|
|
// here you need to update the related edges manualy since the new properties { startIndex, startX } for the nodes are custom, and cannot be recognized by G6 |
|
|
|
edgesToUpdate.forEach(edge => edge.refresh()) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
click(e) { |
|
|
|
const { |
|
|
@ -109,7 +107,6 @@ function initG6(){ |
|
|
|
if (!item) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (shape.get("name") === "collapse") { |
|
|
|
graph.updateItem(item, { |
|
|
|
collapsed: true, |
|
|
@ -131,8 +128,9 @@ function initG6(){ |
|
|
|
} |
|
|
|
}) |
|
|
|
edges.forEach(edg => { |
|
|
|
if((edg.getModel().sourceKey === columnName && edg.getModel().source === item.getModel().id) |
|
|
|
|| (edg.getModel().targetKey === columnName && edg.getModel().target === item.getModel().id)){ |
|
|
|
if (edg.getModel().sourceKey === columnName && edg.getModel().source === item.getModel().id) { |
|
|
|
edg.show() |
|
|
|
} else if(edg.getModel().targetKey === columnName && edg.getModel().target === item.getModel().id){ |
|
|
|
edg.show() |
|
|
|
} else{ |
|
|
|
edg.hide() |
|
|
@ -244,7 +242,7 @@ function initG6(){ |
|
|
|
// must be assigned in G6 3.3 and later versions. it can be any string you want, but should be unique in a custom item type |
|
|
|
name: "path-shape", |
|
|
|
}); |
|
|
|
} else if (!sourceNode.collapsed) { |
|
|
|
} else { |
|
|
|
let gap = Math.abs((startPoint.y - endPoint.y) / 3); |
|
|
|
if (startPoint["index"] === 1) { |
|
|
|
gap = -gap; |
|
|
@ -270,7 +268,6 @@ function initG6(){ |
|
|
|
name: "path-shape", |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
return shape; |
|
|
|
}, |
|
|
|
afterDraw(cfg, group) { |
|
|
@ -311,14 +308,14 @@ function initG6(){ |
|
|
|
icon, |
|
|
|
} = cfg; |
|
|
|
const list = attrs; |
|
|
|
const itemCount = list.length + 1; |
|
|
|
const itemCount = list.length; |
|
|
|
const boxStyle = { |
|
|
|
stroke: "#096DD9", |
|
|
|
radius: 4, |
|
|
|
}; |
|
|
|
const afterList = list.slice( |
|
|
|
Math.floor(startIndex), |
|
|
|
Math.floor(startIndex + itemCount - 1) |
|
|
|
Math.floor(startIndex + itemCount) |
|
|
|
); |
|
|
|
const offsetY = (0.5 - (startIndex % 1)) * itemHeight + 30; |
|
|
|
//表头盒子 |
|
|
@ -541,7 +538,6 @@ function initG6(){ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return keyshape; |
|
|
|
}, |
|
|
|
getAnchorPoints() { |
|
|
@ -554,8 +550,7 @@ function initG6(){ |
|
|
|
|
|
|
|
const dataTransform = (data) => { |
|
|
|
const nodes = []; |
|
|
|
const edges = []; |
|
|
|
|
|
|
|
let edges = []; |
|
|
|
data.map((node) => { |
|
|
|
nodes.push({ |
|
|
|
...node |
|
|
@ -578,7 +573,6 @@ function initG6(){ |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
return { |
|
|
|
nodes, |
|
|
|
edges, |
|
|
|