chendaniely / ebola

Data for the 2014 ebola outbeak in West Africa
Other
2 stars 1 forks source link

ported rCharts plotting library, possible add for chendaniely/ebola#3 and chendaniely/ebola#5 #10

Closed rcquan closed 9 years ago

rcquan commented 10 years ago

I added two tabs to the Shiny app. Both render plots using rCharts (chendaniely/ebola#5). You need to load the dev version of rCharts into the namespace for this to work. For some reason, I can't seem to include the google-analytics script so I commented that line out:

Rickshaw. An interactive line graph plotting cases and deaths in absolute time (chendaniely/ebola#3). Features include hover details and a slider bar to zoom in on selected time periods, but I can't get the latter to work properly in the Shiny application. This is a known issue in rCharts.

screenshot 2014-10-19 03 10 27

NVD3. Stacked bar plots of cases and deaths for the most recently updated figures from each country. Features include transitions from grouped to stacked and coordinate flipping.

screenshot 2014-10-19 03 10 40

TODO

chendaniely commented 10 years ago

the issue with rcharts is with shiny? does plot.ly have better shiny support?

chendaniely commented 10 years ago

the way I was going to get time sliders to work in shiny was to use the dates form the widget to subset the dataframe, and then pass that dataframe into the plotting libraries. Does that work around the plotting issues in rcharts?

My initial thought was to rely on the R functions as much as possible and treat the plotting libraries just for plotting.

chendaniely commented 10 years ago

for chendaniely/ebola#3 to be fixed, it would need a widget that can toggle between absolute and relative times

I think this is why I opted to do all my work in R before going into the plotting libraries

chendaniely commented 10 years ago

I can't seem to include the google-analytics script

Can you elaborate on this? it should just 'work'

rcquan commented 10 years ago

Oops, I thought I included this in the comments somewhere. The line with tag$head(...) throws the following error:

Error in tag("div", list(...)) : argument is missing, with no default

Runs fine when I comment it out though.

chendaniely commented 10 years ago

@rcquan I just got your stuff to work on my machine. Thanks for the contribution! this is awesome!

I'll take a look at the google analytics stuff before I do a final merge and deploy. Do you need this online for Maleki's class?

So I think we should either use the shiny widget panel for all the graphs or we do some reactive HTML stuff for the Rickshaw and NVd3 plots and take out the shiny widget. There are redundant interactive options that's why.

I'm pro using shiny to change the underlying plot data, since it seems this might limit the number of conflict issues. But I don't know how the plotting libraries you used work, so let me know...

I'm still confused as to to the &>& operator working, it didn't work when I first used it for the ggplot data manipulation... weird..

chendaniely commented 10 years ago

@cmrivers pretty graphs on the way! thanks @rcquan!

chendaniely commented 10 years ago

@rcquan the rCharts website changed, so I can't find the original template I was inspired by, but the one I liked was the hover over showed all the data for each of the lines, not just 1.

For example, instead of just showing case/death counts for Guinea, it shows it for Guinea, US, Spain, Sierra Leone, etc for a given time.

rcquan commented 10 years ago

@chendaniely No worries on the deployment rush! This wasn't for Malecki's class or anything - just for fun and practice with shiny and submitting pull requests. Got my inspiration from attending the Ebola Open Data Jam this past weekend and remembered you were working with some ebola data. Stumbled across your shiny app in the process and decided to contribute! Perhaps it can be used as a motivating example for the CSAPH R workshop in November?

rcquan commented 10 years ago

@chendaniely Hm, perhaps the multiple hover tooltips come from the Morris.js library? I tried using Morris in a earlier sketch, but there was an issue with the underlying data. Since the sitreps for each country come out on different dates, some country case/death counts will show up as missing in the hover details for given days. We would have to do some sort of imputation to make sure all the NA values in the dataset are filled with the case/death count from the latest report. That way the hover would show complete values for each day.

I think the %>% is the only pipe that works now. Hadley deprecated all the other ones recently including &>& and %.%. Maybe that's why it didn't work? Hmm..

chendaniely commented 9 years ago

@rcquan sorry. i'm taking the GRE's on I'll get this all merged in and stuff after?

rcquan commented 9 years ago

No worries at all! Good luck on the GRE. Rock it!

On Oct 24, 2014, at 1:53 PM, Daniel Chen notifications@github.com wrote:

@rcquan sorry. i'm taking the GRE's on I'll get this all merged in and stuff after?

— Reply to this email directly or view it on GitHub.

chendaniely commented 9 years ago

@rcquan i'm going to add your TODO's into the issue tracker

chendaniely commented 9 years ago

@rcquan can you rebase this against the dev-dan-shiny branch? or against master and re-send the PR. (I think if you do it against master, you won't get any conflicts, i can resolve the conflicts)

chendaniely commented 9 years ago

Just realized the conflicts are kind of insane...

rcquan commented 9 years ago

What happened exactly? What's the best way to fix it on my end?

Ryan Quan Graduate Student Public Health Informatics Columbia Mailman School of Public Health 408.821.3440 | ryan.quan08@gmail.com

On Nov 21, 2014, at 12:03 AM, Daniel Chen notifications@github.com wrote:

Just realized the conflicts are kind of insane...

— Reply to this email directly or view it on GitHub.

chendaniely commented 9 years ago

you need to update your master and dev-dan-shiny branches, then perform a rebase

git fetch --all git checkout master git merge cmrivers/master git checkout dev-dan-shiny git merge chendaniely/dev-dan-shiny git checkout rcharts git rebase dev-dan-shiny

fix conflicts

you understand the code a little better than I do... i'm not that familiar with the tab panel you used

rcquan commented 9 years ago

Please refer to PR #18 for continuation of this discussion.