Suppressing warning messages
See original GitHub issueIssue type Core Library & Cose Layout.
Bug report
Environment info
- Cytoscape.js: v3.3.1:
- Browser: Chrome 71.0.3578.98 (Official Build) (64-bit):
Current (buggy) behaviour
I think this has to do with both the ‘cose’ layout as well as the core library. The main concern is adding nodes dynamically (using elements.forEach(function (element) { cy.add(element) })
) or adding directly to the graph (using { (..), "elements": elements, (..) }
). When adding directly to the graph, the core library has no problems with adding the nodes using the ‘cose’ layout, but when adding dynamically, a warning is shown in the console that nodes probably overlap and therefore edges are impossible to draw.
I can imagine edges are impossible to draw when at first they overlap, but in the end, the layout determines the position of the nodes and then they don’t overlap anymore. Even when using something like cy.batch(function () {})
to add all nodes (dynamically) at once and then run the layout, the warnings are still shown.
This does not happen for ‘breadthfirst’ or ‘random’ layouts and (as far as I have tested) only for ‘bezier’ and ‘straight’ edge styles.
Desired behaviour
Some way to suppress these warnings when adding nodes dynamically, while the layout is responsible for the position of nodes.
NOTE: I did find a workaround: a (random) position when adding nodes solves the warning.
Minimum steps to reproduce
Issue Analytics
- State:
- Created 5 years ago
- Comments:29 (14 by maintainers)
Top GitHub Comments
Well not exactly performance impact, but showing all these warnings in the console is a pain in the ***.
We upgraded Cytoscape in our app recently and now it always spews thousands of warnings to the console, making the console useless for seeing actually important warnings. Your solution is to allow the option of disabling all warnings across Cytoscape – this seems a much worse tradeoff than just not warning about overlapping nodes. What if Cytoscape needs to warn be about something else?