Skip to content

Instantly share code, notes, and snippets.

@hafen
Created April 10, 2017 22:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hafen/573da5da4b384ebde76012ab06420943 to your computer and use it in GitHub Desktop.
Save hafen/573da5da4b384ebde76012ab06420943 to your computer and use it in GitHub Desktop.
writing trelliscopejs
library(trelliscopejs)
library(ggplot2)
qplot(cty, hwy, data = mpg) +
geom_abline(alpha = 0.5) +
xlim(7, 37) + ylim(9, 47) + theme_bw() +
facet_trelliscope(~ manufacturer + class, nrow = 2, ncol = 4, path = "/tmp/myplot")
# this places a self-contained trellisopejs display in the directory /tmp/myplot
list.files("/tmp/myplot")
browseURL("/tmp/myplot/index.html")
# this directory can be zipped up and sent to someone
# or you can place this directory in a github pages repository to serve it on the web through github pages
# or you can simply place this directory on any web server to serve it on the web
# (it's pure html/js so any web server should be able to handle it without any other technology set up)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment