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

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@jlstevens
Copy link
Contributor

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

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 commented Jun 13, 2017

Looks good!

@jlstevens
Copy link
Contributor

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

@jlstevens
Copy link
Contributor

Tests have passed. Merging.

@jlstevens jlstevens merged commit 3251c83 into master Jun 13, 2017
@philippjfr philippjfr deleted the spline_fixes branch June 17, 2017 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants