holoviews icon indicating copy to clipboard operation
holoviews copied to clipboard

Nested, grouped bar chart does not render third dimension

Open alobo opened this issue 3 years ago • 2 comments

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 3rd Level - 2

alobo avatar May 13 '21 06:05 alobo

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.

philippjfr avatar May 17 '21 16:05 philippjfr

Limiting the number of allowed kdims is pretty trivial so I'll add this to the next milestone.

jlstevens avatar Jun 07 '21 15:06 jlstevens