Hi, there. I’m using TreeLayout. When A node is dragged from a palette, it will be dropped to the end of the tree. How can it be positioned just where it’s dropped and when it is linked to a node in the tree, it will still be re-arranged automatically?
Here is my code:
const { Diagram, GraphObject, TreeLayout, Spot } = go
const $ = GraphObject.make;
const treeLayout = $(
TreeLayout,
{
angle: 90,
arrangement: TreeLayout.ArrangementVertical,
treeStyle: TreeLayout.StyleLayered,
arrangementSpacing: new Size(0, 35),
},
)
const myDiagram = $(
Diagram,
diagramId,
{
layout: treeLayout,
isReadOnly: false,
allowHorizontalScroll: true,
allowVerticalScroll: true,
allowZoom: true,
allowSelect: true,
contentAlignment: Spot.TopCenter,
minScale: 0.5,
maxScale: 1,
initialScale: 0.85,
"undoManager.isEnabled": true, // enable undo & redo
},
);
return myDiagram;
Thanks in advance.