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

Add ability to use functions with param dependencies in DynamicMap #3744

Merged
merged 11 commits into from Aug 3, 2019

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented May 29, 2019

Allows doing things like:

slider = pn.widgets.FloatSlider()

@pn.depends(y=slider.param.value)
def test(y):
    return hv.Curve([0, 1, y])

pn.Column(slider, hv.DynamicMap(test))
  • Adds tests
  • Added docs

@jlstevens
Copy link
Contributor

@jlstevens jlstevens commented May 30, 2019

Code looks fine but I'm starting to lose track of all the ways you can do things with param watchers, panel etc. I assume the alternative would be a class which is unnecessary for such a simple example?

I guess I am happy to merge but I would also like to see some docs detailing this style among all the other ways you can do things with param nowadays.

@philippjfr
Copy link
Member Author

@philippjfr philippjfr commented May 30, 2019

I guess I am happy to merge but I would also like to see some docs detailing this style among all the other ways you can do things with param nowadays.

That is on my to-do list along with .apply docs, but I don't think I'll get there today and in the meantime I'd like to build examples on top of this.

@jlstevens
Copy link
Contributor

@jlstevens jlstevens commented Aug 2, 2019

@philippjfr Looks good!

My comments generally relate to expanding the docs in a few places. There is one question about reordering the presentation of the function/class approach but I have no opinion as to whether that should be part of this PR or not.

Another task that shouldn't be part of this PR is to expand the streams user guide to discuss these implicit parameter streams. There are now three types of stream in holoviews imho 1) explicitly defined custom stream objects and classes 2) linked streams 3) implicit parameter driven ones.

Happy to merge once these doc issues are addressed (or postponed for later PRs). And once the tests are passing!

jbednar
jbednar approved these changes Aug 2, 2019
examples/user_guide/14-Data_Pipelines.ipynb Outdated Show resolved Hide resolved
Co-Authored-By: James A. Bednar <jbednar@users.noreply.github.com>
@jbednar
Copy link
Member

@jbednar jbednar commented Aug 3, 2019

Looks good now, thanks!

Co-Authored-By: James A. Bednar <jbednar@users.noreply.github.com>
@philippjfr philippjfr merged commit 4534d45 into master Aug 3, 2019
0 of 3 checks passed
@philippjfr philippjfr deleted the param_function branch Aug 5, 2019
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.

None yet

3 participants