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

fix faceting in tm_g_km #720

Merged
merged 15 commits into from
Feb 21, 2023
Merged

fix faceting in tm_g_km #720

merged 15 commits into from
Feb 21, 2023

Conversation

chlebowa
Copy link
Contributor

Closes #665.

Added expression that drops unused levels of faceting variable before plotting, so that empty panels are not plotted.

@chlebowa
Copy link
Contributor Author

I believe dropping unused levels is sufficient here as it results in no empty subplots taking up space.

In a reasonable majority of cases the faceting variable will have few values. In the minority of cases with many values, I believe the recommended solution is to manually change the plot size using the widgets in plot_with_settings ("expand" icon in top right corner).

@chlebowa chlebowa marked this pull request as ready for review February 15, 2023 15:35
@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2023

Unit Tests Summary

    1 files    33 suites   3s ⏱️
149 tests 149 ✔️ 0 💤 0
168 runs  168 ✔️ 0 💤 0

Results for commit 244d899.

♻️ This comment has been updated with latest results.

@mhallal1 mhallal1 self-assigned this Feb 16, 2023
Copy link
Collaborator

@mhallal1 mhallal1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added some changes:

  1. Pushed the dropping of the empty levels one level up
  2. removed the condition for empty plot

Copy link
Collaborator

@mhallal1 mhallal1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do agree with @chlebowa that the user shall manually update the height of the plots as he/she desires and it is not the responsibility of the module.

@chlebowa chlebowa marked this pull request as draft February 17, 2023 13:47
Copy link
Collaborator

@mhallal1 mhallal1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solution prints the plots over each other instead of plotting in a grid when using show R code:
Screenshot from 2023-02-20 10-07-28

@chlebowa
Copy link
Contributor Author

This solution prints the plots over each other instead of plotting in a grid when using show R code:

But not in the app 🤔

@chlebowa
Copy link
Contributor Author

Introduced counting function again. Seems to work well now.

@chlebowa chlebowa marked this pull request as ready for review February 20, 2023 14:52
@chlebowa chlebowa requested a review from mhallal1 February 20, 2023 14:55
Copy link
Collaborator

@mhallal1 mhallal1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@chlebowa chlebowa merged commit 6f05f3d into main Feb 21, 2023
@chlebowa chlebowa deleted the 665_faceting@main branch February 21, 2023 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Make faceting optionally in a grid rather than just one column in tm_g_km
2 participants