-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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] dcc.Graph
inserts phantom rectangular shape on callback update seemingly randomly
#2741
Comments
Bizarre. The fact that this shape is covering the middle half of the plot in each direction implies that it has no x or y coordinates, so it gets 1/4->3/4 as defaults. But the blue color isn't a default unless it's in a template somewhere... Perhaps the next step debugging is to open the JS console when you see this, and type:
|
Here is the output for this graph state: Console output of
Console output of
It looks like the phantom shape could be represented by:
However, in a callback, I cannot see this shape, and filtering for correct shapes (such as those with defined types) does not fix the issue:
|
Pinging to see if there are any additional debugging tips for this. It continues to happen sporadically on shape updates to the canvas. |
This is the change in elements in
After the phantom shape appears, re-parsing the dictionary above:
|
I have found a possible solution to the problem, which is to modify the truthy value for
In subsequent updates to the canvas, the |
Describe your context
Please provide us your environment, so we can easily reproduce the issue.
pip list | grep dash
belowif frontend related, tell us your Browser, Version and OS
Describe the bug
I have a dcc.Graph output component that renders the callback output from px.imshow. When I interact with the component, such as adding/remocing an existing shape in the plot through a callback, a random "phantom" rectangle may appear:
The pattern of its appearance is difficult to establish, as it is not always deterministic. Often, it appears after I add or remove a different shape for the graph.
Expected behavior
Here is how the plot is expected to appear:
Screenshots
Here is an additional example. When I have the graph and have already drawn the white rectangle in the top right, removing a line shape on a different part of the graph in a callback produces this:
When I view the shapes in the layout of the graph at this moment through a callback, only my original white rectangular shape is contained:
So it appears that the component is randomly adding a rectangle that doesn't show up in the canvas layout, making it impossible for me to filter or diagnose how to remove it consistently. Sometimes the rectangle will disappear if I redraw a new shape or update the underlying image, but sometimes it won't.
Generally, it is very hard to make a MRE for this problem given how random and unpredictable it is.
The text was updated successfully, but these errors were encountered: