-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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] CDS updates on figure data that change the axis magnitude will trigger a recomputation of the complete layout #12129
Comments
If the current amount of space is not sufficient to accommodate ticks, then more space has to be allocated and everything has to be re-painted. I don't think there is any way to avoid this in general. If this is a problem, e.g. because you have 50 plots on a single page, then the typical specific optimizations are some combination of:
cc @bokeh/core for any thoughts but I am incline to close this with no action. |
Also, for bug reports on "dev" releases, please only report using the latest dev release ( |
Pre-allocating extra space for the axis is the desired option for me however this functionality seems unsupported. Using the I am not a web expert but why does everything has to be repainted when the figure widget has a fixed size and only one widget is updated? That seems quite unnatural, I'd rather expect that everything inside the figure widget is rescaled leaving the rest of the layout untouched. |
cc @mattpap to discuss layout issues, and possible changes still yet to land with upcoming 3.0 release I will also say that Bokeh CDS are not lightweight objects. If you are ending up with 100 of them on a single page then Bokeh simply may not be the right tool for your use case. |
Software versions
Python version : 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
IPython version : (not installed)
Tornado version : 6.1
Bokeh version : 3.0.0dev2
Browser name and version
No response
Jupyter notebook / Jupyter Lab version
No response
Expected behavior
Data updates on plots via CDS should not unnecessarily invalidate the complete layout but instead only adjust the figure that is updated.
Observed behavior
Data updates that cause the magnitude of the y-axis to change (i.e. from single digits to double digits or the other way round) will invalidate the complete layout and repaint it from scratch again. This seems rather unnecessary and is a huge performance bottleneck.
This can be reproduced with my example below: here we have 50 figures and tables respectively with only the first plot table combination being updated via the buttons on the left. Both buttons will trigger random data updates via CDS but scale differently (< 10 and < 100). Everytime magnitudes change the repainting of the layout is triggered which takes around 1 seconds to complete (see screenshot below, updates without magnitude changes work nearly instantly). If instead all 50 plots are updated this behaviour scales linearly (50 seconds to update) which is rather undesired.
As a side note: embedding the layout within a tab widget makes things even worse as the performance is decreased by a factor of 2.
Example code
Stack traceback or browser console output
No response
Screenshots
The text was updated successfully, but these errors were encountered: