Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Network graph shifts each layer to the left. #3008

Closed
jwmxyz opened this issue Apr 22, 2017 · 6 comments
Closed

Network graph shifts each layer to the left. #3008

jwmxyz opened this issue Apr 22, 2017 · 6 comments

Comments

@jwmxyz
Copy link

jwmxyz commented Apr 22, 2017

When numerous layers are added to a network, each layer is shifted slightly to the left.

See:
http://jsbin.com/qihipebeto/edit?html,output

I noted that in an older version (4.9.0) it appears to be more central:

http://jsbin.com/xipeqohuna/edit?html,output

Centrally aligned would be ideal, including centrally horizontal.

Kudos to the work, this is a fantastic project.

EDIT:

Further example (v4.19.1) looks to just display a line http://jsbin.com/fobuloxayi/edit?html,output (Theres a network there I promise!)

Using (v4.9.0) it actually looks really good: http://jsbin.com/veqehewada/edit?html,output

EDIT v2:

Using (v4.10.0) is perfect: http://jsbin.com/kurukuxeza/edit?html,output

@wimrijnders
Copy link
Contributor

Further example (v4.19.1) looks to just display a line

Well whoop-dee-doo, and another one. This particular report is a duplicate of #1735.

@wimrijnders
Copy link
Contributor

FWIW, I can get a pretty decent layout if I set the following options for v4.19.1:

            layout: {
                randomSeed: undefined,
                improvedLayout: true,          // <= Where it should be
                hierarchical: {
                    //improvedLayout: true,    // <= Wrong location!
                    edgeMinimization: false,   // <= Changed
                }
            },
            physics: {
              enabled: true,
	      stabilization: {
		iterations: 10000
	      }
	    }

untitled

@wimrijnders
Copy link
Contributor

wimrijnders commented Apr 26, 2017

I have deduced in other issues that there is something awry with option layout.hierarchical.edgeMinimization: true, but it is evidently only part of the story. The initial positioning of the nodes is just way too spread out.

But with physics enabled, it can fix itself to something presentable, see previous comment.

@wimrijnders
Copy link
Contributor

The problem is in method LayoutEngine._validatePositionAndContinue(). By the looks of it, the method assumes a strict hierarchy, in which child nodes have only one parent.

By disabling the method, a decent network is shown for multiple parents as well, like image above.

@wimrijnders
Copy link
Contributor

@johnwmoody, could you live with the following layout?

untitled

It's like your jsbin of v4.10.0, except left-aligned.

@wimrijnders
Copy link
Contributor

wimrijnders commented Apr 27, 2017

This find, BTW, definitely marks the issue as a duplicate of #1735. I am closing this issue and continuing the work there. Feel free to reopen/add info if necessary.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants