Can unselected points disappear completely, not be grayed out, when selected using Brushing

Dear Colleagues

this is a question about brushing, e.g. as illustrated code such as the below (from your docs).

When a dot is selected in one figure (e.g. left), all other dots remain visible, but are diminished in intensity. I’m not sure how this is effected under the hood; maybe alpha is changed.

I have use case in which when a dot is selected, the users would like all other dots to disappear completely, until the ‘reset’ Tool is pressed.

The real use case involves selecting the details of an individual from a Grid; a linked plot displays various properties of this indiividual; on selection, the users want all the dots belonging to all the other individuals to disappear, not to be grayed out.

i) is this possible when the dots (as below) are displayed on a figure

ii) is it possible when the dots are plotted on a GMapPlot, e.g. as in your example here: Mapping geo data — Bokeh 2.4.2 Documentation

Thank you

David

from bokeh.models import ColumnDataSource
from bokeh.plotting import figure, gridplot, output_file, show

output_file("brushing.html")

x = list(range(-20, 21))
y0 = [abs(xx) for xx in x]
y1 = [xx**2 for xx in x]

# create a column data source for the plots to share
source = ColumnDataSource(data=dict(x=x, y0=y0, y1=y1))

TOOLS = "box_select,lasso_select,help"

# create a new plot and add a renderer
left = figure(tools=TOOLS, width=300, height=300, title=None)
left.circle('x', 'y0', source=source)

# create another new plot and add a renderer
right = figure(tools=TOOLS, width=300, height=300, title=None)
right.circle('x', 'y1', source=source)

p = gridplot([[left, right]])

show(p)

Hi,

You can completely control the appearance of selected vs non-selected glyphs:

  https://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#selected-and-unselected-glyphs

To make non-selected glyphs disappear, I would set their fill and line alphas to zero.

Thanks,

Bryan

···

On Feb 15, 2018, at 09:31, [email protected] wrote:

Dear Colleagues

this is a question about brushing, e.g. as illustrated code such as the below (from your docs).

When a dot is selected in one figure (e.g. left), all other dots remain visible, but are diminished in intensity. I'm not sure how this is effected under the hood; maybe alpha is changed.
I have use case in which when a dot is selected, the users would like all other dots to disappear completely, until the 'reset' Tool is pressed.
The real use case involves selecting the details of an individual from a Grid; a linked plot displays various properties of this indiividual; on selection, the users want all the dots belonging to all the other individuals to disappear, not to be grayed out.

i) is this possible when the dots (as below) are displayed on a figure
ii) is it possible when the dots are plotted on a GMapPlot, e.g. as in your example here: https://bokeh.pydata.org/en/latest/docs/user_guide/geo.html

Thank you
David

from bokeh.models import ColumnDataSource
from bokeh.plotting import figure, gridplot, output_file, show

output_file("brushing.html")

x = list(range(-20, 21))
y0 = [abs(xx) for xx in x]
y1 = [xx**2 for xx in x]

# create a column data source for the plots to share
source = ColumnDataSource(data=dict(x=x, y0=y0, y1=y1))

TOOLS = "box_select,lasso_select,help"

# create a new plot and add a renderer
left = figure(tools=TOOLS, width=300, height=300, title=None)
left.circle('x', 'y0', source=source)

# create another new plot and add a renderer
right = figure(tools=TOOLS, width=300, height=300, title=None)
right.circle('x', 'y1', source=source)

p = gridplot([[left, right]])

show(p)

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/477f62ff-d46b-43f6-87ea-db2cf7a01a8d%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

1 Like