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] Log axis figures don't render if they're not visible at start #11801

Closed
EfremBraun opened this issue Nov 14, 2021 · 1 comment · Fixed by #11802
Closed

[BUG] Log axis figures don't render if they're not visible at start #11801

EfremBraun opened this issue Nov 14, 2021 · 1 comment · Fixed by #11802

Comments

@EfremBraun
Copy link
Contributor

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

Bokeh 3.0.0dev1+24.g0f5f99466
Python 3.9.6
MacOS Catalina 10.15.7
Chrome 95.0.4638.69

Description of expected behavior and the observed behavior

I put stacks plots such that the user can change between log-plot and lin-plot upon clicking a checkbox. However, upon first rendering the plot, the log-plot that is below isn't rendered. After clicking the "Reset" button, the log-plot renders.

I assume this is somewhat related to #11770, but perhaps not.

Complete, minimal, self-contained example code that reproduces the issue

from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, Button
from bokeh.io import curdoc
from bokeh.layouts import column

LineRef = ColumnDataSource(data=dict(x=[1, 2], y=[1, 2]))

def updateData():
    figure2.visible=False
    figure1.visible=True

button = Button(label='Change')
button.on_click(updateData)

figure1 = figure(visible=False)
figure2 = figure(x_axis_type='log', y_axis_type='log')
figure1.line(x='x', y='y', source=LineRef)
figure2.line(x='x', y='y', source=LineRef)

curdoc().add_root(column(button, figure1, figure2))

Stack traceback and/or browser JavaScript console output

Upon clicking the change button, I get this console output:

bokeh.min.js?v=106a2270510621557ac35604d45cfa81816e9a588ddf9b3775bf902b93e02795b53d464b32e7b1892ae7c74db2c378e78c99265a4eec4e681af1f486278411f5:526 [bokeh] could not set initial ranges

Screenshots or screencasts of the bug in action

Before clicking change:
Screen Shot 2021-11-14 at 6 43 28 PM

After clicking change:
Screen Shot 2021-11-14 at 6 43 30 PM

After clicking the reset button:
Screen Shot 2021-11-14 at 6 51 30 PM

Note

If the linear-scale plot is put on top, and clicking the button switches to log-scale, as per the following code, everything works fine:

from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, Button
from bokeh.io import curdoc
from bokeh.layouts import column

LineRef = ColumnDataSource(data=dict(x=[1, 2], y=[1, 2]))

def updateData():
    figure1.visible=False
    figure2.visible=True

button = Button(label='Change')
button.on_click(updateData)

figure1 = figure()
figure2 = figure(x_axis_type='log', y_axis_type='log', visible=False)
figure1.line(x='x', y='y', source=LineRef)
figure2.line(x='x', y='y', source=LineRef)

curdoc().add_root(column(button, figure1, figure2))
@EfremBraun
Copy link
Contributor Author

Thank you!

@mattpap mattpap modified the milestones: 3.0, 2.4.2 Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants