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 SplinePlot handles multiple cubic splines #1529

Merged
merged 3 commits into from Jun 13, 2017

Conversation

Projects
None yet
3 participants
@philippjfr
Copy link
Contributor

philippjfr commented Jun 12, 2017

The bokeh bezier glyph supports cubic splines, by reading the matplotlib based spline codes we can easily split a set of cubic splines and draw them correctly with bokeh. This PR adds supports for drawing multiple cubic splines in this way. Splines of length 1 are simply ignored, while any other splines will raise warning. Briefly I thought I could handle quadratic and linear splines as well but that does not seem to be the case. Also adds support for instantiating and plotting empty splines with hv.Spline(([], [])).

Here's an example:

bokeh_plot 66

@philippjfr philippjfr force-pushed the spline_fixes branch from 66a43eb to 16df9f8 Jun 12, 2017

if len(vs) != 4:
skipped = len(vs) > 1
continue
xs, ys = vs[:, 0], vs[:, 1]

This comment has been minimized.

@jlstevens

jlstevens Jun 12, 2017

Contributor

Maybe zip the string keys and values and loop over them to append?

@jlstevens

This comment has been minimized.

Copy link
Contributor

jlstevens commented Jun 12, 2017

Looks good! Not sure what unit tests could be added and I made one comment to try to avoid all the lines using append but otherwise I am happy to merge.

@philippjfr

This comment has been minimized.

Copy link
Contributor Author

philippjfr commented Jun 13, 2017

Simplified the SplinePlot implementation. We could expand on the Spline Element notebook with the hope that they will be tested eventually.

@jbednar

This comment has been minimized.

Copy link
Contributor

jbednar commented Jun 13, 2017

Looks good!

@jlstevens

This comment has been minimized.

Copy link
Contributor

jlstevens commented Jun 13, 2017

Looks good! I'll merge once the tests are green.

@jlstevens

This comment has been minimized.

Copy link
Contributor

jlstevens commented Jun 13, 2017

Tests have passed. Merging.

@jlstevens jlstevens merged commit 3251c83 into master Jun 13, 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 decreased (-0.004%) to 79.253%
Details
s3-reference-data-cache Test data is cached.
Details

@philippjfr philippjfr deleted the spline_fixes branch Jun 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.