From a7b25e92dfe9c9324a3c36afcdf29ae292071c7e Mon Sep 17 00:00:00 2001 From: Nacho Caballero Date: Wed, 24 Jul 2013 13:22:24 -0400 Subject: [PATCH] updated readme, moved urls back to chart-helpers --- R/Chart-file-structure.R | 15 --------------- R/Chart-helpers.R | 21 +++++++++++++++++++-- README.md | 7 ++++--- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/R/Chart-file-structure.R b/R/Chart-file-structure.R index ce09ad2..1e33ebf 100644 --- a/R/Chart-file-structure.R +++ b/R/Chart-file-structure.R @@ -130,21 +130,6 @@ Chart$methods( dir.create(internal$file$paths$output) } - }, - - get_urls = function(){ - internal$url$local <<- internal$file$paths$output_file - internal$url$server <<- paste0("http://localhost:", params$port, "/", internal$file$names$output_file) - }, - - get_relative_url = function(relative_path){ - if (is.null(relative_path)){ - url <- internal$file$names$output_file - } else { - url <- gettextf("%s/%s", relative_path, internal$file$names$output_file) - } - - url } ) \ No newline at end of file diff --git a/R/Chart-helpers.R b/R/Chart-helpers.R index 578e0cc..194bf4a 100644 --- a/R/Chart-helpers.R +++ b/R/Chart-helpers.R @@ -18,16 +18,33 @@ Chart$methods( .self }, - link = function(name = params$title, class = "clickme", relative_path = NULL){ + link = function(text = params$title, class = "clickme", relative_path = NULL){ url <- get_relative_url(relative_path) - link <- gettextf("%s\n", url, class, name) + link <- gettextf("%s\n", url, class, text) cat(link) .self }, + # internal + get_urls = function(){ + internal$url$local <<- internal$file$paths$output_file + internal$url$server <<- paste0("http://localhost:", params$port, "/", internal$file$names$output_file) + }, + + # internal + get_relative_url = function(relative_path){ + if (is.null(relative_path)){ + url <- internal$file$names$output_file + } else { + url <- gettextf("%s/%s", relative_path, internal$file$names$output_file) + } + + url + }, + # dummy function to not open the current chart hide = function(){ invisible() diff --git a/README.md b/README.md index 104fdcc..abda599 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,8 @@ clickme(points, x = microarray$significance, y = microarray$logFC, ## Resources -* Clickme is served with [a generous serving of wiki](https://github.com/nachocab/clickme/wiki). -* There is also [a mailing list](https://groups.google.com/d/forum/rclickme) where you can share your thoughts with people who care about pixels. -* There are other fine people trying to move visualization to the browser. Check out [rCharts](http://rcharts.io/) by Ramnath Vaidyanathan. +* [Points template parameters](http://rclickme.com/clickme/user_manual/points.html) +* Developer guide (coming soon) ## Acknowledgements Thank you **Mike Bostock**. Making the [D3.js](http://d3js.org) library more accessible was my strongest motivation for developing Clickme. @@ -47,3 +46,5 @@ Thank you **Mike Bostock**. Making the [D3.js](http://d3js.org) library more acc Thank you **Yihui Xie**. The [knitr](https://github.com/yihui/knitr) R package has shown me the importance of building bridges across technologies, while also turning my scientific ramblings into reproducible work. Thank you **Hadley Wickam**. The [testthat](https://github.com/hadley/test_that) R package has been consistently saving my butt since I started coding for a living. + +There are other fine people trying to move visualization to the browser. Check out [rCharts](http://rcharts.io/) by Ramnath Vaidyanathan.