-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
Allow changes to columns in bokeh CDS #2666
Conversation
.travis.yml
Outdated
@@ -29,7 +29,7 @@ install: | |||
- conda info -a | |||
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION flake8 scipy=1.0.0 numpy freetype nose pandas=0.22.0 jupyter ipython=5.4.1 param matplotlib=2.1.2 xarray | |||
- source activate test-environment | |||
- conda install -c conda-forge iris plotly flexx ffmpeg --quiet | |||
- conda install -c conda-forge iris plotly flexx ffmpeg netcdftime --quiet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this PR but apparently required to get tests passing again.
holoviews/plotting/bokeh/plot.py
Outdated
length = [len(v) for v in source.data.values() if isinstance(v, (list, np.ndarray))] | ||
not_updated = [k for k in source.data if k not in data] | ||
new = [k for k in data if k not in source.data] | ||
if ((not_updated and new_length and any(len(source.data[n]) != new_length[0] for n in not_updated)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure you need the initial not_updated
as any([])
evaluates to false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is also true for the check against new
.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This PR eliminates a long-standing limitation in updating plots with elements where the dimensions change. Specifically the code that updates a CDS now checks whether the data needs to be replaced completely, which occurs in one of two conditions 1) there is a new column which does not match the length of old columns or 2) there is an old column which is not being updated which does not match the updated columns in length.
Here are some examples of what this allows (note the changes in the axis label and table column header):
Technically we could just always replace the data completely but a) that can be inefficient and b) it breaks
shared_datasource
. I've double checked shared sources are not affected by this change.