Giter Club home page Giter Club logo

Comments (8)

philippjfr avatar philippjfr commented on May 17, 2024 1

Before I try to debug this, this is the idiomatic way to write this:

class Selection(param.Parameterized):
    typ = param.ObjectSelector(default='curve', objects=['curve','scatter'])
    
    def callback(self, x, y):
        x = 0 if x is None else x
        y = 0 if y is None else y
        el = hv.Curve if self.typ == 'curve' else hv.Scatter
        h = el(((x,0),(y,1)))
        return h.redim.range(x=(-1,1), y=(-1,1)).relabel('{},{}'.format(x,y)).options(show_grid=True)

    @param.depends('typ')
    def view(self):
        return hv.DynamicMap(self.callback, streams=[SingleTap(transient=True)])

selection     = Selection(name="Ouch")
pn.Column( 'Click on the plot or change plot type', selection.param, selection.view)

from panel.

philippjfr avatar philippjfr commented on May 17, 2024

Thanks for migrating the issue @ea42gh.

from panel.

ea42gh avatar ea42gh commented on May 17, 2024

I modified
https://github.com/ea42gh/HoloviewsPlayground/blob/master/App_EulersMethod.ipynb
as suggested above.
The code works in the notebook as before.

Serving it, the app still breaks once the selector widget is used.
Clicking a legend now appears to call the callback twice,
with some sort of failure on the second time.

I still need to specify that I do not want a tap event when clicking a legend.
if x is not None and y is not None and x < 5.:
I'll go hunt for what else might be going on now...

from panel.

philippjfr avatar philippjfr commented on May 17, 2024

I still need to specify that I do not want a tap event when clicking a legend.

Mind filing another issue in holoviews about this, I hadn't though about the fact that on bokeh server these kinds of guards have to happen on the python end.

from panel.

philippjfr avatar philippjfr commented on May 17, 2024

Also, I can reproduce your issues. Glad I held back on tagging 0.2.

from panel.

ea42gh avatar ea42gh commented on May 17, 2024

Will do.
Figured out a little more:
clicking a legend to mute an element causes

  • the plot to be redrawn with the element muted
  • redrawing the plot with the element with the original alpha

from panel.

philippjfr avatar philippjfr commented on May 17, 2024

Makes sense, that should be fixed once we drop events outside the plot range on bokeh server.

from panel.

philippjfr avatar philippjfr commented on May 17, 2024

Closing since the remaining issues are in holoviews.

from panel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.