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

set_size.show #104

Merged
merged 15 commits into from
Mar 27, 2018
Merged

set_size.show #104

merged 15 commits into from
Mar 27, 2018

Conversation

RichardJActon
Copy link
Contributor

A fix for issue #74

Adds the set_size.show parameter to upset which adds a geom_text element to Size_plot if set to TRUE.
Text scales with the axis labels and is positioned such that it should be ~aligned with the leftmost end of the bars.

@JianWang2016
Copy link

Hi, Is this feature available? Thanks.

@RichardJActon
Copy link
Contributor Author

Hi @JianWang2016 it does not appear to be available in the main branch as of yet, however, you can use my version of this package to get it if you would like - to do this I would recommend cloning my version locally and using R's devtools package to install it from that copy.

Download the repo from: https://github.com/RichardJActon/UpSetR and run this R code before the rest of your work:

install.packages("devtools") # if needed
library(devtools)
dev_mode()
install_local("/path/to/local/copy/of/repo")
library(UpSetR)

Then you should have access to this feature.

@JianWang2016
Copy link

Thanks much. I will give it a try tomorrow.

@JakeConway JakeConway merged commit 0fd179b into hms-dbmi:master Mar 27, 2018
@JianWang2016
Copy link

I just tried the set_size.show = TRUE feature. It does show the number within the side bars if used in R console. However, when this version is used in R shiny, the entire image is not drawn anymore. The cran version of UpSet.R works with R shiny. The only change is 1) upgrade to github master UpSet.R. The image can't be drawn with set_size.show = TRUE neither set_size.show = FALSE. The code works immediately when switching back to cran version. I am yet to investigate what is causing it incompatible with R shiny. At meanwhile I would greatly appreciate if you have any insight.

@GeoMicroSoares
Copy link

GeoMicroSoares commented Jun 13, 2018

All working out well here, maybe another enhancement to this would be to set where horizontally these numbers are plotted. In my case, I could do with having them a bit more to the left (see below) so they wouldn't sit on top of the bar.
I see set_size.show depends on ggplot2::geom_text() so maybe let hjust and vjust up to the user as well?

image

@RichardJActon
Copy link
Contributor Author

Hi @GeoMicroSoares, yes I think it would be just geom_text options. The reason I went with the position the way it is was this seemed to most reliably put the text in a location that would be readable, moving it to the left often causes the text to move out of the frame a get cut off by the leftmost side of the plot and I was not sure how to get it to resize accordingly. Perhaps if I find some time I could come up with a way of passing a 'list' of parameters to geom_text via set_size.show so that we don't end up with too many parameters for the upset function.

@GeoMicroSoares
Copy link

@RichardJActon that would be ideal actually! Thanks so much for your work btw, love the package!

@samanthaleejensen
Copy link

samanthaleejensen commented Jul 26, 2019

@RichardJActon Any updates on this? The CRAN version is cutting off the labels on the left and I can't figure out how to fix it.

image

[EDIT] For those who are as dense as me, if you increase the max size of the plot with the set_size.scale_max parameter, you can get it shifted over far enough to see your numbers. No messing with the margins necessary.

image

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

Successfully merging this pull request may close these issues.

None yet

8 participants