Hi There!
I have this graph:
and I want to arrange the nodes more “clearly”, not according specific rule or something, But I want to see the nodes and edges nicely.
How can I do that?
Here my diagram:
const dia =
$(go.Diagram,
{
"animationManager.isInitial": true,
"undoManager.isEnabled": true,
"initialContentAlignment": go.Spot.Center,
model: $(go.GraphLinksModel,
{
linkToPortIdProperty: 'toPort',
linkFromPortIdProperty: 'fromPort',
linkKeyProperty: 'key' // IMPORTANT! must be defined for merges and data sync when using GraphLinksModel
}
),
});
dia.nodeTemplate =
$(go.Node, "Auto", // the Shape will go around the TextBlock
$(go.Shape, "RoundedRectangle", { strokeWidth: 0, fill: "white" },
// Shape.fill is bound to Node.data.color
new go.Binding("fill", "color")),
$(go.TextBlock,
{ margin: 8, font: "bold 14px sans-serif", stroke: '#333' }, // Specify a margin to add some room around the text
// TextBlock.text is bound to Node.data.key
new go.Binding("text", "key"))
);
Thanks All!