{"action":"created","issue":{"url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/83","labels_url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/83/comments","events_url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/83/events","html_url":"https://github.com/ramnathv/htmlwidgets/pull/83","id":58109706,"number":83,"title":"Easier specification of external file dependencies","user":{"login":"ramnathv","id":346288,"avatar_url":"https://avatars.githubusercontent.com/u/346288?v=3","gravatar_id":"","url":"https://api.github.com/users/ramnathv","html_url":"https://github.com/ramnathv","followers_url":"https://api.github.com/users/ramnathv/followers","following_url":"https://api.github.com/users/ramnathv/following{/other_user}","gists_url":"https://api.github.com/users/ramnathv/gists{/gist_id}","starred_url":"https://api.github.com/users/ramnathv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramnathv/subscriptions","organizations_url":"https://api.github.com/users/ramnathv/orgs","repos_url":"https://api.github.com/users/ramnathv/repos","events_url":"https://api.github.com/users/ramnathv/events{/privacy}","received_events_url":"https://api.github.com/users/ramnathv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-18T18:45:38Z","updated_at":"2015-05-28T05:45:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ramnathv/htmlwidgets/pulls/83","html_url":"https://github.com/ramnathv/htmlwidgets/pull/83","diff_url":"https://github.com/ramnathv/htmlwidgets/pull/83.diff","patch_url":"https://github.com/ramnathv/htmlwidgets/pull/83.patch"},"body":"This PR makes it easy for package developers and users to specify file dependencies for their widgets. Here is an example:\r\n\r\n```r\r\n# install_github('htmlwidgets/datamaps')\r\nlibrary(datamaps)\r\ndatamaps(\r\n  scope = 'pcs',\r\n  geographyConfig = list(dataUrl = htmlwidgets:::attachment(\"data/pcs.json\"))\r\n)\r\n```\r\n\r\nIt uses a similar mechanism to the one used by the `JS` function to mark objects as javascript literals. The resolution of attachment urls is carried out using the `HTMLWidgets.getAttachmentUrl` function. \r\n\r\n@jcheng5 can you take a look at this whenever you have time. @jjallaire @timelyportfolio @yihui if you can test this functionality with any of your widgets and provide me with feedback/comments, that would be very useful.\r\n"},"comment":{"url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/comments/106184510","html_url":"https://github.com/ramnathv/htmlwidgets/pull/83#issuecomment-106184510","issue_url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/83","id":106184510,"user":{"login":"nsh87","id":4327717,"avatar_url":"https://avatars.githubusercontent.com/u/4327717?v=3","gravatar_id":"","url":"https://api.github.com/users/nsh87","html_url":"https://github.com/nsh87","followers_url":"https://api.github.com/users/nsh87/followers","following_url":"https://api.github.com/users/nsh87/following{/other_user}","gists_url":"https://api.github.com/users/nsh87/gists{/gist_id}","starred_url":"https://api.github.com/users/nsh87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsh87/subscriptions","organizations_url":"https://api.github.com/users/nsh87/orgs","repos_url":"https://api.github.com/users/nsh87/repos","events_url":"https://api.github.com/users/nsh87/events{/privacy}","received_events_url":"https://api.github.com/users/nsh87/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T05:45:11Z","updated_at":"2015-05-28T05:45:11Z","body":"This would be a most-welcome feature. I have been looking at [this issue](https://github.com/ramnathv/htmlwidgets/issues/71) in my attempt to attach a file dependency that gets created in one of my functions before `htmlwidgets::createWidget`. Thus far I have not been successful in  making the file accessible through the browser."}}