{"url":"https://api.github.com/gists/3145795","forks_url":"https://api.github.com/gists/3145795/forks","commits_url":"https://api.github.com/gists/3145795/commits","id":"3145795","node_id":"MDQ6R2lzdDMxNDU3OTU=","git_pull_url":"https://gist.github.com/3145795.git","git_push_url":"https://gist.github.com/3145795.git","html_url":"https://gist.github.com/mbostock/3145795","files":{".block":{"filename":".block","type":"text/plain","language":null,"raw_url":"https://gist.githubusercontent.com/mbostock/3145795/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/3145795/raw/af1e88b708551bec3b6481567ad996c531ed1c76/README.md","size":407,"truncated":false,"content":"This example demonstrates mirroring an easing function such that the transition returns to its starting point upon completion. The `mirror` function takes an easing function as input (or the name of an easing function, such as “cubic”) and returns a mirrored easing function; the mirrored function reaches the transition destination at *t* = 0.5, and then returns to the transition origin at *t* = 1.0.\n","encoding":"utf-8"},"index.html":{"filename":"index.html","type":"text/html","language":"HTML","raw_url":"https://gist.githubusercontent.com/mbostock/3145795/raw/bdc71a80e3653f660fcc4a0e180ae662b240fcd6/index.html","size":688,"truncated":false,"content":"<!DOCTYPE html>\n<meta charset=\"utf-8\">\n<style>\n\nh1 {\n  background: white;\n  display: block;\n  font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n  line-height: 500px;\n  margin: auto;\n  text-align: center;\n}\n\n</style>\n<h1>CLICK HERE</h1>\n<script src=\"//d3js.org/d3.v3.min.js\"></script>\n<script>\n\nd3.select(\"h1\").on(\"click\", function() {\n  d3.select(this)\n      .style(\"background\", \"white\")\n    .transition()\n      .duration(1000)\n      .ease(mirror(\"cubic-in-out\"))\n      .style(\"background\", \"red\");\n});\n\nfunction mirror(f) {\n  if (typeof f !== \"function\") f = d3.ease.apply(d3, arguments);\n  return function(t) {\n    return t < .5 ? f(2 * t) : f(2 - 2 * t);\n  };\n}\n\n</script>\n","encoding":"utf-8"},"thumbnail.png":{"filename":"thumbnail.png","type":"image/png","language":null,"raw_url":"https://gist.githubusercontent.com/mbostock/3145795/raw/77435f57692c9047703ce816f0b2e7a4d4f17506/thumbnail.png","size":1851,"truncated":false,"content":"iVBORw0KGgoAAAANSUhEUgAAAOYAAAB4CAYAAADmBo6IAAAAGXRFWHRTb2Z0\nd2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABt1JREFUeNrs2WtsVGUex/Hf\nnDlzazulll5YWgsOl9B6gwgaE0SNXALiuiS6sutmiYZNNMaYddHsxn1hshs1\n0cRoXFbfYYyJRsnCom7FC6mWFEFdoruSXXAZoYtYaEsrtnTOnDn+z5kKxUTU\nN4U0308Yejpz5szkdL7zPM9MLFi3bp+kBrt4AnC2JezS49p/59kly/kAzhme\nwzkAzj2ECRAmAMIECBMAYQKECYAwAcIEQJgACBMgTACECRAmAMIECBMAYQIg\nTIAwARAmQJgACBMgTACECYAwAcIEQJgAYQIgTIAwARAmAMIECBMAYQKECYAw\nAcIEQJgACBMgTACECRAmAMIECBMAYQIgTIAwARAmQJgACBMgTACECYAwgXOf\nyyk4C2KxU9tB8OPu80P3B2Hix5zxhMVVUtHzbDNpwVlofsnmLjZ58f0xcxnn\nVISuK79QCOtUPGn3LxbLoY65PSh60e8xjQYcj0ulUnkfJx495snjjn1TiG53\nTn/c8Fgx5/Q3kG+OBcKceGfbVVd+r367rUM9Jwqqrchq/bIVShQHdO877+ul\nG29QXSYRRfXYO2/KSdfr3gUX6/72V7Xxf58pzO7GORfr8asW6LYtmzW35SLd\ns6BNa/+2UX3K6KUVS+2ucR0d6NHNr2zVn65ZqoUt9Vq7eZPapuZ0XUOVfvNW\nh0pBTMMW3zXTW7Vm9hTdva1TJTv2iAV/3Yw5dvzLdffrr6jzcF+01hkpxfRX\ne55Xnd9YflMAYU6c1byjoeODWr3572ptmqUnFl+qBzve1Nqtb+jB+Req69Dn\nFkAQjYrhSLW3t1fZmgpt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PCCWc4\ndYyPTh+dcBS0ec3w8InoQ6FMOh1F7tslFk0znXBuqhE7XridGJ3OhuvFcMoa\nHsYPp6W2Ud4+/XFc2z+8zh39yiTcN/r8SbFou/TN07bbmdKOmz5GzPFmEYbB\nVNnoVC6oGEXjOt+xqgg/CS1ZkMnkyf2jdWL4PWU0aw2ixWsqXJ+OWUe64e2j\nv5f3DaJ/bvxbj2P7RNeN3Tea8lr03/7OE0xlJ/Z6M/hh1439KCf4nv3P9Pt3\nbZ/pdkLkwx8AhAkQJgDCBAgTAGEChAmAMAEQJkCYAAgTIEwAhAkQJgDCBECY\nAGECIEyAMAEQJkCYAAgTAGEChAmAMAHCBECYAGECIEwAhAkQJgDCBAgTAGEC\nhAmAMAHC5BQAhAmAMAHCBECYAGECIEyAMAEQJgDCBAgTAGEChAmAMAHCBECY\nAM7IVanEWQDOtTCLNTX99jNhF4/TAZx1YYv9XwswANP5F7AOHuwOAAAAAElF\nTkSuQmCC\n","encoding":"base64"}},"public":true,"created_at":"2012-07-19T18:20:11Z","updated_at":"2016-02-09T01:27:50Z","description":"Mirrored Easing","comments":0,"user":null,"comments_enabled":true,"comments_url":"https://api.github.com/gists/3145795/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":[],"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":"7a7456a9b29cd2f66ae927e96f8c8512f067b87d","committed_at":"2016-02-09T01:27:49Z","change_status":{"total":1,"additions":1,"deletions":0},"url":"https://api.github.com/gists/3145795/7a7456a9b29cd2f66ae927e96f8c8512f067b87d"},{"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":"96dc074f4f61b2ae439dc32c95744ee502b69e7c","committed_at":"2015-10-31T00:52:55Z","change_status":{"total":2,"additions":1,"deletions":1},"url":"https://api.github.com/gists/3145795/96dc074f4f61b2ae439dc32c95744ee502b69e7c"},{"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":"83f62de17d2d212025331709c0726dfd37891e2a","committed_at":"2015-06-11T16:54:39Z","change_status":{"total":2,"additions":1,"deletions":1},"url":"https://api.github.com/gists/3145795/83f62de17d2d212025331709c0726dfd37891e2a"},{"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":"3bdbc7fc9eb1add05ff816f6addba75c0de8b16e","committed_at":"2012-10-12T03:55:04Z","change_status":{"total":0,"additions":0,"deletions":0},"url":"https://api.github.com/gists/3145795/3bdbc7fc9eb1add05ff816f6addba75c0de8b16e"},{"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":"e70bb0d3c93f6d989ed875233692ae9363889ecd","committed_at":"2012-07-19T18:20:12Z","change_status":{"total":36,"additions":36,"deletions":0},"url":"https://api.github.com/gists/3145795/e70bb0d3c93f6d989ed875233692ae9363889ecd"}],"truncated":false}