Holoviews active tools configuration and datashader layout

176 views Asked by At

Suppose having the following code:

# Layout creation
y1 = hv.Curve((dt, data['Noise 1']), 'Date', 'y(t)', label='Noise 1')
y2 = hv.Curve((dt, data['Noise 2']), 'Date', 'y(t)', label='Noise 2')
layout = y1 + y2

# Grid style layout
gridstyle = {
    'grid_line_color': 'lightgray',
    'grid_line_width': 1,
    'minor_grid_line_color': 'lightgray',
    'minor_grid_line_width': 0.5,
    'minor_grid_line_dash': 'dashed'
}

# Layout style options
layout.opts(opts.Curve(
    width=930, 
    height=300, 
    line_width=2, 
    fontscale=1.5,
    color='blue',
    tools=['hover', 'help'],
    active_tools=['wheel_zoom', 'pan'],
    gridstyle=gridstyle,
    show_grid=True
)).cols(1)

The result is:

Result_1

Why are pan and hover plot tools set to be active? The code should be set up such that wheel_zoom and pan are the active plot tools.

In addition to that, if the following line of code is executed,

dynspread(datashade(layout).opts(width=930, height=300))

The resulting output loses all the previous layout style and grid settings (font size, plot tools, grid specs, etc.):

Image_2

Why does this happen?

1

There are 1 answers

0
James A. Bednar On

Please file a feature request at https://github.com/holoviz/holoviews/issues to ask that the default tools be set a certain way, so that people can discuss the pros and cons of any changes to the defaults.

For the second case, see https://github.com/holoviz/holoviews/issues/2637 and chime in with your votes if you want to. I agree it would be good to propagate such settings across operations, but it is not technically straightforward at all.