plotly / dash-cytoscape

Interactive network visualization in Python and Dash, powered by Cytoscape.js
https://dash.plot.ly/cytoscape
MIT License
586 stars 120 forks source link

Graph nodes flocking to single point #175

Open nilq opened 2 years ago

nilq commented 2 years ago

Description

Nodes in graphs are shown correctly for a second before flocking to a single point, usually happens when inserting Cyto-components using callbacks. It is independent of any particular layout. This happens often.

Looks like this:

Screenshot-2022-05-17-at-16-15-32

Steps/Code to Reproduce

Not deterministic. Happens when having multiple graphs, shown at different times in the Dash app.

Expected Results

A graph with properly placed nodes.

Actual Results

This.

Screenshot-2022-05-17-at-16-15-32

Versions

Dash 2.3.1
/Users/niels/Documents/GitHub/test/test.py:3: UserWarning:
The dash_html_components package is deprecated. Please replace
`import dash_html_components as html` with `from dash import html`
  import dash_html_components; print("Dash Core Components", dash_html_components.__version__)
Dash Core Components 2.0.2
/Users/niels/Documents/GitHub/test/test.py:4: UserWarning:
The dash_core_components package is deprecated. Please replace
`import dash_core_components as dcc` with `from dash import dcc`
  import dash_core_components; print("Dash HTML Components", dash_core_components.__version__)
Dash HTML Components 2.3.0
Dash Renderer 1.9.1
Dash HTML Components 0.2.0
nilq commented 2 years ago

This even happens in the examples in the documentation.

Screenshot-2022-05-19-at-10-52-39
nilq commented 2 years ago

I have not yet looked into any of the code in this repo, but investigating from the outside; I have been able to stop this behaviour by disabling updating of Cyto-components from callbacks. This is not sustainable.

nilq commented 2 years ago

Furthermore, it happens in Safari, Chrome and Firefox - both when hosted locally and in a pod.