Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Disable pan/zoom on yaxis

Is there any built-in support for disabling pan/zoom action on yaxis? (I mean - when I hover on yaxis the pointer changes and I can drag on it, which causes pan action in the middle part of the axis and zoom in the top and bottom part of the axis.)

I want the pan/zoom only be available on the plot area. By default, there are also drag zones on yaxis (nsdrag, sdrag, ndrag). In my graph, I dynamically add new traces, each trace with dedicated layout and its own yaxisN. The layouts are overlayed, so the yaxis is active only for the top most layer (the last added yaxis).

The only way I figured out is adding style like this:

g.draglayer g.xy2 {
  display: none;

This seems to be a bit hacky as I can’t be sure if the class name don’t change in future versions…

You can try switching off these two config options. It may not do exactly what you’re hoping for though.