-
-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disabling hierarchical layout and re-enabling it causes errors #178
Comments
could you provide an MWE on JSFiddle or somewhere, please? Thanks. |
This has me puzzled. When hierarchical layout is disabled some new hidden nodes are added. Not sure why though. |
I believe that happens when you have smoothing enabled on edges. Those support nodes shouldn't be taken into account in the check for node levels. |
Disabling smoothing for edges stops the error from showing up, but doesn't work for this use case as the edges need to be curved to show each edge. |
This is intended to replace the prototype plus hacks insanity used at the moment. However this is still WIP. There is no documentations yet and more testing is necessary. TODO: - Add off. - Write docs. - Probably some other things too. In a quick test I was able to resolve the issue discussed in visjs/vis-network#178 and visjs/vis-network#213 with just a few lines of code. Which is much better than the massive mess of weird hacks that doesn't work reliably anyway. Putting this to use will be a lot of work but fortunately it should be possible to do it in parts. I would first use this in LayoutEngine and EdgesHandler to resolve the forementioned issues and then probably one module at the time. Features: - Encapsulates options merging. - Explicit layer/segment/key structure instead of prototype chains. - Observable. - Overrides. * - Type safety in TypeScript. * Hierarchical layout is incompatible with smooth edges and has to disable them. Overrides combined with observing easily and elegently solve that. See the forementioned issues for current state.
This is intended to replace the prototype plus hacks insanity used at the moment. However this is still WIP. There is no documentations yet and more testing is necessary. TODO: - Add off. - Write docs. - Probably some other things too. In a quick test I was able to resolve the issue discussed in visjs/vis-network#178 and visjs/vis-network#213 with just a few lines of code. Which is much better than the massive mess of weird hacks that doesn't work reliably anyway. Putting this to use will be a lot of work but fortunately it should be possible to do it in parts. I would first use this in LayoutEngine and EdgesHandler to resolve the forementioned issues and then probably one module at the time. Features: - Encapsulates options merging. - Explicit layer/segment/key structure instead of prototype chains. - Observable. - Overrides. * - Type safety in TypeScript. * Hierarchical layout is incompatible with smooth edges and has to disable them. Overrides combined with observing easily and elegently solve that. See the forementioned issues for current state.
Recently I had the same error. Error spam in second change, first remove hierarchical(ok)
second time change back hierarchical span error
@Thomaash @Tyler-Maclachlan I solved changing the smooth type for any value different of Note: vis-network version - 9.1.4 |
Hi there,
I am using the hierarchical layout with edges that can be 'split?', when splitting the edges I disable the layout so that none of the nodes move (it's really frustrating having the node you were looking at suddenly move), however when I re-enable the layout afterwards I get the following error:
Uncaught Error: To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.
I have predefined levels manually on every node, and looping through the DataSet shows that each node does indeed have a level.
Here's how I do it:
The text was updated successfully, but these errors were encountered: