I am using mxGraph 1.10.14. I need to show children of a node on the graph when user selects a particular context menu. I am able to do that. But if there are large number of objects, many of the nodes are going out of bounds.

I even tried mxgraph.fit(). It works only when there are few number of objects (around 20 - 30) on the graph. But if there are objects more than 40 or so, I am seeing objects/vertices going out of the graph bounds and there is no way to bring those nodes back into the graph area.

asked 03 Oct '12, 08:18

Tilak's gravatar image

accept rate: 0%

edited 05 Oct '12, 08:20

David's gravatar image


Out of bounds meaning they don't fit in the available screen? fit certainly should scale and translate the graph into the container. What are you passing for keepOrigin parameter? Do you ever a simple, stand-alone example that recreates this problem?

(05 Oct '12, 08:20) David

Hi David, Thanks for the reply. Yes, when there are more number of nodes on the graph, they don't fit inside the screen, even after fit() is applied.

I am using the fit() method without any parameters. Should I use fit(boolean keepOrigin) method instead?

I do not have a standalone application to recreate this problem, I see this issue in our application which is integrated with mxGraph.

(07 Oct '12, 06:53) Tilak

Thanks to David, I could solve this issue by setting: graph.minFitScale = null;

This will make the entire graph (regardless of how big it is) to be visible in the given container.


answered 20 Oct '12, 15:13

Tilak's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

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



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



Asked: 03 Oct '12, 08:18

Seen: 1,664 times

Last updated: 20 Oct '12, 15:48