Skip to content
This repository has been archived by the owner on Nov 29, 2019. It is now read-only.

Datashader output not updating #37

Open
timothydmorton opened this issue Jan 24, 2018 · 0 comments
Open

Datashader output not updating #37

timothydmorton opened this issue Jan 24, 2018 · 0 comments

Comments

@timothydmorton
Copy link

I'm having trouble making a holoviews/parambokeh widgety-thing work with a datashader plot as output:

import param
import parambokeh
from holoviews.operation.datashader import datashade, dynspread
import colorcet as cc

class WidgetTest(hv.streams.Stream):
    cmap = param.ObjectSelector(default='coolwarm',
                               objects=['coolwarm', 'fire', 'blue'])

    output = parambokeh.view.Plot()

    def __init__(self, pts, *args, **kwargs):
        super(WidgetTest, self).__init__(*args, **kwargs)
        self.pts = pts
    
    def event(self, **kwargs):
        super(WidgetTest, self).event
        self.output = datashade(self.pts, cmap=cc.palette[self.cmap])        

When I run the following, the plot doesn't update on changing the colormap with the widget. What am I missing?

import numpy as np
n = 100000
pts = hv.Points(np.random.multivariate_normal([0,0], [[1,0], [0,1]], size=n))
example = WidgetTest(pts)

parambokeh.Widgets(example, callback=example.event, push=False,
                   on_init=True, view_position='right')
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant