Closed josep2 closed 9 years ago
Haven't tried I but it should. I'll whip up an example later tonight to test
On Thursday, February 19, 2015, Jowanza Joseph notifications@github.com wrote:
Does this library currently support shiny?
— Reply to this email directly or view it on GitHub https://github.com/hrbrmstr/streamgraph/issues/6.
Yep. It seems to do just fine.
library(streamgraph)
library(dplyr)
library(shiny)
ui = shinyUI(fluidPage(
h3("streamgraph example", style="text-align:center"),
streamgraphOutput('sg1')
))
server = function(input, output) {
ggplot2::movies %>%
select(year, Action, Animation, Comedy, Drama, Documentary, Romance, Short) %>%
tidyr::gather(genre, value, -year) %>%
group_by(year, genre) %>%
tally(wt=value) %>%
ungroup %>%
streamgraph("genre", "n", "year") %>%
sg_axis_x(20) %>%
sg_fill_brewer("PuOr") %>%
sg_legend(show=TRUE, label="Genres: ") -> sg
output$sg1 <- renderStreamgraph(sg)
}
shinyApp(ui = ui, server = server)
thx!
Does this library currently support shiny?