holoviz / holoviews

With Holoviews, your data visualizes itself.
https://holoviews.org
BSD 3-Clause "New" or "Revised" License
2.71k stars 403 forks source link

Dashboard Grid Layout #5448

Open MarcSkovMadsen opened 2 years ago

MarcSkovMadsen commented 2 years ago

Request

Add Grid layout for creating irregularly spaced containers and an easy api for usage.

image

Motivation

As far as I can see HoloViews only provides regularly spaced containers.

image

But there are many use cases where you want to layout your plots non-regularly spaced but still

Panel provides additional containers like the GridSpec. But here you don't easily share and link things.

I would like the layout to be easy to use. For example via an api like

import hvplot.pandas
import pandas as pd
df = pd.DataFrame({
    'actual': [0.1, 17.5, 40, 48, 52, 69, 88],
    'forecast': [2, 8, 70, 1.5, 25, 12, 28],
    },
    index= [1, 2, 3, 4, 6, 6, 7]
)
df["delta"]=df["actual"]-df["forecast"]
line = df.hvplot(y=["actual", "forecast"])
bar = df.hvplot.bar(y="delta", height=100)
(line + (bar + bar).cols(2)).cols(1)

Here I would expect the two bar chars to have been layed out in one row with 2 columns. Currently it looks like

image

Other Frameworks support this

Plotly

https://plotly.com/python/subplots/

image

Matplotlib

https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py

image

philippjfr commented 2 years ago

This is a duplicate of one of our oldest issues: https://github.com/holoviz/holoviews/issues/91