ALL software version info
Unix - “Ubuntu 18.04.4 LTS (Bionic Beaver)”
Python Libraries: holoviews 1.12.7, pandas 1.0.1
Browser: Google Chrome
Description of expected behavior and the observed behavior
I present here a simplified example of my original plot to present the specific problem. I have a hv.Table
which updates using a hv.DynamicMap
(a value selector). My table has some columns which contain long strings, thus I want to customize the width of some of the columns. This is possible using holoviews hooks, as seen in the example below. However, when the hv.DynamicMap
updates the table, the column width customization does not take effect, as shown in the screenshots below.
Complete, minimal, self-contained example code that reproduces the issue
%load_ext watermark
import holoviews as hv
import pandas as pd
hv.extension('bokeh')
print('Watermark of notebook execution:')
%watermark -iv
def table(data_id):
def column_width(plot, element):
plot.handles['table'].columns[0].width = 1400
plot.handles['table'].columns[2].width = 1400
df = pd.DataFrame({
'x': [data_id*10**12]*4,
'y': [1, 2, 3, 4],
'z': [data_id*10**12]*4})
hv_table = hv.Table(df).opts(
width=400, height=200, hooks=[column_width])
return hv_table
dmap_table = hv.DynamicMap(table, kdims=['data_id']).redim.values(
data_id=[0, 1])
dmap_table
Screenshots or screencasts of the bug in action
The initial plot followed by the plot after selecting another kdims value.
By mistake, I created this issue on Github: https://github.com/holoviz/holoviews/issues/4343.