holoviews
holoviews copied to clipboard
Nested, grouped bar chart does not render third dimension
ALL software version info
Environment: macOS 11.2.1, Python 3.8.4, Jupyter Notebook 6.1.5
Browsers: Chrome 89.0.4389.128, Safari 14.0.3
Library Versions: holoviews==1.14.2 bokeh==2.3.0
Description of expected behavior and the observed behavior
In the following snippet, the 3rd level data is not presented (i.e. country).
Complete, minimal, self-contained example code that reproduces the issue
#!/usr/bin/env python
# coding: utf-8
import holoviews as hv
import pandas as pd
x = [
[100, "Canada", "America", "Earth"],
[2000, "U.S.", "America", "Earth"],
[3000, "Buu", "Blau", "Mars"],
]
data = {
"population": [i[0] for i in x],
"country": [i[1] for i in x],
"continent": [i[2] for i in x],
"planet": [i[3] for i in x],
}
df = pd.DataFrame(data=data)
hv.extension("bokeh")
# ISSUE: the 3rd level data is not presented
hv.Bars(df, ["planet", "continent", "country",], "population").opts(tools=["hover"])
Screenshots or screencasts of the bug in action
![3rd Level - 1](https://user-images.githubusercontent.com/1267052/118085592-7fb54b80-b377-11eb-956d-3ac6185e16d7.png)
![3rd Level - 2](https://user-images.githubusercontent.com/1267052/118085593-804de200-b377-11eb-837f-a456000c33fc.png)
HoloViews does not support three levels of nesting for Bars it used to in the very early days but the implementation back then was not maintainable. That said we should limit the bounds on the number of kdims until we implement support for more than two-levels again.
Limiting the number of allowed kdims is pretty trivial so I'll add this to the next milestone.