Hi,
Is it possible for me to control the drop behaviour which only allow to drop the node on the available graduated ticks especially on the x-axis? For y-axis I want to allow the drop behaviour on top or bottom.
Here’s my example screenshot:
Hi,
Is it possible for me to control the drop behaviour which only allow to drop the node on the available graduated ticks especially on the x-axis? For y-axis I want to allow the drop behaviour on top or bottom.
Here’s my example screenshot:
Yes, implement a Part.dragComputation function on your node template. Search the samples and documentation for examples.
How do I detect the point of the graduated tick?
The basic idea is shown at GoJS Graduated Panels -- Northwoods Software
But you will want to limit the value to a multiple of the tick unit that is closest to the location point.
I tried to play with the sample code for dragComputation. However, I’m still confuse. What’s the purpose of the return point value?
The return value of Node.dragComputation is the new allowed Node.location for that node during a drag. Which might be the same as the old Node.location if you don’t want the node to move.
Ok thanks. One more thing, based on the diagram given, is it possible for me to create a draw link between node number 3 and 10? Since this diagram use TreeModel, I’m not sure whether a node can have multiple parent. How do I achieved that?
Use a GraphLinksModel instead.
GoJS Using Models -- Northwoods Software
I’ve changed the model to GraphLinksModel. Right now, I want to link back node: 5 to the timeline graduated tick. Here’s my diagram:
How do I achieve that?
Thanks.