{"action":"created","comment":{"url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/pulls/comments/41899715","id":41899715,"diff_hunk":"@@ -0,0 +1,44 @@\n+<html>\n+  <script src=\"../d3/d3.js\"></script>\n+  <script src=\"../topojson/topojson.js\"></script>\n+  <script src=\"../d3-cloud/build/d3.layout.cloud.js\"></script>\n+  <script src=\"../vega/vega.min.js\"></script>\n+\n+  <dom-module id=\"vega-plot\">\n+    <template>\n+      <div id=\"plot\">\n+          <content></content>\n+      </div>\n+      <br>\n+      <a href=\"\" id=\"pnglink\" download>Save as PNG</a>\n+    </template>\n+    <script>\n+      Polymer({\n+        is: \"vega-plot\",\n+        properties: {\n+          json: {\n+            type: Object,\n+            notify: true,\n+            observer: 'render'\n+          }\n+        },\n+        render: function() {\n+          var self = this;\n+          vg.parse.spec(this.json, function (chart) {\n+            chart({el:(Polymer.dom(self.$.plot)).node}).update()\n+          });\n+          this.async(function (){\n+            this.saveAsPNG();","path":"assets/bower_components/vega-elements/vega-plot.html","position":31,"original_position":31,"commit_id":"fc11b10afe8a69d090e8e25823c4c2a10d42323a","original_commit_id":"fc11b10afe8a69d090e8e25823c4c2a10d42323a","user":{"login":"shashi","id":25916,"avatar_url":"https://avatars.githubusercontent.com/u/25916?v=3","gravatar_id":"","url":"https://api.github.com/users/shashi","html_url":"https://github.com/shashi","followers_url":"https://api.github.com/users/shashi/followers","following_url":"https://api.github.com/users/shashi/following{/other_user}","gists_url":"https://api.github.com/users/shashi/gists{/gist_id}","starred_url":"https://api.github.com/users/shashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shashi/subscriptions","organizations_url":"https://api.github.com/users/shashi/orgs","repos_url":"https://api.github.com/users/shashi/repos","events_url":"https://api.github.com/users/shashi/events{/privacy}","received_events_url":"https://api.github.com/users/shashi/received_events","type":"User","site_admin":false},"body":"can't this be something like `this.$.pnglink.addEventListener('click', function () { window.location = makeDataUri(); })`?\r\n\r\njust doing this on every update seems like an overkill...","created_at":"2015-10-13T17:45:25Z","updated_at":"2015-10-13T17:45:25Z","html_url":"https://github.com/johnmyleswhite/Vega.jl/pull/56#discussion_r41899715","pull_request_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/pulls/56","_links":{"self":{"href":"https://api.github.com/repos/johnmyleswhite/Vega.jl/pulls/comments/41899715"},"html":{"href":"https://github.com/johnmyleswhite/Vega.jl/pull/56#discussion_r41899715"},"pull_request":{"href":"https://api.github.com/repos/johnmyleswhite/Vega.jl/pulls/56"}}},"pull_request":{"url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/pulls/56","id":47455360,"html_url":"https://github.com/johnmyleswhite/Vega.jl/pull/56","diff_url":"https://github.com/johnmyleswhite/Vega.jl/pull/56.diff","patch_url":"https://github.com/johnmyleswhite/Vega.jl/pull/56.patch","issue_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/issues/56","number":56,"state":"closed","locked":false,"title":"Escher integration","user":{"login":"rohitvarkey","id":5669669,"avatar_url":"https://avatars.githubusercontent.com/u/5669669?v=3","gravatar_id":"","url":"https://api.github.com/users/rohitvarkey","html_url":"https://github.com/rohitvarkey","followers_url":"https://api.github.com/users/rohitvarkey/followers","following_url":"https://api.github.com/users/rohitvarkey/following{/other_user}","gists_url":"https://api.github.com/users/rohitvarkey/gists{/gist_id}","starred_url":"https://api.github.com/users/rohitvarkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohitvarkey/subscriptions","organizations_url":"https://api.github.com/users/rohitvarkey/orgs","repos_url":"https://api.github.com/users/rohitvarkey/repos","events_url":"https://api.github.com/users/rohitvarkey/events{/privacy}","received_events_url":"https://api.github.com/users/rohitvarkey/received_events","type":"User","site_admin":false},"body":"Escher integration for Vega.\r\n\r\nI've added asset files in `assets` folder. We can just do `bower update` to update the dependencies when needed.\r\n\r\nThis results in interactive features like\r\n```julia\r\nusing Vega\r\n\r\nfunction main(window)\r\n    push!(window.assets,(\"Vega\",\"vega-plot\"))\r\n    push!(window.assets,\"widgets\")\r\n    n = Input(4)\r\n    vbox(\r\n        slider(4:10) >>> n,\r\n        lift(n) do n\r\n            x = 1:n\r\n            y = rand(n)\r\n            barplot(x = x, y = y)\r\n        end\r\n    ) |> pad(2em)\r\nend\r\n```\r\n\r\nwhich would give something like\r\n\r\n![vega_escher](https://cloud.githubusercontent.com/assets/5669669/10436611/1a2260b6-7145-11e5-94fa-cf4cd2cdd60e.gif)\r\n","created_at":"2015-10-12T19:26:01Z","updated_at":"2015-10-13T17:45:25Z","closed_at":"2015-10-13T13:11:54Z","merged_at":"2015-10-13T13:11:54Z","merge_commit_sha":"223e2bd2834b965b852ebcc48f1a34c062c6537f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/pulls/56/commits","review_comments_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/pulls/56/comments","review_comment_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/issues/56/comments","statuses_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/statuses/fc11b10afe8a69d090e8e25823c4c2a10d42323a","head":{"label":"rohitvarkey:escher","ref":"escher","sha":"fc11b10afe8a69d090e8e25823c4c2a10d42323a","user":{"login":"rohitvarkey","id":5669669,"avatar_url":"https://avatars.githubusercontent.com/u/5669669?v=3","gravatar_id":"","url":"https://api.github.com/users/rohitvarkey","html_url":"https://github.com/rohitvarkey","followers_url":"https://api.github.com/users/rohitvarkey/followers","following_url":"https://api.github.com/users/rohitvarkey/following{/other_user}","gists_url":"https://api.github.com/users/rohitvarkey/gists{/gist_id}","starred_url":"https://api.github.com/users/rohitvarkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohitvarkey/subscriptions","organizations_url":"https://api.github.com/users/rohitvarkey/orgs","repos_url":"https://api.github.com/users/rohitvarkey/repos","events_url":"https://api.github.com/users/rohitvarkey/events{/privacy}","received_events_url":"https://api.github.com/users/rohitvarkey/received_events","type":"User","site_admin":false},"repo":{"id":44044373,"name":"Vega.jl","full_name":"rohitvarkey/Vega.jl","owner":{"login":"rohitvarkey","id":5669669,"avatar_url":"https://avatars.githubusercontent.com/u/5669669?v=3","gravatar_id":"","url":"https://api.github.com/users/rohitvarkey","html_url":"https://github.com/rohitvarkey","followers_url":"https://api.github.com/users/rohitvarkey/followers","following_url":"https://api.github.com/users/rohitvarkey/following{/other_user}","gists_url":"https://api.github.com/users/rohitvarkey/gists{/gist_id}","starred_url":"https://api.github.com/users/rohitvarkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohitvarkey/subscriptions","organizations_url":"https://api.github.com/users/rohitvarkey/orgs","repos_url":"https://api.github.com/users/rohitvarkey/repos","events_url":"https://api.github.com/users/rohitvarkey/events{/privacy}","received_events_url":"https://api.github.com/users/rohitvarkey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rohitvarkey/Vega.jl","description":"A Julia package for generating visualizations in Vega ","fork":true,"url":"https://api.github.com/repos/rohitvarkey/Vega.jl","forks_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/forks","keys_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/teams","hooks_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/hooks","issue_events_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/issues/events{/number}","events_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/events","assignees_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/assignees{/user}","branches_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/branches{/branch}","tags_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/tags","blobs_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/languages","stargazers_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/stargazers","contributors_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/contributors","subscribers_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/subscribers","subscription_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/subscription","commits_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/contents/{+path}","compare_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/merges","archive_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/downloads","issues_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/issues{/number}","pulls_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/labels{/name}","releases_url":"https://api.github.com/repos/rohitvarkey/Vega.jl/releases{/id}","created_at":"2015-10-11T08:18:40Z","updated_at":"2015-10-11T08:18:41Z","pushed_at":"2015-10-13T13:55:01Z","git_url":"git://github.com/rohitvarkey/Vega.jl.git","ssh_url":"git@github.com:rohitvarkey/Vega.jl.git","clone_url":"https://github.com/rohitvarkey/Vega.jl.git","svn_url":"https://github.com/rohitvarkey/Vega.jl","homepage":null,"size":5870,"stargazers_count":0,"watchers_count":0,"language":"Julia","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":"johnmyleswhite:master","ref":"master","sha":"45a245736c5648a1e950ea5ec21816554dc9ef85","user":{"login":"johnmyleswhite","id":22064,"avatar_url":"https://avatars.githubusercontent.com/u/22064?v=3","gravatar_id":"","url":"https://api.github.com/users/johnmyleswhite","html_url":"https://github.com/johnmyleswhite","followers_url":"https://api.github.com/users/johnmyleswhite/followers","following_url":"https://api.github.com/users/johnmyleswhite/following{/other_user}","gists_url":"https://api.github.com/users/johnmyleswhite/gists{/gist_id}","starred_url":"https://api.github.com/users/johnmyleswhite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnmyleswhite/subscriptions","organizations_url":"https://api.github.com/users/johnmyleswhite/orgs","repos_url":"https://api.github.com/users/johnmyleswhite/repos","events_url":"https://api.github.com/users/johnmyleswhite/events{/privacy}","received_events_url":"https://api.github.com/users/johnmyleswhite/received_events","type":"User","site_admin":false},"repo":{"id":10925780,"name":"Vega.jl","full_name":"johnmyleswhite/Vega.jl","owner":{"login":"johnmyleswhite","id":22064,"avatar_url":"https://avatars.githubusercontent.com/u/22064?v=3","gravatar_id":"","url":"https://api.github.com/users/johnmyleswhite","html_url":"https://github.com/johnmyleswhite","followers_url":"https://api.github.com/users/johnmyleswhite/followers","following_url":"https://api.github.com/users/johnmyleswhite/following{/other_user}","gists_url":"https://api.github.com/users/johnmyleswhite/gists{/gist_id}","starred_url":"https://api.github.com/users/johnmyleswhite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnmyleswhite/subscriptions","organizations_url":"https://api.github.com/users/johnmyleswhite/orgs","repos_url":"https://api.github.com/users/johnmyleswhite/repos","events_url":"https://api.github.com/users/johnmyleswhite/events{/privacy}","received_events_url":"https://api.github.com/users/johnmyleswhite/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/johnmyleswhite/Vega.jl","description":"A Julia package for generating visualizations in Vega ","fork":false,"url":"https://api.github.com/repos/johnmyleswhite/Vega.jl","forks_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/forks","keys_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/teams","hooks_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/hooks","issue_events_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/issues/events{/number}","events_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/events","assignees_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/assignees{/user}","branches_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/branches{/branch}","tags_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/tags","blobs_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/languages","stargazers_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/stargazers","contributors_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/contributors","subscribers_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/subscribers","subscription_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/subscription","commits_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/contents/{+path}","compare_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/merges","archive_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/downloads","issues_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/issues{/number}","pulls_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/labels{/name}","releases_url":"https://api.github.com/repos/johnmyleswhite/Vega.jl/releases{/id}","created_at":"2013-06-25T02:10:33Z","updated_at":"2015-10-13T13:43:07Z","pushed_at":"2015-10-13T14:57:08Z","git_url":"git://github.com/johnmyleswhite/Vega.jl.git","ssh_url":"git@github.com:johnmyleswhite/Vega.jl.git","clone_url":"https://github.com/johnmyleswhite/Vega.jl.git","svn_url":"https://github.com/johnmyleswhite/Vega.jl","homepage":null,"size":5870,"stargazers_count":35,"watchers_count":35,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":11,"forks":8,"open_issues":11,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/johnmyleswhite/Vega.jl/pulls/56"},"html":{"href":"https://github.com/johnmyleswhite/Vega.jl/pull/56"},"issue":{"href":"https://api.github.com/repos/johnmyleswhite/Vega.jl/issues/56"},"comments":{"href":"https://api.github.com/repos/johnmyleswhite/Vega.jl/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/johnmyleswhite/Vega.jl/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/johnmyleswhite/Vega.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/johnmyleswhite/Vega.jl/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/johnmyleswhite/Vega.jl/statuses/fc11b10afe8a69d090e8e25823c4c2a10d42323a"}}}}