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] FactorRange updates not processed correctly #9151
Comments
@harmbuisman It's always preferable to change the smallest thing possible, especially if the alternative is replacing an entire new object (i.e. in this case it is 100% advised to change There are definitely demonstrations of swapping out one-level factors, but AFAIK you are the very first person to try swapping out two-level factors for one-level factors. Can you see if this problems persists with 3 or 4 factors? It's also possible there is a corner case with only two factors on the axis. |
@harmbuisman sorry I did not mean depth of the factors, I meant more factors, e.g. having 5 two-level then 5 one-level factors. |
ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)
bokeh.version: 1.3.0
python: 3.7.3
OS: Windows 10
browser: all
Description of expected behavior and the observed behavior
I am struggling to get the categorical bar chart for dynamic definitions of the factors working and the problem is related to the behavior of the xrange of the chart.
There are two ways to update the x_range of a chart:
1: p.x_range = FactorRange(factors=list(df['factors'].values))
2: p.x_range.factors = list(df['factors'].values)
In the first case a new x_range is created from a new FactorRange instance, in the second case only the factors are set.
For my specific implementation for some reason the first option does not work. I am left with an empty plot (no errors, not in Python, not in JS):
If I use the second option (.x_range_.factors) the plot is populated partly as expected, but I get errors in the JS console and the sizing seems incorrect:
After doing some more actions I also see this error (though I guess based on the statements this is a slickgrid issue, not a chart issue, so possibly irrelevant):
I tried to reproduce both behaviours, but the first behavior I cannot reproduce outside of my app. (Any pointers for what could cause this are welcome).
The second behaviour I can reproduce with the example below. How can I workaround this issue? What is not handled if I just set .x_range.factors?
My expectation:
Complete, minimal, self-contained example code that reproduces the issue
Stack traceback and/or browser JavaScript console output
See screenshot below
Screenshots or screencasts of the bug in action
The text was updated successfully, but these errors were encountered: