Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

261
Vistas
BokehJS BoxZoomTool always active by default, even when setting active: false

In BokehJS 2.4.2 the BoxZoomTool is always active by default, even when setting the active property to false when adding the tool.

const box_zoom = new Bokeh.BoxZoomTool({
    active: false,
});
plot.add_tools(box_zoom);

With other tools, such as the FreehandDrawTool, the tool is not active by default and the active property is not ignored.

How do you add the BoxZoomTool without being active by default?

enter image description here

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The BoxZoomTool has no parameter active, therefor the keyword is ignored in your example.

To set tools active, please check out this documentation.

In your case the line p.toolbar.active_drag = None does the trick, which deactivates all pan/drag tools, and you have only on off it. This line accepts "auto", None or an instance of pan/drag.

Python Example

from bokeh.plotting import show, figure, output_notebook
from bokeh.models import BoxZoomTool
output_notebook()

p = figure(width=300, height=300, tools='')
box_zoom = BoxZoomTool()
p.line(x=[1,2,3,4,5], y=[1,2,3,4,5])
p.toolbar.active_drag = None # could also be "auto" or box_zoom
p.add_tools(box_zoom)

show(p)

enter image description here

This can be adapted to JS.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda