我在使用组的gojs中有一个图表。每个组都有一个SubGraphExpanderButton。我想相对于图的其余部分(节点,链接等)增加SubGraphExpanderButton的大小。我怎么做?我在这里的文档中找不到它:https://gojs.net/latest/intro/buttons.html以下是我的GroupTemplate代码:
// define the group template
myDiagram.groupTemplate =
$(go.Group, "Auto",
{
isSubGraphExpanded: false, // initially, make all groups collapsed
layout: $(go.LayeredDigraphLayout,
{ direction: 0, columnSpacing: 10 }),
memberAdded: function(grp, part) {
grp.visible = true;
},
memberRemoved: function(grp, part) {
if (grp.memberParts.count <= 0) grp.visible = false;
}
},
$(go.Shape, "Rectangle", new go.Binding("stroke", "color"),
{ fill: COLOR_WHITE, stroke: COLOR_GRAY, strokeWidth: BORDER_STROKE_WIDTH }
),
$(go.Panel, "Vertical",
{ defaultAlignment: go.Spot.Left, margin: 15 },
$(go.Panel, "Horizontal",
{ defaultAlignment: go.Spot.Top },
$("SubGraphExpanderButton", { width:8, height:20 }),
$(go.TextBlock,
{ font: "Bold 40px Sans-Serif", margin: 4, stroke: COLOR_BLACK },
new go.Binding("text", "key"))
),
$(go.Placeholder,
{ padding: new go.Margin(0, 10) }
)
)
);
}
谢谢!
最佳答案
您可以尝试设置按钮的比例,而不是设置按钮的宽度和高度。
关于javascript - 如何调整gojs按钮的大小,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51274992/