facebookexperimental / facebookexperimental/Robyn

Onepager sizing enhancement desired to better read waterfall decomposition plot

Ouverte
#1,076 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Jupyter Notebook
Étoiles
1.5k
Forks
433
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

## Project Robyn

## Describe issue
I have been using Robyn for the last year and have noticed that the onepager - specifically, the waterfall decomposition chart - has become hard to read/use.

I understand that we have all the supporting data to modify a plot ourselves but I feel that the default behavior should be improved as the onepagers get such high usage.

Below is an example. I have found that the bar plot labels for the waterfall decomposition chart are all squished together making it hard to read and understand the volume contributions for each of the model features. The feature text on the side is legible.

I have also noticed that there is a disproportionate amount of height on the last row of the onepager - when really I think that height should be redistributed to the top row.

![1_499_3](https://github.com/user-attachments/assets/1f2c31c5-04e1-492a-8542-c5ccc12145cd)

I looked the commit history and could see a change starting in July 2023 to use patchwork::plot_layout() to control the layout/define the heights: https://github.com/facebookexperimental/Robyn/commit/18a9257128d75a578442f024b1895ce69c49200c.

I know that today the code is slightly different than the commit above (but still uses patchwork::plot_layout() for layout definition). However, I think an enhancement is needed to improve the height distribution across the plots. I don't think this will be solved by decreasing the size of the text within the waterfall decomposition chart (although, that may be something that should be done in addition to my suggestions below).

I'm thinking the code should be changed to the below:

```
pg <- (p2 + p5) / (p1 + p8) / (p3 + p7) / (p4 + p6) +
patchwork::plot_layout(heights = c(get_height * 1.5, get_height, get_height, 1)) + # Increase the first row height
plot_annotation(
title = onepagerTitle,
subtitle = errors,
theme = theme_lares(background = "white"),
caption = onepagerCaption
)
```
Alternatively, ratios could be used like so: `plot_layout(heights = c(2, 1, 1, 1))`. I'm not clear why 1 is being used for the last row - that seems suboptimal.

I am not sure if others have noticed this behavior as well which is why I did not submit a PR right away and opted for an issue instead.

cc: @gufengzhou

## Environment & Robyn version
I am using the latest Robyn version.

- Check and share Robyn version: Robyn v3.11.1
- R version: R-4.4.0

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.