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

Support passing widgets to operations #3976

Closed
jbednar opened this issue Sep 19, 2019 · 2 comments · Fixed by #4028
Closed

Support passing widgets to operations #3976

jbednar opened this issue Sep 19, 2019 · 2 comments · Fixed by #4028
Milestone

Comments

@jbednar
Copy link
Member

jbednar commented Sep 19, 2019

HoloViews operations already accept Parameter values, making it simple to instantiate widgets and connect them to the operation arguments in a way that re-runs the operation when the widget updates:

import os, colorcet, holoviews as hv, panel as pn, numpy as np
from holoviews.operation.datashader import rasterize, shade, spread
from collections import OrderedDict as odict

hv.extension('bokeh')

points = hv.Points(np.random.rand(500,2))
cmaps  = odict([(n,colorcet.palette[n]) for n in ['fire', 'bgy', 'bgyw', 'bmy', 'gray', 'kbc']])

cmap = pn.widgets.Select(name='Colormap', options=cmaps)
shade(rasterize(points), cmap=cmap.param.value)

image

Given how obscure the syntax for doing it is and that many people can otherwise use Panel without knowing anything about Param, it would be nice if people could simply pass the widget instead:

shade(rasterize(points), cmap=cmap)
@philippjfr
Copy link
Member

This will have to wait for 1.13.0 since panel is not officially a dependency until then.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants