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
Merged

Bokeh SplinePlot handles multiple cubic splines #1529

merged 3 commits into from Jun 13, 2017

Conversation

@philippjfr
Copy link
Member

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

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

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

@jbednar jbednar commented Jun 13, 2017

Looks good!

@jlstevens
Copy link
Contributor

@jlstevens jlstevens commented Jun 13, 2017

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

@jlstevens
Copy link
Contributor

@jlstevens jlstevens commented Jun 13, 2017

Tests have passed. Merging.

@jlstevens jlstevens merged commit 3251c83 into master Jun 13, 2017
4 checks passed
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
@philippjfr
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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants