Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
updated readme, moved urls back to chart-helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
nachocab committed Jul 24, 2013
1 parent e333f50 commit a7b25e9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
15 changes: 0 additions & 15 deletions R/Chart-file-structure.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

)
21 changes: 19 additions & 2 deletions R/Chart-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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("<a href=\"%s\" class=\"%s\">%s</a>\n", url, class, name)
link <- gettextf("<a href=\"%s\" class=\"%s\">%s</a>\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()
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ 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.

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.

0 comments on commit a7b25e9

Please sign in to comment.