Bokeh (0.12.5) Toolbar tools are active even after they are deselected.

I currently have a set of 4 graphs under a gridplot and have assigned some basic tools. However, when I deselect a tool from the toolbar, let’s say the pan tool, I am still able to pan around in all the graphs under my gridplot. The same goes for the other tools I have assigned. It seems that the tools are still active even when they are deselected from the toolbar. How could I resolve this?

I am looking through the examples here and no such issue arises, for example when the pan tool de-selected from the toolbar I am not able to pan which is what I want to achieve.

Here is some of the relevant code for making the plots:

def make_plot(xname, yname, isLog, needsColor, xcolor, needsS, xdr, ydr, xax=False, yax=False):

mbl = between_window_size if yax else 0

mbb = between_window_size if xax else 0

if isLog:

plot = figure(

x_range=xdr, y_range=ydr, background_fill_color=“white”,

border_fill_color=‘white’, plot_width=window_size + mbl, plot_height=window_size + mbb,

min_border_left=border_size+mbl, min_border_right=border_size, min_border_top=border_size, min_border_bottom=2+mbb,

y_axis_type=“log”, x_axis_type=“log”)

else:

plot = figure(

x_range=xdr, y_range=ydr, background_fill_color=“white”,

border_fill_color=‘white’, plot_width=window_size + mbl, plot_height=window_size + mbb,

min_border_left=border_size+mbl, min_border_right=border_size, min_border_top=border_size, min_border_bottom=2+mbb)

if not needsS:

plot.xaxis.axis_label = xname

plot.yaxis.axis_label = yname

else:

plot.xaxis.axis_label = “s” + xname

plot.yaxis.axis_label = “s” + yname

if needsColor:

circle = Circle(x=xname, y=yname, fill_color={‘field’: xcolor, ‘transform’: color_mapper}, fill_alpha=0.6, size=5, line_color=None)

else:

circle = Circle(x=xname, y=yname, fill_color = “blue”, fill_alpha=0.6, size=5, line_color=None)

r = plot.add_glyph(self.source, circle)

r.nonselection_glyph = Circle(fill_color=“grey”, fill_alpha = 0.1, line_color=None)

xdr.renderers.append(r)

ydr.renderers.append(r)

xticker = BasicTicker()

if xax:

xaxis = LinearAxis(axis_label=xname)

plot.add_layout(xaxis, ‘below’)

xticker = xaxis.ticker

plot.add_layout(Grid(dimension=0, ticker=xticker))

yticker = BasicTicker()

if yax:

yaxis = LinearAxis(axis_label=yname)

plot.add_layout(yaxis, ‘left’)

yticker = yaxis.ticker

plot.add_layout(Grid(dimension=1, ticker=yticker))

plot.add_tools(BoxZoomTool(), WheelZoomTool(), PanTool(), ResetTool(), BoxSelectTool(), TapTool())

plot.xgrid.grid_line_color = None

plot.ygrid.grid_line_color = None

``

plot1 = make_plot(“degree”, “count”, True, False, “”, False, degree_x_p1, count_y)

plot2 = make_plot(“degree”, “pagerank”, True, True, “pagerank_count”, False, degree_x_p2, pagerank_y)

plot3 = make_plot(“pagerank”, “pagerank_count”, True, False, “”, False, pagerank_x, pagerank_count)

return plot
` plot4 = make_plot(“clustering_coefficient”, “clustering_coefficient_count”, True, False, “”, False, clustering_coefficient, clustering_coefficient_count)

row = [plot1, plot2, plot3, plot4]
`
plots_row1.append(row)

plots_row1 = gridplot(plots_row1)

``

Here is also a gif to portray my issue:

Thanks!

bokeh_cut.mp4 (767 KB)

Hi,

I can reproduce this in 0.12.5 but not in 0.12.6 or current master. So this was probably an unknown bug that was inadvertently fixed in some of the fairly expansive clean up and refactoring that occurred during the last release cycle. In any event, the only simple solution I can offer is to upgrade your version of Bokeh.

Thanks,

Bryan

···

On Jun 22, 2017, at 18:20, [email protected] wrote:

I currently have a set of 4 graphs under a gridplot and have assigned some basic tools. However, when I deselect a tool from the toolbar, let's say the pan tool, I am still able to pan around in all the graphs under my gridplot. The same goes for the other tools I have assigned. It seems that the tools are still active even when they are deselected from the toolbar. How could I resolve this?

I am looking through the examples here and no such issue arises, for example when the pan tool de-selected from the toolbar I am not able to pan which is what I want to achieve.

Here is some of the relevant code for making the plots:

def make_plot(xname, yname, isLog, needsColor, xcolor, needsS, xdr, ydr, xax=False, yax=False):
            mbl = between_window_size if yax else 0
            mbb = between_window_size if xax else 0

            if isLog:
                plot = figure(
                    x_range=xdr, y_range=ydr, background_fill_color="white",
                    border_fill_color='white', plot_width=window_size + mbl, plot_height=window_size + mbb,
                    min_border_left=border_size+mbl, min_border_right=border_size, min_border_top=border_size, min_border_bottom=2+mbb,
                    y_axis_type="log", x_axis_type="log")
            else:
                plot = figure(
                    x_range=xdr, y_range=ydr, background_fill_color="white",
                    border_fill_color='white', plot_width=window_size + mbl, plot_height=window_size + mbb,
                    min_border_left=border_size+mbl, min_border_right=border_size, min_border_top=border_size, min_border_bottom=2+mbb)
            
            if not needsS:
                plot.xaxis.axis_label = xname
                plot.yaxis.axis_label = yname
            else:
                plot.xaxis.axis_label = "s" + xname
                plot.yaxis.axis_label = "s" + yname
            
            if needsColor:
                circle = Circle(x=xname, y=yname, fill_color={'field': xcolor, 'transform': color_mapper}, fill_alpha=0.6, size=5, line_color=None)
            else:
                circle = Circle(x=xname, y=yname, fill_color = "blue", fill_alpha=0.6, size=5, line_color=None)

            r = plot.add_glyph(self.source, circle)
            r.nonselection_glyph = Circle(fill_color="grey", fill_alpha = 0.1, line_color=None)

            xdr.renderers.append(r)
            ydr.renderers.append(r)

            xticker = BasicTicker()
            if xax:
                xaxis = LinearAxis(axis_label=xname)
                plot.add_layout(xaxis, 'below')
                xticker = xaxis.ticker
            plot.add_layout(Grid(dimension=0, ticker=xticker))

            yticker = BasicTicker()
            if yax:
                yaxis = LinearAxis(axis_label=yname)
                plot.add_layout(yaxis, 'left')
                yticker = yaxis.ticker
            plot.add_layout(Grid(dimension=1, ticker=yticker))

            plot.add_tools(BoxZoomTool(), WheelZoomTool(), PanTool(), ResetTool(), BoxSelectTool(), TapTool())

            plot.xgrid.grid_line_color = None
            plot.ygrid.grid_line_color = None

            return plot

plot1 = make_plot("degree", "count", True, False, "", False, degree_x_p1, count_y)
plot2 = make_plot("degree", "pagerank", True, True, "pagerank_count", False, degree_x_p2, pagerank_y)
plot3 = make_plot("pagerank", "pagerank_count", True, False, "", False, pagerank_x, pagerank_count)
plot4 = make_plot("clustering_coefficient", "clustering_coefficient_count", True, False, "", False, clustering_coefficient, clustering_coefficient_count)

row = [plot1, plot2, plot3, plot4]
plots_row1.append(row)
plots_row1 = gridplot(plots_row1)

Here is also a gif to portray my issue:

Thanks!

--
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/89f7c777-60a1-473e-8fa7-8362bbc5205c%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
<bokeh_cut.mp4>

Thanks a lot Bryan! I have upgraded to 0.12.6 and everything worked just fine.

···

On Thursday, June 22, 2017 at 7:52:33 PM UTC-4, Bryan Van de ven wrote:

Hi,

I can reproduce this in 0.12.5 but not in 0.12.6 or current master. So this was probably an unknown bug that was inadvertently fixed in some of the fairly expansive clean up and refactoring that occurred during the last release cycle. In any event, the only simple solution I can offer is to upgrade your version of Bokeh.

Thanks,

Bryan

On Jun 22, 2017, at 18:20, [email protected] wrote:

I currently have a set of 4 graphs under a gridplot and have assigned some basic tools. However, when I deselect a tool from the toolbar, let’s say the pan tool, I am still able to pan around in all the graphs under my gridplot. The same goes for the other tools I have assigned. It seems that the tools are still active even when they are deselected from the toolbar. How could I resolve this?

I am looking through the examples here and no such issue arises, for example when the pan tool de-selected from the toolbar I am not able to pan which is what I want to achieve.

Here is some of the relevant code for making the plots:

def make_plot(xname, yname, isLog, needsColor, xcolor, needsS, xdr, ydr, xax=False, yax=False):

        mbl = between_window_size if yax else 0
        mbb = between_window_size if xax else 0
        if isLog:
            plot = figure(
                x_range=xdr, y_range=ydr, background_fill_color="white",
                border_fill_color='white', plot_width=window_size + mbl, plot_height=window_size + mbb,
                min_border_left=border_size+mbl, min_border_right=border_size, min_border_top=border_size, min_border_bottom=2+mbb,
                y_axis_type="log", x_axis_type="log")
        else:
            plot = figure(
                x_range=xdr, y_range=ydr, background_fill_color="white",
                border_fill_color='white', plot_width=window_size + mbl, plot_height=window_size + mbb,
                min_border_left=border_size+mbl, min_border_right=border_size, min_border_top=border_size, min_border_bottom=2+mbb)
        if not needsS:
            plot.xaxis.axis_label = xname
            plot.yaxis.axis_label = yname
        else:
            plot.xaxis.axis_label = "s" + xname
            plot.yaxis.axis_label = "s" + yname
        if needsColor:
            circle = Circle(x=xname, y=yname, fill_color={'field': xcolor, 'transform': color_mapper}, fill_alpha=0.6, size=5, line_color=None)
        else:
            circle = Circle(x=xname, y=yname, fill_color = "blue", fill_alpha=0.6, size=5, line_color=None)
        r = plot.add_glyph(self.source, circle)
        r.nonselection_glyph = Circle(fill_color="grey", fill_alpha = 0.1, line_color=None)
        xdr.renderers.append(r)
        ydr.renderers.append(r)
        xticker = BasicTicker()
        if xax:
            xaxis = LinearAxis(axis_label=xname)
            plot.add_layout(xaxis, 'below')
            xticker = xaxis.ticker
        plot.add_layout(Grid(dimension=0, ticker=xticker))
        yticker = BasicTicker()
        if yax:
            yaxis = LinearAxis(axis_label=yname)
            plot.add_layout(yaxis, 'left')
            yticker = yaxis.ticker
        plot.add_layout(Grid(dimension=1, ticker=yticker))
        plot.add_tools(BoxZoomTool(), WheelZoomTool(), PanTool(), ResetTool(), BoxSelectTool(), TapTool())
        plot.xgrid.grid_line_color = None
        plot.ygrid.grid_line_color = None
        return plot

plot1 = make_plot(“degree”, “count”, True, False, “”, False, degree_x_p1, count_y)

plot2 = make_plot(“degree”, “pagerank”, True, True, “pagerank_count”, False, degree_x_p2, pagerank_y)

plot3 = make_plot(“pagerank”, “pagerank_count”, True, False, “”, False, pagerank_x, pagerank_count)

plot4 = make_plot(“clustering_coefficient”, “clustering_coefficient_count”, True, False, “”, False, clustering_coefficient, clustering_coefficient_count)

row = [plot1, plot2, plot3, plot4]

plots_row1.append(row)

plots_row1 = gridplot(plots_row1)

Here is also a gif to portray my issue:

Thanks!


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/89f7c777-60a1-473e-8fa7-8362bbc5205c%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

<bokeh_cut.mp4>