{"action":"created","comment":{"url":"https://api.github.com/repos/rstudio/dygraphs/pulls/comments/86329027","pull_request_review_id":6991669,"id":86329027,"diff_hunk":"@@ -0,0 +1,104 @@\n+#' Add an external JavaScript asset as a dygraph dependency\n+#'\n+#' @param dygraph Dygraph to add dependency to\n+#' @param type Type of dependency (valid options are: 'plugins', 'plotter' or 'dataHandler')\n+#' @param name Name of dependency\n+#' @param path Path to dependency JavaScript file\n+#' @param version Dependency version (e.g. version of package which provides the dependency)\n+#' @param all.files Whether all files under the path directory are dependency files\n+#'\n+#' @return A dygraph with the specified dependency added.\n+#'\n+#' @importFrom htmltools htmlDependency\n+#'\n+#' @export\n+dyDependency <- function(dygraph, type, name, path, version = \"1.0\", all.files = FALSE) {\n+  # create an html dependency for the js file\n+  path <- normalizePath(path)\n+  assetDependency <- htmlDependency(depName(type, name),\n+                                    version,\n+                                    src = dirname(path),\n+                                    script = basename(path),\n+                                    all_files = all.files)\n+\n+  # add javascript to the dependencies\n+  if (is.null(dygraph$dependencies)) {\n+    dygraph$dependencies <- list()\n+  }\n+  dygraph$dependencies[[length(dygraph$dependencies) + 1]] <- assetDependency\n+\n+  # return dygraph\n+  dygraph\n+}\n+\n+# Make up a htmlDependency name based on asset type and name\n+depName <- function(type, name) {","path":"R/dependency.R","position":35,"original_position":35,"commit_id":"bc22499538608c08adb839fc8fd1b5a54df29b2f","original_commit_id":"bc22499538608c08adb839fc8fd1b5a54df29b2f","user":{"login":"jjallaire","id":104391,"avatar_url":"https://avatars.githubusercontent.com/u/104391?v=3","gravatar_id":"","url":"https://api.github.com/users/jjallaire","html_url":"https://github.com/jjallaire","followers_url":"https://api.github.com/users/jjallaire/followers","following_url":"https://api.github.com/users/jjallaire/following{/other_user}","gists_url":"https://api.github.com/users/jjallaire/gists{/gist_id}","starred_url":"https://api.github.com/users/jjallaire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjallaire/subscriptions","organizations_url":"https://api.github.com/users/jjallaire/orgs","repos_url":"https://api.github.com/users/jjallaire/repos","events_url":"https://api.github.com/users/jjallaire/events{/privacy}","received_events_url":"https://api.github.com/users/jjallaire/received_events","type":"User","site_admin":false},"body":"I think once we change the interface of `dyDependency` to take an html dependency directly this function can go away.","created_at":"2016-11-03T12:07:24Z","updated_at":"2016-11-03T12:07:25Z","html_url":"https://github.com/rstudio/dygraphs/pull/139#discussion_r86329027","pull_request_url":"https://api.github.com/repos/rstudio/dygraphs/pulls/139","_links":{"self":{"href":"https://api.github.com/repos/rstudio/dygraphs/pulls/comments/86329027"},"html":{"href":"https://github.com/rstudio/dygraphs/pull/139#discussion_r86329027"},"pull_request":{"href":"https://api.github.com/repos/rstudio/dygraphs/pulls/139"}}},"pull_request":{"url":"https://api.github.com/repos/rstudio/dygraphs/pulls/139","id":92107019,"html_url":"https://github.com/rstudio/dygraphs/pull/139","diff_url":"https://github.com/rstudio/dygraphs/pull/139.diff","patch_url":"https://github.com/rstudio/dygraphs/pull/139.patch","issue_url":"https://api.github.com/repos/rstudio/dygraphs/issues/139","number":139,"state":"open","locked":false,"title":"Custom plotters","user":{"login":"pshevtsov","id":290451,"avatar_url":"https://avatars.githubusercontent.com/u/290451?v=3","gravatar_id":"","url":"https://api.github.com/users/pshevtsov","html_url":"https://github.com/pshevtsov","followers_url":"https://api.github.com/users/pshevtsov/followers","following_url":"https://api.github.com/users/pshevtsov/following{/other_user}","gists_url":"https://api.github.com/users/pshevtsov/gists{/gist_id}","starred_url":"https://api.github.com/users/pshevtsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pshevtsov/subscriptions","organizations_url":"https://api.github.com/users/pshevtsov/orgs","repos_url":"https://api.github.com/users/pshevtsov/repos","events_url":"https://api.github.com/users/pshevtsov/events{/privacy}","received_events_url":"https://api.github.com/users/pshevtsov/received_events","type":"User","site_admin":false},"body":"This PR introduces new functions:\r\n\r\n* `dyAsset` — to add external dygraph dependencies\r\n* `dyPlotter` — the function similar to `dyPlugin` but for loading custom plotters\r\n\r\nIt also introduces some refactoring in `dyPlugin` function itself and in `dyCandelstick` as well.","created_at":"2016-11-03T07:42:36Z","updated_at":"2016-11-03T12:07:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"090d2fe540000463ecb3113d8b8d4a1d598c7bb0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rstudio/dygraphs/pulls/139/commits","review_comments_url":"https://api.github.com/repos/rstudio/dygraphs/pulls/139/comments","review_comment_url":"https://api.github.com/repos/rstudio/dygraphs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rstudio/dygraphs/issues/139/comments","statuses_url":"https://api.github.com/repos/rstudio/dygraphs/statuses/bc22499538608c08adb839fc8fd1b5a54df29b2f","head":{"label":"pshevtsov:custom-plotters","ref":"custom-plotters","sha":"bc22499538608c08adb839fc8fd1b5a54df29b2f","user":{"login":"pshevtsov","id":290451,"avatar_url":"https://avatars.githubusercontent.com/u/290451?v=3","gravatar_id":"","url":"https://api.github.com/users/pshevtsov","html_url":"https://github.com/pshevtsov","followers_url":"https://api.github.com/users/pshevtsov/followers","following_url":"https://api.github.com/users/pshevtsov/following{/other_user}","gists_url":"https://api.github.com/users/pshevtsov/gists{/gist_id}","starred_url":"https://api.github.com/users/pshevtsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pshevtsov/subscriptions","organizations_url":"https://api.github.com/users/pshevtsov/orgs","repos_url":"https://api.github.com/users/pshevtsov/repos","events_url":"https://api.github.com/users/pshevtsov/events{/privacy}","received_events_url":"https://api.github.com/users/pshevtsov/received_events","type":"User","site_admin":false},"repo":{"id":41304435,"name":"rstudio-dygraphs","full_name":"pshevtsov/rstudio-dygraphs","owner":{"login":"pshevtsov","id":290451,"avatar_url":"https://avatars.githubusercontent.com/u/290451?v=3","gravatar_id":"","url":"https://api.github.com/users/pshevtsov","html_url":"https://github.com/pshevtsov","followers_url":"https://api.github.com/users/pshevtsov/followers","following_url":"https://api.github.com/users/pshevtsov/following{/other_user}","gists_url":"https://api.github.com/users/pshevtsov/gists{/gist_id}","starred_url":"https://api.github.com/users/pshevtsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pshevtsov/subscriptions","organizations_url":"https://api.github.com/users/pshevtsov/orgs","repos_url":"https://api.github.com/users/pshevtsov/repos","events_url":"https://api.github.com/users/pshevtsov/events{/privacy}","received_events_url":"https://api.github.com/users/pshevtsov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pshevtsov/rstudio-dygraphs","description":"R interface to dygraphs","fork":true,"url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs","forks_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/forks","keys_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/teams","hooks_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/hooks","issue_events_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/issues/events{/number}","events_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/events","assignees_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/assignees{/user}","branches_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/branches{/branch}","tags_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/tags","blobs_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/git/refs{/sha}","trees_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/statuses/{sha}","languages_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/languages","stargazers_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/stargazers","contributors_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/contributors","subscribers_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/subscribers","subscription_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/subscription","commits_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/commits{/sha}","git_commits_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/git/commits{/sha}","comments_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/comments{/number}","issue_comment_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/issues/comments{/number}","contents_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/contents/{+path}","compare_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/merges","archive_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/downloads","issues_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/issues{/number}","pulls_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/pulls{/number}","milestones_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/milestones{/number}","notifications_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/labels{/name}","releases_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/releases{/id}","deployments_url":"https://api.github.com/repos/pshevtsov/rstudio-dygraphs/deployments","created_at":"2015-08-24T13:24:54Z","updated_at":"2016-11-02T19:25:50Z","pushed_at":"2016-11-03T10:54:55Z","git_url":"git://github.com/pshevtsov/rstudio-dygraphs.git","ssh_url":"git@github.com:pshevtsov/rstudio-dygraphs.git","clone_url":"https://github.com/pshevtsov/rstudio-dygraphs.git","svn_url":"https://github.com/pshevtsov/rstudio-dygraphs","homepage":"http://rstudio.github.io/dygraphs","size":15802,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rstudio:master","ref":"master","sha":"880e9b12a670e8d489552460927915be70018fa3","user":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"repo":{"id":22991378,"name":"dygraphs","full_name":"rstudio/dygraphs","owner":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rstudio/dygraphs","description":"R interface to dygraphs","fork":false,"url":"https://api.github.com/repos/rstudio/dygraphs","forks_url":"https://api.github.com/repos/rstudio/dygraphs/forks","keys_url":"https://api.github.com/repos/rstudio/dygraphs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rstudio/dygraphs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rstudio/dygraphs/teams","hooks_url":"https://api.github.com/repos/rstudio/dygraphs/hooks","issue_events_url":"https://api.github.com/repos/rstudio/dygraphs/issues/events{/number}","events_url":"https://api.github.com/repos/rstudio/dygraphs/events","assignees_url":"https://api.github.com/repos/rstudio/dygraphs/assignees{/user}","branches_url":"https://api.github.com/repos/rstudio/dygraphs/branches{/branch}","tags_url":"https://api.github.com/repos/rstudio/dygraphs/tags","blobs_url":"https://api.github.com/repos/rstudio/dygraphs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rstudio/dygraphs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rstudio/dygraphs/git/refs{/sha}","trees_url":"https://api.github.com/repos/rstudio/dygraphs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rstudio/dygraphs/statuses/{sha}","languages_url":"https://api.github.com/repos/rstudio/dygraphs/languages","stargazers_url":"https://api.github.com/repos/rstudio/dygraphs/stargazers","contributors_url":"https://api.github.com/repos/rstudio/dygraphs/contributors","subscribers_url":"https://api.github.com/repos/rstudio/dygraphs/subscribers","subscription_url":"https://api.github.com/repos/rstudio/dygraphs/subscription","commits_url":"https://api.github.com/repos/rstudio/dygraphs/commits{/sha}","git_commits_url":"https://api.github.com/repos/rstudio/dygraphs/git/commits{/sha}","comments_url":"https://api.github.com/repos/rstudio/dygraphs/comments{/number}","issue_comment_url":"https://api.github.com/repos/rstudio/dygraphs/issues/comments{/number}","contents_url":"https://api.github.com/repos/rstudio/dygraphs/contents/{+path}","compare_url":"https://api.github.com/repos/rstudio/dygraphs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rstudio/dygraphs/merges","archive_url":"https://api.github.com/repos/rstudio/dygraphs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rstudio/dygraphs/downloads","issues_url":"https://api.github.com/repos/rstudio/dygraphs/issues{/number}","pulls_url":"https://api.github.com/repos/rstudio/dygraphs/pulls{/number}","milestones_url":"https://api.github.com/repos/rstudio/dygraphs/milestones{/number}","notifications_url":"https://api.github.com/repos/rstudio/dygraphs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rstudio/dygraphs/labels{/name}","releases_url":"https://api.github.com/repos/rstudio/dygraphs/releases{/id}","deployments_url":"https://api.github.com/repos/rstudio/dygraphs/deployments","created_at":"2014-08-15T14:03:15Z","updated_at":"2016-10-31T03:23:09Z","pushed_at":"2016-11-03T10:54:55Z","git_url":"git://github.com/rstudio/dygraphs.git","ssh_url":"git@github.com:rstudio/dygraphs.git","clone_url":"https://github.com/rstudio/dygraphs.git","svn_url":"https://github.com/rstudio/dygraphs","homepage":"http://rstudio.github.io/dygraphs","size":36981,"stargazers_count":168,"watchers_count":168,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":81,"mirror_url":null,"open_issues_count":57,"forks":81,"open_issues":57,"watchers":168,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rstudio/dygraphs/pulls/139"},"html":{"href":"https://github.com/rstudio/dygraphs/pull/139"},"issue":{"href":"https://api.github.com/repos/rstudio/dygraphs/issues/139"},"comments":{"href":"https://api.github.com/repos/rstudio/dygraphs/issues/139/comments"},"review_comments":{"href":"https://api.github.com/repos/rstudio/dygraphs/pulls/139/comments"},"review_comment":{"href":"https://api.github.com/repos/rstudio/dygraphs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rstudio/dygraphs/pulls/139/commits"},"statuses":{"href":"https://api.github.com/repos/rstudio/dygraphs/statuses/bc22499538608c08adb839fc8fd1b5a54df29b2f"}}}}
{"actor":{"display_login":"jjallaire"}}