{"url":"https://api.github.com/gists/1123639","forks_url":"https://api.github.com/gists/1123639/forks","commits_url":"https://api.github.com/gists/1123639/commits","id":"1123639","node_id":"MDQ6R2lzdDExMjM2Mzk=","git_pull_url":"https://gist.github.com/1123639.git","git_push_url":"https://gist.github.com/1123639.git","html_url":"https://gist.github.com/mbostock/1123639","files":{".block":{"filename":".block","type":"text/plain","language":null,"raw_url":"https://gist.githubusercontent.com/mbostock/1123639/raw/703d310b399098a243a76a50bc209167e924cfd2/.block","size":17,"truncated":false,"content":"license: gpl-3.0\n","encoding":"utf-8"},"README.md":{"filename":"README.md","type":"text/markdown","language":"Markdown","raw_url":"https://gist.githubusercontent.com/mbostock/1123639/raw/f55ab7218f3f710c847fccc95714cd76e7836697/README.md","size":424,"truncated":false,"content":"Inspired by this [Paper.js](http://paperjs.org/examples/rounded-rectangles/) example, this demonstrates animated rounded rectangles (`svg:rect` elements with \"rx\" and \"ry\" attributes). The data associated with each rectangle is its center position and rotation angle in degrees. Each tick of the animation, the rectangles drift towards the mouse location and rotate slightly. Built with [D3.js](http://d3js.org/) using SVG.\n","encoding":"utf-8"},"index.html":{"filename":"index.html","type":"text/html","language":"HTML","raw_url":"https://gist.githubusercontent.com/mbostock/1123639/raw/9d57da2a162c91f004ea1fd8ef31ed2c9cd939b7/index.html","size":1091,"truncated":false,"content":"<!DOCTYPE html>\n<meta charset=\"utf-8\">\n<body>\n<script src=\"//d3js.org/d3.v3.min.js\"></script>\n<script>\n\nvar mouse = [480, 250],\n    count = 0;\n\nvar svg = d3.select(\"body\").append(\"svg\")\n    .attr(\"width\", 960)\n    .attr(\"height\", 500);\n\nvar g = svg.selectAll(\"g\")\n    .data(d3.range(25))\n  .enter().append(\"g\")\n    .attr(\"transform\", \"translate(\" + mouse + \")\");\n\ng.append(\"rect\")\n    .attr(\"rx\", 6)\n    .attr(\"ry\", 6)\n    .attr(\"x\", -12.5)\n    .attr(\"y\", -12.5)\n    .attr(\"width\", 25)\n    .attr(\"height\", 25)\n    .attr(\"transform\", function(d, i) { return \"scale(\" + (1 - d / 25) * 20 + \")\"; })\n    .style(\"fill\", d3.scale.category20c());\n\ng.datum(function(d) {\n  return {center: mouse.slice(), angle: 0};\n});\n\nsvg.on(\"mousemove\", function() {\n  mouse = d3.mouse(this);\n});\n\nd3.timer(function() {\n  count++;\n  g.attr(\"transform\", function(d, i) {\n    d.center[0] += (mouse[0] - d.center[0]) / (i + 5);\n    d.center[1] += (mouse[1] - d.center[1]) / (i + 5);\n    d.angle += Math.sin((count + i) / 10) * 7;\n    return \"translate(\" + d.center + \")rotate(\" + d.angle + \")\";\n  });\n});\n\n</script>\n","encoding":"utf-8"}},"public":true,"created_at":"2011-08-03T20:10:33Z","updated_at":"2023-01-08T12:27:12Z","description":"Rounded Rectangles","comments":3,"user":null,"comments_enabled":true,"comments_url":"https://api.github.com/gists/1123639/comments","owner":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars.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","user_view_type":"public","site_admin":false},"forks":[{"url":"https://api.github.com/gists/1589901","user":{"login":"slide064","id":1318991,"node_id":"MDQ6VXNlcjEzMTg5OTE=","avatar_url":"https://avatars.githubusercontent.com/u/1318991?v=4","gravatar_id":"","url":"https://api.github.com/users/slide064","html_url":"https://github.com/slide064","followers_url":"https://api.github.com/users/slide064/followers","following_url":"https://api.github.com/users/slide064/following{/other_user}","gists_url":"https://api.github.com/users/slide064/gists{/gist_id}","starred_url":"https://api.github.com/users/slide064/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slide064/subscriptions","organizations_url":"https://api.github.com/users/slide064/orgs","repos_url":"https://api.github.com/users/slide064/repos","events_url":"https://api.github.com/users/slide064/events{/privacy}","received_events_url":"https://api.github.com/users/slide064/received_events","type":"User","user_view_type":"public","site_admin":false,"name":"Travis","company":null,"blog":"","location":"Seattle, WA","email":null,"hireable":null,"bio":"I should be outside","twitter_username":null,"public_repos":2,"public_gists":1,"followers":0,"following":0,"created_at":"2012-01-10T16:33:17Z","updated_at":"2026-04-14T16:26:46Z"},"id":"1589901","created_at":"2012-01-10T16:33:44Z","updated_at":"2025-11-21T02:55:56Z"},{"url":"https://api.github.com/gists/2990659","user":{"login":"wbzyl","id":8049,"node_id":"MDQ6VXNlcjgwNDk=","avatar_url":"https://avatars.githubusercontent.com/u/8049?v=4","gravatar_id":"","url":"https://api.github.com/users/wbzyl","html_url":"https://github.com/wbzyl","followers_url":"https://api.github.com/users/wbzyl/followers","following_url":"https://api.github.com/users/wbzyl/following{/other_user}","gists_url":"https://api.github.com/users/wbzyl/gists{/gist_id}","starred_url":"https://api.github.com/users/wbzyl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbzyl/subscriptions","organizations_url":"https://api.github.com/users/wbzyl/orgs","repos_url":"https://api.github.com/users/wbzyl/repos","events_url":"https://api.github.com/users/wbzyl/events{/privacy}","received_events_url":"https://api.github.com/users/wbzyl/received_events","type":"User","user_view_type":"public","site_admin":false,"name":"Wlodek Bzyl","company":null,"blog":"","location":"Poland","email":null,"hireable":null,"bio":null,"twitter_username":null,"public_repos":54,"public_gists":87,"followers":253,"following":1,"created_at":"2008-04-21T08:24:47Z","updated_at":"2026-04-17T11:25:46Z"},"id":"2990659","created_at":"2012-06-25T19:17:42Z","updated_at":"2015-10-06T11:58:38Z"},{"url":"https://api.github.com/gists/5891126","user":{"login":"paulmdx","id":1071838,"node_id":"MDQ6VXNlcjEwNzE4Mzg=","avatar_url":"https://avatars.githubusercontent.com/u/1071838?v=4","gravatar_id":"","url":"https://api.github.com/users/paulmdx","html_url":"https://github.com/paulmdx","followers_url":"https://api.github.com/users/paulmdx/followers","following_url":"https://api.github.com/users/paulmdx/following{/other_user}","gists_url":"https://api.github.com/users/paulmdx/gists{/gist_id}","starred_url":"https://api.github.com/users/paulmdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulmdx/subscriptions","organizations_url":"https://api.github.com/users/paulmdx/orgs","repos_url":"https://api.github.com/users/paulmdx/repos","events_url":"https://api.github.com/users/paulmdx/events{/privacy}","received_events_url":"https://api.github.com/users/paulmdx/received_events","type":"User","user_view_type":"public","site_admin":false,"name":"Paul M","company":"Metafused Ltd","blog":"","location":"UK","email":null,"hireable":true,"bio":null,"twitter_username":null,"public_repos":3,"public_gists":10,"followers":0,"following":0,"created_at":"2011-09-22T18:00:09Z","updated_at":"2017-02-20T05:44:22Z"},"id":"5891126","created_at":"2013-06-29T13:37:11Z","updated_at":"2015-12-19T03:38:51Z"},{"url":"https://api.github.com/gists/32845e181cf3ab28ff77","user":{"login":"balint42","id":5834462,"node_id":"MDQ6VXNlcjU4MzQ0NjI=","avatar_url":"https://avatars.githubusercontent.com/u/5834462?v=4","gravatar_id":"","url":"https://api.github.com/users/balint42","html_url":"https://github.com/balint42","followers_url":"https://api.github.com/users/balint42/followers","following_url":"https://api.github.com/users/balint42/following{/other_user}","gists_url":"https://api.github.com/users/balint42/gists{/gist_id}","starred_url":"https://api.github.com/users/balint42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balint42/subscriptions","organizations_url":"https://api.github.com/users/balint42/orgs","repos_url":"https://api.github.com/users/balint42/repos","events_url":"https://api.github.com/users/balint42/events{/privacy}","received_events_url":"https://api.github.com/users/balint42/received_events","type":"User","user_view_type":"public","site_admin":false,"name":"Balint Morvai","company":null,"blog":"","location":null,"email":null,"hireable":true,"bio":null,"twitter_username":null,"public_repos":16,"public_gists":10,"followers":19,"following":2,"created_at":"2013-11-01T21:23:16Z","updated_at":"2026-03-03T23:16:33Z"},"id":"32845e181cf3ab28ff77","created_at":"2015-02-05T17:25:47Z","updated_at":"2016-05-17T23:01:20Z"},{"url":"https://api.github.com/gists/3705c81801ae8dd7f56010232460973e","user":{"login":"elcarer","id":67580084,"node_id":"MDQ6VXNlcjY3NTgwMDg0","avatar_url":"https://avatars.githubusercontent.com/u/67580084?v=4","gravatar_id":"","url":"https://api.github.com/users/elcarer","html_url":"https://github.com/elcarer","followers_url":"https://api.github.com/users/elcarer/followers","following_url":"https://api.github.com/users/elcarer/following{/other_user}","gists_url":"https://api.github.com/users/elcarer/gists{/gist_id}","starred_url":"https://api.github.com/users/elcarer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elcarer/subscriptions","organizations_url":"https://api.github.com/users/elcarer/orgs","repos_url":"https://api.github.com/users/elcarer/repos","events_url":"https://api.github.com/users/elcarer/events{/privacy}","received_events_url":"https://api.github.com/users/elcarer/received_events","type":"User","user_view_type":"public","site_admin":false,"name":null,"company":null,"blog":"","location":null,"email":null,"hireable":null,"bio":null,"twitter_username":null,"public_repos":2,"public_gists":1,"followers":0,"following":0,"created_at":"2020-06-29T08:10:58Z","updated_at":"2026-04-16T12:55:08Z"},"id":"3705c81801ae8dd7f56010232460973e","created_at":"2023-01-08T12:27:12Z","updated_at":"2023-01-08T12:27:12Z"}],"history":[{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars.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","user_view_type":"public","site_admin":false},"version":"bd58fb70753da4d7e538f3ab20ee6c0537f94010","committed_at":"2016-02-09T00:22:50Z","change_status":{"total":1,"additions":1,"deletions":0},"url":"https://api.github.com/gists/1123639/bd58fb70753da4d7e538f3ab20ee6c0537f94010"},{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars.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","user_view_type":"public","site_admin":false},"version":"3cb63a414f69cd6c379cf95c8451bd886b86046a","committed_at":"2015-11-17T20:08:58Z","change_status":{"total":4,"additions":2,"deletions":2},"url":"https://api.github.com/gists/1123639/3cb63a414f69cd6c379cf95c8451bd886b86046a"},{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars.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","user_view_type":"public","site_admin":false},"version":"657072b31020e58beee8eaf63fa8b80ab95c4cd4","committed_at":"2015-10-30T21:31:33Z","change_status":{"total":2,"additions":1,"deletions":1},"url":"https://api.github.com/gists/1123639/657072b31020e58beee8eaf63fa8b80ab95c4cd4"},{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars.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","user_view_type":"public","site_admin":false},"version":"8d677bbe18fb4795213c58f8153c6f348c862112","committed_at":"2015-06-11T19:42:30Z","change_status":{"total":2,"additions":1,"deletions":1},"url":"https://api.github.com/gists/1123639/8d677bbe18fb4795213c58f8153c6f348c862112"},{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars.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","user_view_type":"public","site_admin":false},"version":"67c7c7a7c4b1c049f1215ed75a7365f6527fa567","committed_at":"2013-11-20T22:22:30Z","change_status":{"total":2,"additions":1,"deletions":1},"url":"https://api.github.com/gists/1123639/67c7c7a7c4b1c049f1215ed75a7365f6527fa567"},{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars.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","user_view_type":"public","site_admin":false},"version":"e7ee6c9a4b1eb7e2eb0b6467bfba3222c8ba449b","committed_at":"2013-11-20T22:20:48Z","change_status":{"total":22,"additions":9,"deletions":13},"url":"https://api.github.com/gists/1123639/e7ee6c9a4b1eb7e2eb0b6467bfba3222c8ba449b"},{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars.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","user_view_type":"public","site_admin":false},"version":"e7b2a5de6bc6f1a8841b51452a65826b840bacd7","committed_at":"2011-08-04T18:51:20Z","change_status":{"total":6,"additions":1,"deletions":5},"url":"https://api.github.com/gists/1123639/e7b2a5de6bc6f1a8841b51452a65826b840bacd7"},{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars.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","user_view_type":"public","site_admin":false},"version":"431f3f472b58aa067b3ff332a77eae1c5d07daed","committed_at":"2011-08-03T21:17:05Z","change_status":{"total":2,"additions":1,"deletions":1},"url":"https://api.github.com/gists/1123639/431f3f472b58aa067b3ff332a77eae1c5d07daed"},{"user":{"login":"mbostock","id":230541,"node_id":"MDQ6VXNlcjIzMDU0MQ==","avatar_url":"https://avatars.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","user_view_type":"public","site_admin":false},"version":"5c167189d8955aa82da7339a9a694602a353e94a","committed_at":"2011-08-03T20:10:34Z","change_status":{"total":56,"additions":56,"deletions":0},"url":"https://api.github.com/gists/1123639/5c167189d8955aa82da7339a9a694602a353e94a"}],"truncated":false}