You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bar charts draw nonexistent categories if a plot is updated with data that contains only a subset of the original categories. Here's a self-contained MWE demonstrating the problem.
Initially, or when include foo is selected, a bar chart is drawn with three categories a, b and foo, as expected:
If, however, exclude foo is selected afterwards and data for only two of the formerly three categories is used to generate the new plot, the excluded foo category is still retained in the plot and is displayed as having a value of zero.
From a little experimentation I gathered that this bug occurs only if the following conditions are met:
The category order on the x-axis has to be set. For example, removing the call to update_xaxes() will make the bug not surface.
One of the non-ghost categories has to have a value of zero. For example, if for both choices the value of a is set to something other than zero everything works as expected.
Note that the data sent from the dash server to the browser client is correct for both paths, i.e. if exclude foo is selected only data for a and b is sent and received. So this bug seems to live in javascript-land, maybe some sort of caching issue during plot updates. Also, somebody else had (has?) a similar problem using streamlit's plotly bindings. I'll link it here for reference: streamlit/streamlit#5902
If there's more information I can provide, let me know.
Cheers.
The text was updated successfully, but these errors were encountered:
gvwilson
changed the title
[BUG] Ghost categories are displayed after bar chart is updated with subset of categories.
Ghost categories are displayed after bar chart is updated with subset of categories.
Dec 12, 2024
Environment
Arch Linux x86_64 6.12.1-arch1-1, using Brave Browser Version 1.73.91 Chromium: 131.0.6778.85 (Official Build) (64-bit) and Firefox 133.0 (64-bit).
Describe the bug
Bar charts draw nonexistent categories if a plot is updated with data that contains only a subset of the original categories. Here's a self-contained MWE demonstrating the problem.
Initially, or when include foo is selected, a bar chart is drawn with three categories a, b and foo, as expected:
If, however, exclude foo is selected afterwards and data for only two of the formerly three categories is used to generate the new plot, the excluded foo category is still retained in the plot and is displayed as having a value of zero.
From a little experimentation I gathered that this bug occurs only if the following conditions are met:
update_xaxes()
will make the bug not surface.Note that the data sent from the dash server to the browser client is correct for both paths, i.e. if exclude foo is selected only data for a and b is sent and received. So this bug seems to live in javascript-land, maybe some sort of caching issue during plot updates. Also, somebody else had (has?) a similar problem using streamlit's plotly bindings. I'll link it here for reference: streamlit/streamlit#5902
If there's more information I can provide, let me know.
Cheers.
The text was updated successfully, but these errors were encountered: