I'm considering using Diagramly/mxGraph to create an editor for Statecharts, and I'm trying to determine if Diagramly/mxGraph would be suitable for this. Specifically, I'm wondering if the mxGraph editor allows you to drag a shape "inside" of another shape so that it creates a hierarchical relationship between those two shapes. I've seen from the mxGraph documentation that an mxCell is able to contain other mxCells, with parent-child links between them, so it would make sense that the editor could create hierarchical relationships between mxCells, but I have unfortunately not been able to get this to work with Diagramly. For example, if I try to drag a UML State shape inside of a UML Composite State, nothing happens that would indicate that a hierarchical connection is or could be created between these two shapes. The same is true for the UML Package shape, which should be able to contain other shapes. Is it possible to do this with Diagramly?

asked 25 Dec '12, 00:12

jbeard4's gravatar image

jbeard4
11
accept rate: 0%


In Diagramly, mxGraph.isValidRoot is overridden via the grapheditor example (see javascript/examples/grapheditor/www/js/Graph.js, lines 162 ff) that ships with mxgraph. This is used in Sidebar.createDragSource, and mxGraph.isValidDropTarget is used for DnD inside the graph.

link

answered 25 Dec '12, 04:30

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×5
×1

Asked: 25 Dec '12, 00:12

Seen: 1,028 times

Last updated: 25 Dec '12, 04:30