Skip to content
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

BUG: layout not reset in callback when no edges present in graph #142

Open
ManInFez opened this issue Jun 11, 2021 · 2 comments
Open

BUG: layout not reset in callback when no edges present in graph #142

ManInFez opened this issue Jun 11, 2021 · 2 comments

Comments

@ManInFez
Copy link

ManInFez commented Jun 11, 2021

Description

Steps/Code to Reproduce

remove line 14, edge in graph, from demos/usage-reset-layoyt.py see #141

Expected Results

Layout should still be updated when pressing reset

Actual Results

nothing happens

Versions

Dash 1.20.0
Dash Core Components 1.1.3
Dash HTML Components 1.16.0
Dash Renderer 1.9.1
Dash HTML Components 0.2.0

@Farkites
Copy link
Contributor

This issue seems to be solved now in master branch:

Screen.Recording.2024-01-23.at.10.00.32.mov

Can we close this @alexcjohnson?

@alexcjohnson
Copy link
Collaborator

This bug still exists. When I run usage-reset-button.py exactly as given, both the node positions and the zoom/pan reset. When I remove the edge as in #141, there are three problems:

  • The nodes are not arranged according to the layout type, instead they retain the given position attribures.
  • The initial view does not properly show all the nodes. Only Node 2 is visible, Node 1 is off the upper left corner.
  • Clicking the button resets the node positions, but not the zoom/pan

Two more observations:

  1. It does seem like the precise wording of the bug is correct, the behavior changes when there are no edge present. If for example I add another node that's not connected to anything (but the connection between nodes 1 and 2 is still there) the behavior is as expected, then when I again remove the edge we see the same problems.

  2. The demo uses the grid layout. If I change to the cose layout, on initial draw the layout is applied (moving the nodes away from the given positions) but breadthfirst behaves the same as grid - so there are at least two categories of behavior depending on layout type. After clicking the reset button none of these layout types are applied, ie the nodes keep the positions given.

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

No branches or pull requests

3 participants