I am making a diagram editor (with a grid), and I’d like to set some shapes on a grid, that couldn’t be moved, having a fixed position relativily to the diagram zone, not the grid.
What I want to do is place some predefined shapes on the left side of the grid, to be able to drag them with CTRL+move. And when moving across the grid and other objects, I want these objects to stay settled there. I just want to avoid creating two diagrams.
If you have any other idea to implement a drag’n’drop quickly it would be a pleasure.
In fact I want to be able to make a palette, where I could drag and drop the objects into my diagram (with CTRL+move). I want the palette to stay in a fixed position (an area like the green frame I drew).
If you know an easy way to make a palette inside the Brown zone, tell me more about it.
PS : I have another question please, is it possible to add properties to the nodes ?
So you want to be able to scroll and zoom the nodes in your “palette-like area” along with the nodes and links in the main diagram? Then you cannot use a second Diagram such as a Palette. On the other hand, if they should remain in a fixed position relative to the main Diagram and if they should not be scrolled or zoomed along with the rest of the main Diagram, then you should use a Palette. Read about GoJS Palette -- Northwoods Software and GoJS Legends and Titles -- Northwoods Software.
Assuming you do not want to use a Palette, you could create a Group containing a bunch of nodes that you make not Part.movable and not Part.deletable. Presumably the Group itself would also be not movable nor deletable, and probably not selectable, but you have the flexibility to do what you want.
Is it possible for the group to be in a fixed position?
for example, in css it would be something like position: fixed, top: 50%; left: 0, so even if the user scrolls the viewport, the group would stay in the same place in the browser window