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

added code for plotly #19

Open
winsonfzyang opened this issue Mar 23, 2018 · 4 comments
Open

added code for plotly #19

winsonfzyang opened this issue Mar 23, 2018 · 4 comments

Comments

@winsonfzyang
Copy link

Hello! I think I might know a way to allow plotly to work on your app.
you would have to add this to server.R:

output$plotly.plot <- renderPlotly({ ggplotly(plotObject()) })

output$ui_plotly <- renderUI({ plotlyOutput('plotly.plot', width = "100%" ,height = input$height) })

But doing that your box plots will not work because when you have no input in Groups, your group is an empty column, and plotly cannot read it.

geom_boxplot(aes(group=NULL)

My suggestion to get it working is to replace NULL with input$x:

geom_boxplot(aes_string(group=input$x)

@smouksassi
Copy link
Owner

smouksassi commented Mar 24, 2018 via email

@smouksassi
Copy link
Owner

Dear winsonfzyang ,
Can you show some example plotly outputs you would like the ggquickeda ( new package name to produce ?) will repoen in the new repo thanks

@winsonfzyang
Copy link
Author

Hello smouksassi,
Maybe a scatterplot or box plot for a start will be good. I've made my own modifications to your app for my usage, and I think this will work

@smouksassi
Copy link
Owner

Dear winsonfzyang, please comment on the issue with ggquickeda the new version of this package just submitted to CRAN. Plotly will work whenever you remove the ignore mapped grouping and you map a group explicilty but then you lose the automatic grouping that ggplot do under the hood.

Using the built in sample_data I am using Gender as x variable and conc as y variable and Gender as Colour B, Group By and Fill by: and we split column by Race
explicitgrouping

now suppose you want another plot
morethanonegroupneeded

when grouping is not specified ggplot knows that we wnat to group by the combination of x and color

this where Plotly will not work unless you do the Race_gender group and group by it as below
you will get the plotly but it will not be dodged probalby because it is automatic in ggplot

morethanonegroupneededplotly

This illustrate why just grouping by x variable might not be enough and this app was designed with ggplot first and foremost in mind. I would like to make it more plotly compatible by writing directly in plotly as ggplotly has some limitations.

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

2 participants