layout增加倒三角符号

This commit is contained in:
zgt
2022-03-19 17:53:51 +08:00
parent dbb3b3efde
commit 88ec08ec20
7 changed files with 11932 additions and 2663 deletions
+3 -2
View File
@@ -155,7 +155,7 @@ export class LayoutProvider {
},
left: (nodeBound: BoundingRect, labelBound: BoundingRect, offset: number) => {
return {
x: nodeBound.x - labelBound.width - offset,
x: nodeBound.x - labelBound.width / 2- offset,
y: nodeBound.y + nodeBound.height / 2,
};
},
@@ -164,7 +164,8 @@ export class LayoutProvider {
indexLabels.forEach(item => {
const options: IndexLabelOption = indexLabelOptions[item.sourceType],
nodeBound = item.target.getBound(),
labelBound = item.getBound(),
// labelBound = item.getBound(),
labelBound = item.shadowG6Item.getContainer().getChildren()[1].getBBox(),
offset = options.offset ?? 20,
position = options.position ?? 'bottom';