Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Make .selected a proper Bokeh model #6845
This seems to be a pain point with users, and I've stumbled into as well. Resetting the whole .selected dict seems to trigger updates in most simple cases, but reliability is finicky at best with more complex selection updates. @bryevdv Your idea, not mine.
Currently the only way to spoof this type of selection function is to create multiple grouped sources and manipulate the selection/nonselection attributes, or stack multiple sources and use the filters. It starts to get out of hand when dealing with larger data sets. Rather than dealing with multiple sources, a single data source paired with a callback that sets the .selected index based on a selection within that group, and reliable plot update trigger is preferred. @clairetang6 Maybe a CDSView extension concept, SelectFilter?
This standalone would select groups accordingly if .selected could detect an internal change and push an update trigger.
This has definitely been discussed, and I think generally agreed upon. (I thought there was an issue already but I can't find it) The only main concern is finding a way to do it with as clean a deprecation path as possible, so that years worth of examples do not break overnight without warning.
Once @clairetang6 is back, she will be a good person to weigh in on this, as it intersects some of the work recently done of CDS views.