question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suppressing warning messages

See original GitHub issue

Issue 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

https://jsbin.com/manukazata/1/edit?js,console,output

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:29 (14 by maintainers)

github_iconTop GitHub Comments

6reactions
MatthijsBoncommented, Jan 10, 2019

Well not exactly performance impact, but showing all these warnings in the console is a pain in the ***.

3reactions
davidmccabecommented, Apr 26, 2019

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Suppress Warnings in R (With Examples) - Statology
Method 2: Suppress Warnings Globally ... We can wrap the suppressWarnings({}) function around the entire chunk of code to suppress all warnings ......
Read more >
How to suppress warnings globally in an R Script
But note that turning off warning messages globally might not be a good idea. To turn warnings back on, use options(warn=0).
Read more >
How to Suppress Warning Messages in Python - Finxter
This example shows how to suppress script warnings using the -W switch at the terminal. From the terminal command prompt, enter python -W...
Read more >
Temporarily Remove Warning Messages in R (Example)
In this R tutorial you'll learn how to suppress a warning message in the RStudio console. The content of the page looks as...
Read more >
Suppress Warnings - MATLAB & Simulink - MathWorks
Your program might issue warnings that do not always adversely affect execution. To avoid confusion, you can hide warning messages during execution by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found