Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

TreeLayout - set initial position of a node when it was dragged and dropped from a palette?

$
0
0

@peterma wrote:

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.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles