From: Feiming Chen <feimingchen@yahoo.com>
To: emacs-orgmode@gnu.org
Subject: Embed Interactive Charts from R/Google Visualization API into Web Page Generated with Emacs-Org-Babel Mode
Date: Wed, 18 Jul 2012 13:51:08 -0700 (PDT) [thread overview]
Message-ID: <1342644668.7087.YahooMailRC@web181505.mail.ne1.yahoo.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 230 bytes --]
Hi, I would like to submit a simple example of embedding interactive charts in
emacs-org-babel mode. I am very excited after discovering these tools. See
the attached .org and .html file. Thanks!
Sincerely,
Feiming Chen
[-- Attachment #1.2: Type: text/html, Size: 453 bytes --]
[-- Attachment #2: googleVis2web.html --]
[-- Type: text/html, Size: 7118 bytes --]
[-- Attachment #3: googleVis2web.org --]
[-- Type: application/octet-stream, Size: 1630 bytes --]
#+TITLE: Embed Interactive Charts from R/Google Visualization API into Web Page Generated with Emacs-Org-Babel
#+AUTHOR: Feiming Chen
#+EMAIL: Feiming_Chen@bd.com
* Introduction
The =R= package =googleVis= provides a R interface into the Google
Visualisation API, the latter of which offers interactive charts that can
be embedded into web pages. Using Emacs-Org-Babel mode, we can easily
generate a web page with embedded interactive chart based on a =R= data
frame object. Following is an example R source code block:
#+begin_example
#+begin_src R :exports both :results output html
library(googleVis)
data(Fruits)
m <- gvisMotionChart(Fruits, idvar="Fruit", timevar="Year")
print(m, 'chart')
#+end_src
#+end_example
You would then see the embedded interactive chart in the html file
exported from Emacs-Org mode via /a web server/.
#+begin_src R :exports results :results output html
library(googleVis)
data(Fruits)
m <- gvisMotionChart(Fruits, idvar="Fruit", timevar="Year")
print(m, 'chart')
#+end_src
If you want to view the chart (a Flash object) in a local file, as you
usually do when editing an .org file, you would need to change your Flash
security settings according to [[http://stackoverflow.com/questions/8009825/cannot-view-gvismotionchart-from-printed-html-file][this solution]] quoted below by Tony Breyal:
1. Go to http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
2. Click on the dropbox which says 'Edit location' and choose 'add location'
3. Click 'browse for folder'
4. Choose the folder in which you saved your html file
5. Click OK
next reply other threads:[~2012-07-18 20:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-18 20:51 Feiming Chen [this message]
2012-07-18 22:23 ` Embed Interactive Charts from R/Google Visualization API into Web Page Generated with Emacs-Org-Babel Mode Thomas S. Dye
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1342644668.7087.YahooMailRC@web181505.mail.ne1.yahoo.com \
--to=feimingchen@yahoo.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).