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

Bokeh bar plot #1416

Merged
merged 10 commits into from
May 8, 2017
Merged

Bokeh bar plot #1416

merged 10 commits into from
May 8, 2017

Conversation

philippjfr
Copy link
Member

@philippjfr 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
Copy link
Member Author

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
Copy link
Member Author

Ready to merge once tests are passing.

@jlstevens
Copy link
Contributor

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
Copy link
Contributor

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

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

Successfully merging this pull request may close these issues.

2 participants