Is it basically possible to have two divs showing different view points for the same graph model?

For instance, in the first window I want to show the hierarchy of some nodes that can contain subnodes. However, all the cells are collapsed by default. Whenever I select such a node, I want to drop into this node using enterGroup(node). But instead of dropping into the node in this graph windo, I want to display the subgraph of the parent node in the second window leaving the first one as it is.

asked 23 Jan '13, 13:17

Ltty's gravatar image

Ltty
629
accept rate: 25%


You can have multiple graphs attached to the same model and use a different root in each view, eg.

var graph2 = new mxGraph(container2, graph.getModel());
graph2.getView().setCurrentRoot(v2);
link

answered 24 Jan '13, 08:27

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

The only thing to mention is that you will have to override the mxGraphModel.getCell() function for some reason, otherwise you cannot get vertices by id anymore.

(24 Jan '13, 17:41) Ltty
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:

×228
×6
×5
×3

Asked: 23 Jan '13, 13:17

Seen: 1,251 times

Last updated: 24 Jan '13, 17:41