Open PeterFogh opened 4 years ago
See also discussion at https://discourse.holoviz.org/t/hook-to-hv-table-do-not-work-with-hv-dynamicmap/443.
I noticed that column width resizing did not work until i changed the default autosize_mode
Disclaimer: I do not use DynamicMap but hvplot but this hook works for me:
def hide_index(plot, element):
plot.handles['table'].autosize_mode = "none" # column resizing does not work without this line
plot.handles['table'].columns[2].width = 60
More details here: autosize_mode doc
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 ahv.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 thehv.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
Screenshots or screencasts of the bug in action
The initial plot:
The plot after selecting another kdims value.