Coder Social home page Coder Social logo

Comments (6)

mattpap avatar mattpap commented on May 18, 2024

Since bokeh 3.4 the default for tap tool is xor mode. It may appear to look like the tool is in append mode, but in append mode the user can only add selected data points, but not remove them, which the main benefit of xor mode. We switched to xor default, because users wanted to be able to deselect points and especially toggle data points.

The case from discourse the prompted this discussion silently assumes replace mode, which now requires explicit specification. The best way, that works with all modes, would be to keep track of selected data points and perform actions only for newly selected data points. Currently there is no built-in functionality for this.

from bokeh.

bryevdv avatar bryevdv commented on May 18, 2024

cc @bokeh/dev I think this change should be re-visited. It certainly makes sense to offer this mode for some niche cases, but I don't think it makes sense as the default (and it clearly defies some user's expectations as well as seen on the discourse). This is especially jarring in plots like pie or bar charts where there are only a handful of elements to select. This also puts one tool on different footing than all other tools which is not good for simple documentation. Many users have used tap selection as part of a larger UI, e.g. to trigger some other drill down or other UI update and this change breaks all of those usages.

from bokeh.

bryevdv avatar bryevdv commented on May 18, 2024

FWIW I would be ok with this default behavior:

  • tapping new points replaces the existing selection (previous behavior)
  • tapping an already selected point unselects it (new behavior)

i.e. it is very specifically the "additive" nature of this xor-mode, where tapping a new point adds to an existing selection, that is the problem

from bokeh.

philippjfr avatar philippjfr commented on May 18, 2024

I agree with that proposal. Let's allow deselect but not adding by default.

from bokeh.

mattpap avatar mattpap commented on May 18, 2024

Do we want this behavior to be implemented in place of replace mode (just for tap tool) or should I introduce a new mode?

from bokeh.

bryevdv avatar bryevdv commented on May 18, 2024

I actually don't know what all the current modes are to say, where are they enumerated/described?

Well, I guess they are listed here

SelectionMode = Enumeration(replace, append, intersect, subtract, xor)

I guess it's a little weird, I don't think one set of selection modes really neatly covers all the tools in the same way. i.e the re-select to un-select that can make sense for a tap is nearly impossible to imagine being useful on a lasso tool. I think I lean towards: new mode, e.g. replace-foo with that being the default for tap. That's in the interest of not having "replace" mean multiple things, but also being able to say "a replace mode" is the default for all tools, which is less awkward to explain. But I am interested in others' thoughts.

from bokeh.

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.