Skip to content

Updated attractors.ipynb to use hvplot and Panel #163

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

Closed
wants to merge 2 commits into from

Conversation

jbednar
Copy link
Contributor

@jbednar jbednar commented Jul 16, 2021

As an exercise in our new hvPlot-centric approach to using our tools, I've updated attractors.ipynb to use hvplot and Panel instead of hv and DynamicMap. The goal isn't necessarily to make the code shorter, though it did reduce it slightly, it's to make the concepts easier to convey given what people already know about Pandas and how widgets work.

I think it's succeeded at that? Certainly the first couple of .hvplot calls are straightforward; there is data in a df, and we call hvplot on it.

The last example is less of a clear win. We can't use .interactive here because we're generating a new DataFrame each time, so I've used Panel and pn.bind. The old one only relied on HoloViews concepts throughout, from hv.Points to DynamicMap, which means that there was one place to go for reference, but even so the ideas were quite esoteric and surprising to people. The new one adds Panel widgets and pn.bind as concepts, which they do have to figure out, but I think they are easier to convey and it's also much, much clearer where to go from here. The user can see that if they wanted to put anything else on a widget, they can just define one and hook it in, whereas with DynamicMap it was unclear how to add a Boolean, Selector, etc.

The new code in that last cell is also somewhat dense, but I can't think of any easy way to simplify it without making it much, much more verbose.

@jbednar jbednar requested a review from philippjfr July 16, 2021 22:17
@Azaya89
Copy link
Collaborator

Azaya89 commented May 23, 2024

This PR #381 aims to complete this PR. Maybe this one can be closed?

@maximlt
Copy link
Contributor

maximlt commented May 24, 2024

@Azaya89, let us know if there's anything in this PR that should be added to #381 (which I have merged too quickly, just assume it's still open :) ). If you say no, we are going to close it.

@Azaya89
Copy link
Collaborator

Azaya89 commented May 24, 2024

As far as I can tell, there's nothing we can add from here :)

@maximlt
Copy link
Contributor

maximlt commented May 24, 2024

Perfect, closing then.

@maximlt maximlt closed this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants