streamgraph is an htmlwidget for making, well, streamgraphs.
A streamgraph (or "stream graph") is a type of stacked area graph which is displaced around a central axis, resulting in a flowing, organic shape. Streamgraphs were developed by Lee Byron and popularized by their use in a February 2008 New York Times article on movie box office revenues. (Wikipedia)
The x axis values can be continous or dates.
- Support is planned for
xtsobjects, but not for a bit.
- Support for categorical/discrete x axis
The following functions are implemented:
streamgraph: Create a new streamgraph
sg_axis_x: Modify streamgraph x axis formatting
sg_axis_y: Modify streamgraph y axis formatting
sg_colors: Modify streamgraph axis text, legend popup label text and tooltip text colors (NOTE: no longer modifies fill colors, use
sg_fill_*for fill colors)
sg_legend: Add select menu "legend" to interactive streamgraphs
sg_fill_brewer: Specify a ColorBrewer palette to use for the stream fills
sg_fill_manual: Specify a manual color palette to use for the stream fills
sg_fill_tableau: Specify a Tableau color palette to use for the stream flls
sg_add_marker: Annotate streamgraph with vertical line and label
sg_annotate: Annotate streamgraph with a label
0.8.1released - ggplot2 movies fix; corrected numerous notes from CRAN check
0.8released - support for negative Y axis numbers and upgrade to latest D3
datecan be either bare or quoted
0.7released - New
sg_annotationto enable annotation of streamgraphs
0.6released - New
streamgraphlets you choose between continuous or date scales.
sg_colorsnow has nothing to do with the stream fills but does set the axis text, legend popup label text and tooltip text.
0.5released - deprecated use of
sg_colors. Its functionality will change soon and is replaced by three
tableau) which makes more sense, is aligned to the
ggplot2way of specifying fill aesthetics and now makes it easier to highly customize the streamgraph appearance.
0.4.2released - fixed bug (thanks to teammate @bhaskarvk) that causes inconsistent color rendering for each area component (noticeable on resize of flexible width/height graphs)
0.4.1released - removed warning message when supplying
POSIXctstill only works for granularities >= 1 day)
0.4released - select menu "legend" (interactive only)
0.3.1released - bug fix to fix error with
streamgraphwill now see if the date input is a year and automatically convert it to the necessary format (no need to use
0.3released - folks can have some fun with new
0.2.2relased - rly rly rly fixed tooltips now, also assed ability to format y axis text
0.2.1released - ok, working tool tips for realz now
0.2released - working SVG tooltips; general code cleanup
library(streamgraph) # current verison packageVersion("streamgraph") library(dplyr) ggplot2movies::movies %>% select(year, Action, Animation, Comedy, Drama, Documentary, Romance, Short) %>% tidyr::gather(genre, value, -year) %>% group_by(year, genre) %>% tally(wt=value) -> dat streamgraph(dat, "genre", "n", "year", interactive=TRUE) %>% sg_axis_x(20, "year", "%Y") %>% sg_fill_brewer("PuOr")
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.