cccs-web / core

CCCS' customized django web application
4 stars 11 forks source link

help to learn how to visualize graphs / dataplots quickly (using R) #194

Open cccs-ip opened 9 years ago

cccs-ip commented 9 years ago

R is a software environment for statistical computing and graphics. R generally comes delivered as part of some form of 'studio' package, most of which include their own server.

I would like be able to embed graphics within a web page using R code. I would like to be able to do this 'dynamically', so that I can tweak the code / data sources and have the graphics regenerate on their own (as opposed to re-generating images each time I change some aspect of the formula).

This link suggests that django might be able to deal with this without any modifications to the code: https://www.linkedin.com/groups/R-web-apps-77616.S.91223876

Any help to explain an appropriate workflow to link in an R script would be appreciated.

cccs-ip commented 9 years ago

https://demo.ocpu.io/markdownapp/www/

This looks like a possible solution.

cccs-ip commented 9 years ago

I ran the install from https://www.opencpu.org/demo.html and it messed up the server by adding in /init.d./ processes. When you install this locally, please be aware of the need to use nginx.

cccs-ip commented 9 years ago

I am still trying to figure out if and how the parts can fit together to allow us to write mathmatical expressions markdown in our web application and have it visualize the output. opencpu to me at first looked like it could work (i was super excited by the markdown app), but I see now that it would involve another server running in parallel and some means of communicating information between them. Not ideal.

Interestingly, it does appear that opencpu can integrate with pages on GitHub to graph out plots and expressions.

So a "working" alternative may be to host a cccs github page where we can upload .md files to a specific folder, and have R generate output graphics which we then capture and embed back in the original webpage. This approach is clearly non-ideal as it involves lots of cross-linkages, but it would at least give users who don't have R on their computer a means of playing around with scripts and visualization tools.

Otherwise we should explore possibly dropping the R idea and just keeping to python for working with math. Based on this article, it's the better choice anyway.

cccs-ip commented 9 years ago

Here are some other alternatives: Graphos is a Django app to normalize data to create charts. check out the docs. It looks pretty good.

Another Django app that I read about is pandas.

And another: cairoplot

FYI: Here's the django-packages list of native django chart apps.

I would like processing to occur on the sever side rather than depending on external processors (like Google).

cccs-ip commented 9 years ago

Django Chartit also appears to be a suitable alternative for basic data visualization purposes.

Demo: http://chartit.shutupandship.com/demo/

Check out this particular demo: http://chartit.shutupandship.com/demo/chart/combination-line-pie/

cccs-ip commented 9 years ago

... Important points to bear in mind:

the challenge is the workflow; we envision expert authors wanting to write pages in a single source point. pages are markdown documents. we need to be able to tell people in which language to write to embed a graph or chart in a markdwon document. the outputs need go to both web and printed paper reports (via LaTeX).

considerations:

in my understanding, R is capable of producing graphs that can port to both the web and to LaTex. I assume that Python is too. Django is built in Python, so it would make sense to keep everything in Python. from what I have seen, however, the R community is offering more extensive tools for data visualization that can meet my needs of reporting (printing) to both the web and to PDF (for physical printing) than I have discovered when researching options for python. Maybe I am missing something....