{"url":"https://api.github.com/gists/647888","forks_url":"https://api.github.com/gists/647888/forks","commits_url":"https://api.github.com/gists/647888/commits","id":"647888","node_id":"MDQ6R2lzdDY0Nzg4OA==","git_pull_url":"https://gist.github.com/647888.git","git_push_url":"https://gist.github.com/647888.git","html_url":"https://gist.github.com/647888","files":{".block":{"filename":".block","type":"text/plain","language":null,"raw_url":"https://gist.githubusercontent.com/mbostock/647888/raw/703d310b399098a243a76a50bc209167e924cfd2/.block","size":17,"truncated":false,"content":"license: gpl-3.0\n"},"canvas.js":{"filename":"canvas.js","type":"application/javascript","language":"JavaScript","raw_url":"https://gist.githubusercontent.com/mbostock/647888/raw/84709ca1fdcad5f6d1d3f59d8d1451d2f1c55325/canvas.js","size":1266,"truncated":false,"content":"(function() {\n var po = org.polymaps;\n\n po.canvas = function() {\n var canvas = po.layer(load, unload),\n image = po.svg(\"image\"), // dummy image\n url;\n\n function load(tile) {\n var size = canvas.map().tileSize(),\n o = tile.element = po.svg(\"foreignObject\"),\n c = o.appendChild(document.createElement(\"canvas\")),\n w = size.x,\n h = size.y;\n\n o.setAttribute(\"width\", w);\n o.setAttribute(\"height\", h);\n c.setAttribute(\"width\", w);\n c.setAttribute(\"height\", h);\n\n tile.request = po.queue.image(image, url(tile), function(img) {\n var g = c.getContext(\"2d\"),\n d = g.createImageData(w, h),\n e;\n delete tile.request;\n tile.ready = true;\n g.drawImage(img, 0, 0);\n e = g.getImageData(0, 0, w, h);\n for (var i = 0, n = w * h * 4; i < n; i++) d.data[i] = e.data[i] / 2; // e.g.\n g.putImageData(d, 0, 0);\n canvas.dispatch({type: \"load\", tile: tile});\n });\n }\n\n function unload(tile) {\n if (tile.request) tile.request.abort(true);\n }\n\n canvas.url = function(x) {\n if (!arguments.length) return url;\n url = po.url(x);\n return canvas.reload();\n };\n\n return canvas;\n };\n})();\n"},"index.html":{"filename":"index.html","type":"text/html","language":"HTML","raw_url":"https://gist.githubusercontent.com/mbostock/647888/raw/6f89804d03cd225bca01a740948c483c32753cfd/index.html","size":690,"truncated":false,"content":"\n\n \n \n \n \n \n \n \n \n\n"}},"public":true,"created_at":"2010-10-26T21:47:25Z","updated_at":"2016-02-08T23:23:07Z","description":"Image Processing","comments":1,"user":null,"comments_url":"https://api.github.com/gists/647888/comments","owner":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/230541?v=4","gravatar_id":"","url":"https://api.github.com/users/mbostock","html_url":"https://github.com/mbostock","followers_url":"https://api.github.com/users/mbostock/followers","following_url":"https://api.github.com/users/mbostock/following{/other_user}","gists_url":"https://api.github.com/users/mbostock/gists{/gist_id}","starred_url":"https://api.github.com/users/mbostock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbostock/subscriptions","organizations_url":"https://api.github.com/users/mbostock/orgs","repos_url":"https://api.github.com/users/mbostock/repos","events_url":"https://api.github.com/users/mbostock/events{/privacy}","received_events_url":"https://api.github.com/users/mbostock/received_events","type":"User","site_admin":false},"forks":[{"url":"https://api.github.com/gists/6236851","user":{"login":"enjoylife","id":877194,"node_id":"MDQ6VXNlcjg3NzE5NA==","avatar_url":"https://avatars3.githubusercontent.com/u/877194?v=4","gravatar_id":"","url":"https://api.github.com/users/enjoylife","html_url":"https://github.com/enjoylife","followers_url":"https://api.github.com/users/enjoylife/followers","following_url":"https://api.github.com/users/enjoylife/following{/other_user}","gists_url":"https://api.github.com/users/enjoylife/gists{/gist_id}","starred_url":"https://api.github.com/users/enjoylife/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enjoylife/subscriptions","organizations_url":"https://api.github.com/users/enjoylife/orgs","repos_url":"https://api.github.com/users/enjoylife/repos","events_url":"https://api.github.com/users/enjoylife/events{/privacy}","received_events_url":"https://api.github.com/users/enjoylife/received_events","type":"User","site_admin":false},"id":"6236851","created_at":"2013-08-14T23:31:15Z","updated_at":"2015-12-21T02:39:18Z"}],"history":[{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/230541?v=4","gravatar_id":"","url":"https://api.github.com/users/mbostock","html_url":"https://github.com/mbostock","followers_url":"https://api.github.com/users/mbostock/followers","following_url":"https://api.github.com/users/mbostock/following{/other_user}","gists_url":"https://api.github.com/users/mbostock/gists{/gist_id}","starred_url":"https://api.github.com/users/mbostock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbostock/subscriptions","organizations_url":"https://api.github.com/users/mbostock/orgs","repos_url":"https://api.github.com/users/mbostock/repos","events_url":"https://api.github.com/users/mbostock/events{/privacy}","received_events_url":"https://api.github.com/users/mbostock/received_events","type":"User","site_admin":false},"version":"1b1a3d052856d9be0f0db9be767c609d23bd5f2d","committed_at":"2016-02-08T23:23:01Z","change_status":{"total":1,"additions":1,"deletions":0},"url":"https://api.github.com/gists/647888/1b1a3d052856d9be0f0db9be767c609d23bd5f2d"},{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/230541?v=4","gravatar_id":"","url":"https://api.github.com/users/mbostock","html_url":"https://github.com/mbostock","followers_url":"https://api.github.com/users/mbostock/followers","following_url":"https://api.github.com/users/mbostock/following{/other_user}","gists_url":"https://api.github.com/users/mbostock/gists{/gist_id}","starred_url":"https://api.github.com/users/mbostock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbostock/subscriptions","organizations_url":"https://api.github.com/users/mbostock/orgs","repos_url":"https://api.github.com/users/mbostock/repos","events_url":"https://api.github.com/users/mbostock/events{/privacy}","received_events_url":"https://api.github.com/users/mbostock/received_events","type":"User","site_admin":false},"version":"71bcee8c4d91dad21851a5dbda8c0b6455f41e21","committed_at":"2016-02-08T23:22:58Z","change_status":{"total":4,"additions":2,"deletions":2},"url":"https://api.github.com/gists/647888/71bcee8c4d91dad21851a5dbda8c0b6455f41e21"},{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/230541?v=4","gravatar_id":"","url":"https://api.github.com/users/mbostock","html_url":"https://github.com/mbostock","followers_url":"https://api.github.com/users/mbostock/followers","following_url":"https://api.github.com/users/mbostock/following{/other_user}","gists_url":"https://api.github.com/users/mbostock/gists{/gist_id}","starred_url":"https://api.github.com/users/mbostock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbostock/subscriptions","organizations_url":"https://api.github.com/users/mbostock/orgs","repos_url":"https://api.github.com/users/mbostock/repos","events_url":"https://api.github.com/users/mbostock/events{/privacy}","received_events_url":"https://api.github.com/users/mbostock/received_events","type":"User","site_admin":false},"version":"fa406b4cf66464b783787be80155acb4621c056c","committed_at":"2010-10-26T21:49:29Z","change_status":{"total":3,"additions":0,"deletions":3},"url":"https://api.github.com/gists/647888/fa406b4cf66464b783787be80155acb4621c056c"},{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/230541?v=4","gravatar_id":"","url":"https://api.github.com/users/mbostock","html_url":"https://github.com/mbostock","followers_url":"https://api.github.com/users/mbostock/followers","following_url":"https://api.github.com/users/mbostock/following{/other_user}","gists_url":"https://api.github.com/users/mbostock/gists{/gist_id}","starred_url":"https://api.github.com/users/mbostock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbostock/subscriptions","organizations_url":"https://api.github.com/users/mbostock/orgs","repos_url":"https://api.github.com/users/mbostock/repos","events_url":"https://api.github.com/users/mbostock/events{/privacy}","received_events_url":"https://api.github.com/users/mbostock/received_events","type":"User","site_admin":false},"version":"bde1eaa027ca4290fc899c6db888ccfcf90e07ea","committed_at":"2010-10-26T21:49:01Z","change_status":{"total":4,"additions":2,"deletions":2},"url":"https://api.github.com/gists/647888/bde1eaa027ca4290fc899c6db888ccfcf90e07ea"},{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/230541?v=4","gravatar_id":"","url":"https://api.github.com/users/mbostock","html_url":"https://github.com/mbostock","followers_url":"https://api.github.com/users/mbostock/followers","following_url":"https://api.github.com/users/mbostock/following{/other_user}","gists_url":"https://api.github.com/users/mbostock/gists{/gist_id}","starred_url":"https://api.github.com/users/mbostock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbostock/subscriptions","organizations_url":"https://api.github.com/users/mbostock/orgs","repos_url":"https://api.github.com/users/mbostock/repos","events_url":"https://api.github.com/users/mbostock/events{/privacy}","received_events_url":"https://api.github.com/users/mbostock/received_events","type":"User","site_admin":false},"version":"dfe72556e953bef7581194b55e3bb876e3b36168","committed_at":"2010-10-26T21:48:40Z","change_status":{"total":2,"additions":1,"deletions":1},"url":"https://api.github.com/gists/647888/dfe72556e953bef7581194b55e3bb876e3b36168"},{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/230541?v=4","gravatar_id":"","url":"https://api.github.com/users/mbostock","html_url":"https://github.com/mbostock","followers_url":"https://api.github.com/users/mbostock/followers","following_url":"https://api.github.com/users/mbostock/following{/other_user}","gists_url":"https://api.github.com/users/mbostock/gists{/gist_id}","starred_url":"https://api.github.com/users/mbostock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbostock/subscriptions","organizations_url":"https://api.github.com/users/mbostock/orgs","repos_url":"https://api.github.com/users/mbostock/repos","events_url":"https://api.github.com/users/mbostock/events{/privacy}","received_events_url":"https://api.github.com/users/mbostock/received_events","type":"User","site_admin":false},"version":"4520725a1365f34876b70d3a4098bb0698a8363b","committed_at":"2010-10-26T21:48:03Z","change_status":{"total":1,"additions":1,"deletions":0},"url":"https://api.github.com/gists/647888/4520725a1365f34876b70d3a4098bb0698a8363b"},{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/230541?v=4","gravatar_id":"","url":"https://api.github.com/users/mbostock","html_url":"https://github.com/mbostock","followers_url":"https://api.github.com/users/mbostock/followers","following_url":"https://api.github.com/users/mbostock/following{/other_user}","gists_url":"https://api.github.com/users/mbostock/gists{/gist_id}","starred_url":"https://api.github.com/users/mbostock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbostock/subscriptions","organizations_url":"https://api.github.com/users/mbostock/orgs","repos_url":"https://api.github.com/users/mbostock/repos","events_url":"https://api.github.com/users/mbostock/events{/privacy}","received_events_url":"https://api.github.com/users/mbostock/received_events","type":"User","site_admin":false},"version":"24f164ae77e78958d2097f80ac33dbd94f6fb023","committed_at":"2010-10-26T21:47:25Z","change_status":{"total":79,"additions":79,"deletions":0},"url":"https://api.github.com/gists/647888/24f164ae77e78958d2097f80ac33dbd94f6fb023"}],"truncated":false}