Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onepager sizing enhancement desired to better read waterfall decomposition plot #1076

Open
juliarodd opened this issue Oct 16, 2024 · 0 comments

Comments

@juliarodd
Copy link

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

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: 18a9257.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant