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

Bokeh bar plot #1416

Merged
merged 10 commits into from May 8, 2017

Conversation

Projects
None yet
2 participants
@philippjfr
Member

philippjfr commented May 7, 2017

In #1407 I outlined the way forward for the Bar plot implementations. Since bokeh charts will be split out imminently and I'll be using Bars in at least one project I thought it would be worth replacing the bokeh charts based implementation immediately. This new implementation retains all the functionality of the charts based implementation, while adding more features and improvements:

  • Better control over legends
  • Better support for updating barplots as part of HoloMaps/DynamicMaps
  • Much better performance (at least 10x faster for more complex charts) because this implementation uses one vectorized glyph rather than a bunch of individual glyphs like the chart based implementation did.
  • Support for colormapping bars
  • Better support for overlaying bars
  • Support for horizontal bars via the invert_axes plot option
  • Support for log mapping bar heights

Here is the notebook I used to develop the plotting class with an extensive list of examples.

@philippjfr philippjfr added the bokeh label May 7, 2017

@philippjfr

This comment has been minimized.

Member

philippjfr commented May 7, 2017

I also just added support for batching BarPlots, this means that you can stack and group NdOverlays of Bars, which means you can use the simpler Bars format with only a single key dimension. In other words these two versions are equivalent:

%%opts Bars [stack_index='group]
hv.Bars((range(10)*5, sorted(map(chr, range(65,70))*10), np.random.rand(50)), kdims=['x', 'group'])
%%opts NdOverlay [legend_limit=0] Bars [stack_index='group' show_legend=True]
hv.NdOverlay({chr(65+i): hv.Bars(np.random.rand(10)) for i in range(5)}, kdims=['group'])

bokeh_plot 44

@philippjfr

This comment has been minimized.

Member

philippjfr commented May 8, 2017

Ready to merge once tests are passing.

@jlstevens

This comment has been minimized.

Member

jlstevens commented May 8, 2017

The improvements list is quite impressive and we are explicitly moving away from the bokeh charts API so this work was definitely necessary.

The tests are passing and I am happy to merge. My only comment here is regarding unit tests, do you you think existing unit tests are sufficient or can we add more to test this new implementation?

@jlstevens

This comment has been minimized.

Member

jlstevens commented May 8, 2017

I think the issue regarding additional testing can be deferred by #1422 (assigned to version 1.8). Merging.

@jlstevens jlstevens merged commit 042e3fa into master May 8, 2017

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.01%) to 79.058%
Details
s3-reference-data-cache Test data is cached.
Details

@philippjfr philippjfr deleted the bokeh_bar_plot branch May 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment