hrbrmstr / streamgraph

:wavy_dash: htmlwidget for creating streamgraph visualizations in R
http://hrbrmstr.github.io/streamgraph/
Other
148 stars 49 forks source link

Tooltips not working fully #1

Closed abresler closed 9 years ago

abresler commented 9 years ago

Tooltips appear not be returning the keyed values but other than this BEAUTIFUL new package.

Here is my example:

packages <-
  c('dplyr','magrittr','tidyr','streamgraph')
lapply(packages,library, character.only = T)
df <-
  'http://asbcllc.com/blog/2015/february/cre_stream_graph_test/data/cre_transaction-data.csv' %>%
  read.csv() %>%
  data.frame() %>%
  tbl_df

data_wide <-
  df[,c(1:3,5,7,9,11,13)]

names(data_wide) <-
  c('year','all','office','industrial','retail','multifamily','hotel','land')
data_long <-
  data %>% tidyr::gather(asset_class,volume_billions,-year)

dat_cre <-
  data_long %>%
  filter(year >= 2005) %>%
  filter(!asset_class == 'all') %>%
  mutate(year = sprintf("%d-12-31", year) %>%
          as.Date() #add the date
  )

dat_cre %>%
  streamgraph("asset_class", "volume_billions", "year",
              interactive=TRUE) %>%
  sg_axis_x(1, "year", "%m-%Y") %>% #1 year increments
  sg_axis_y(75) %>% 
  sg_colors("PuOr")
hrbrmstr commented 9 years ago

sure, include the data here after i scrape the data from a PDF :-) http://rpubs.com/hrbrmstr/59299

hrbrmstr commented 9 years ago

i pushed 0.2.2. it fixes this (was a dumb error on my part) and looks good with your data too. i'll give it time to bake and close if no objections.

hrbrmstr commented 9 years ago

closed and then some. might want to hit the Rpubs again ;-) [we're having some data issues right now so i had a cpl mins]