After my palette is initialized, I hope that each node is only 1 PX apart. How can I do that?
我的调色板初始化之后,我希望是每个节点只有 1px 的间距,这该如何实现呢?
I found that the palette seems to have default spacing, and I don’t know how to modify this value. Does the property not support modification?
我发现调色板似乎有默认的间距,而且不知道如何修改这个值,难道属性不支持修改?
I tried to set properties(nodeSpacing or layerSpacing) but it didn’t work.
我试着去设置属性但是不起作用,why?
Modifying the Palette’s layout is the correct action. But the Palette by default has a Diagram.layout that is an instance of GridLayout, which I would think would be more appropriate and more efficient than a TreeLayout.
So all you would need to do is:
let myPalette = G(go.Palette, div,
{
"layout.spacing": new go.Size(1, 1),
maxSelectionCount: 1,
allowHorizontalScroll: false,
allowVerticalScroll: false,
model: new go.GraphLinksModel(operators)
});