# streamgraph **Repository Path**: tidyfriday/streamgraph ## Basic Information - **Project Name**: streamgraph - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-01-20 - **Last Updated**: 2021-01-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README streamgraph

streamgraph is an htmlwidget for making, well, streamgraphs.

example

Sample Rmd

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.

TODO

The following functions are implemented:

News

Installation

devtools::install_github("hrbrmstr/streamgraph")

Usage

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.