{"action":"created","comment":{"url":"https://api.github.com/repos/palantir/plottable/pulls/comments/43212843","id":43212843,"diff_hunk":"@@ -0,0 +1,66 @@\n+module Plottable.Animators {\n+  export type d3SelectionOrTransition = d3.Selection<any> | d3.Transition<any>;\n+\n+  export type EasingFunction = (t: number) => number;\n+  export type EasingFunctionSpecifier = string | EasingFunction;\n+  /**\n+   * Custom easing functions. these are designed to co-ordinate the timing of\n+   * actvities on two or more transitions that are active simulataneously\n+   * (on different selections)\n+   * These are designed to help animators schedule animations between\n+   * the enter, update and exit selections - each can have a transition of the same duration,\n+   * but the actual timing of activity will be determined by the easing function.\n+   */\n+  export class EasingFunctions {\n+    /**\n+     * atStart\n+     * An EasingFunction that applies all attributes at once at the start of the transition;\n+     * ie this creates a \"wait\" after applying the attributes.\n+     */\n+    public static atStart = (t: number) => {\n+      return 1;\n+    };\n+    /**\n+     * atEnd\n+     * An EasingFunction that applies all attributes at once at the end of the transition;\n+     * ie this creates a \"wait\" before applying the attributes.\n+     */\n+    public static atEnd = (t: number) => {\n+      if (t < 1) {\n+        return 0;\n+      };\n+      return 1;\n+    };\n+    /**\n+     * squEase\n+     * squEase (\"squeezing ease\") applies the transition squeezed into a subinterval [a,b] where 0 <= a <= b <= 1.\n+     * The actual easing to apply in that interval is passed as an argument.\n+     * @param easingFunction {EasingFunctionSpecifier} an easing function, or the string descriptor\n+     * of a d3 built-in easing function ( as used by d3.ease())\n+     * @param start {number} value between 0 and 1 at which the animation starts\n+     * @param end  {end} value between start and 1 at which the animation ends\n+     * Note that if start == end, the are applied instanteously at that point and the\n+     * easingFunction parameter is not relevant. In particular start == end == 0 is the\n+     * same as atStart\n+     * @returns {EasingFunction} An easing function that can be applied to a d3 transition.\n+     */\n+    public static squEase(easingFunction: EasingFunctionSpecifier, start: number, end: number): EasingFunction {\n+      return (t: number) => {\n+        if (start === undefined) {\n+          start = 0;\n+        };\n+        if (t >= end) {\n+          return 1;\n+        }\n+        if (t <= start) {\n+          return 0;\n+        }\n+        let tbar = (t - start) / (end - start);\n+        if (typeof easingFunction === \"string\") {\n+          return d3.ease(easingFunction)(tbar);\n+        }\n+        return (<EasingFunction>easingFunction)(tbar);\n+      };\n+    }\n+  }\n+}","path":"src/animators/easingFunctions.ts","position":66,"original_position":66,"commit_id":"2da3fedc9060754f796a541aae0c404e271d7926","original_commit_id":"2da3fedc9060754f796a541aae0c404e271d7926","user":{"login":"bluong","id":1448299,"avatar_url":"https://avatars.githubusercontent.com/u/1448299?v=3","gravatar_id":"","url":"https://api.github.com/users/bluong","html_url":"https://github.com/bluong","followers_url":"https://api.github.com/users/bluong/followers","following_url":"https://api.github.com/users/bluong/following{/other_user}","gists_url":"https://api.github.com/users/bluong/gists{/gist_id}","starred_url":"https://api.github.com/users/bluong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluong/subscriptions","organizations_url":"https://api.github.com/users/bluong/orgs","repos_url":"https://api.github.com/users/bluong/repos","events_url":"https://api.github.com/users/bluong/events{/privacy}","received_events_url":"https://api.github.com/users/bluong/received_events","type":"User","site_admin":false},"body":"Can we extract this out (possibly into a pull request into develop if you can attach it to `Animators.Easing` or into `objectConstancy` and then we can connect the pieces later)?","created_at":"2015-10-28T02:28:13Z","updated_at":"2015-10-28T02:28:13Z","html_url":"https://github.com/palantir/plottable/pull/2930#discussion_r43212843","pull_request_url":"https://api.github.com/repos/palantir/plottable/pulls/2930","_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments/43212843"},"html":{"href":"https://github.com/palantir/plottable/pull/2930#discussion_r43212843"},"pull_request":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2930"}}},"pull_request":{"url":"https://api.github.com/repos/palantir/plottable/pulls/2930","id":48809992,"html_url":"https://github.com/palantir/plottable/pull/2930","diff_url":"https://github.com/palantir/plottable/pull/2930.diff","patch_url":"https://github.com/palantir/plottable/pull/2930.patch","issue_url":"https://api.github.com/repos/palantir/plottable/issues/2930","number":2930,"state":"open","locked":false,"title":"Animation Stage1 Alternative - animateJoin method","user":{"login":"softwords","id":8971705,"avatar_url":"https://avatars.githubusercontent.com/u/8971705?v=3","gravatar_id":"","url":"https://api.github.com/users/softwords","html_url":"https://github.com/softwords","followers_url":"https://api.github.com/users/softwords/followers","following_url":"https://api.github.com/users/softwords/following{/other_user}","gists_url":"https://api.github.com/users/softwords/gists{/gist_id}","starred_url":"https://api.github.com/users/softwords/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softwords/subscriptions","organizations_url":"https://api.github.com/users/softwords/orgs","repos_url":"https://api.github.com/users/softwords/repos","events_url":"https://api.github.com/users/softwords/events{/privacy}","received_events_url":"https://api.github.com/users/softwords/received_events","type":"User","site_admin":false},"body":"Alternative version of Stage 1 that splits of ```animateJoin```  into a separate method of ```Animator```.\r\n\r\n","created_at":"2015-10-26T23:12:10Z","updated_at":"2015-10-28T02:28:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b633cc2cc1b4ad904ed744929933c2d51a870f7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/palantir/plottable/pulls/2930/commits","review_comments_url":"https://api.github.com/repos/palantir/plottable/pulls/2930/comments","review_comment_url":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/palantir/plottable/issues/2930/comments","statuses_url":"https://api.github.com/repos/palantir/plottable/statuses/2da3fedc9060754f796a541aae0c404e271d7926","head":{"label":"softwords:stage1AnimateJoin","ref":"stage1AnimateJoin","sha":"2da3fedc9060754f796a541aae0c404e271d7926","user":{"login":"softwords","id":8971705,"avatar_url":"https://avatars.githubusercontent.com/u/8971705?v=3","gravatar_id":"","url":"https://api.github.com/users/softwords","html_url":"https://github.com/softwords","followers_url":"https://api.github.com/users/softwords/followers","following_url":"https://api.github.com/users/softwords/following{/other_user}","gists_url":"https://api.github.com/users/softwords/gists{/gist_id}","starred_url":"https://api.github.com/users/softwords/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softwords/subscriptions","organizations_url":"https://api.github.com/users/softwords/orgs","repos_url":"https://api.github.com/users/softwords/repos","events_url":"https://api.github.com/users/softwords/events{/privacy}","received_events_url":"https://api.github.com/users/softwords/received_events","type":"User","site_admin":false},"repo":{"id":42768727,"name":"plottable","full_name":"softwords/plottable","owner":{"login":"softwords","id":8971705,"avatar_url":"https://avatars.githubusercontent.com/u/8971705?v=3","gravatar_id":"","url":"https://api.github.com/users/softwords","html_url":"https://github.com/softwords","followers_url":"https://api.github.com/users/softwords/followers","following_url":"https://api.github.com/users/softwords/following{/other_user}","gists_url":"https://api.github.com/users/softwords/gists{/gist_id}","starred_url":"https://api.github.com/users/softwords/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softwords/subscriptions","organizations_url":"https://api.github.com/users/softwords/orgs","repos_url":"https://api.github.com/users/softwords/repos","events_url":"https://api.github.com/users/softwords/events{/privacy}","received_events_url":"https://api.github.com/users/softwords/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/softwords/plottable","description":"A library of modular chart components, built on D3","fork":true,"url":"https://api.github.com/repos/softwords/plottable","forks_url":"https://api.github.com/repos/softwords/plottable/forks","keys_url":"https://api.github.com/repos/softwords/plottable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/softwords/plottable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/softwords/plottable/teams","hooks_url":"https://api.github.com/repos/softwords/plottable/hooks","issue_events_url":"https://api.github.com/repos/softwords/plottable/issues/events{/number}","events_url":"https://api.github.com/repos/softwords/plottable/events","assignees_url":"https://api.github.com/repos/softwords/plottable/assignees{/user}","branches_url":"https://api.github.com/repos/softwords/plottable/branches{/branch}","tags_url":"https://api.github.com/repos/softwords/plottable/tags","blobs_url":"https://api.github.com/repos/softwords/plottable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/softwords/plottable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/softwords/plottable/git/refs{/sha}","trees_url":"https://api.github.com/repos/softwords/plottable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/softwords/plottable/statuses/{sha}","languages_url":"https://api.github.com/repos/softwords/plottable/languages","stargazers_url":"https://api.github.com/repos/softwords/plottable/stargazers","contributors_url":"https://api.github.com/repos/softwords/plottable/contributors","subscribers_url":"https://api.github.com/repos/softwords/plottable/subscribers","subscription_url":"https://api.github.com/repos/softwords/plottable/subscription","commits_url":"https://api.github.com/repos/softwords/plottable/commits{/sha}","git_commits_url":"https://api.github.com/repos/softwords/plottable/git/commits{/sha}","comments_url":"https://api.github.com/repos/softwords/plottable/comments{/number}","issue_comment_url":"https://api.github.com/repos/softwords/plottable/issues/comments{/number}","contents_url":"https://api.github.com/repos/softwords/plottable/contents/{+path}","compare_url":"https://api.github.com/repos/softwords/plottable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/softwords/plottable/merges","archive_url":"https://api.github.com/repos/softwords/plottable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/softwords/plottable/downloads","issues_url":"https://api.github.com/repos/softwords/plottable/issues{/number}","pulls_url":"https://api.github.com/repos/softwords/plottable/pulls{/number}","milestones_url":"https://api.github.com/repos/softwords/plottable/milestones{/number}","notifications_url":"https://api.github.com/repos/softwords/plottable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/softwords/plottable/labels{/name}","releases_url":"https://api.github.com/repos/softwords/plottable/releases{/id}","created_at":"2015-09-19T10:20:05Z","updated_at":"2015-09-19T10:20:07Z","pushed_at":"2015-10-27T10:35:53Z","git_url":"git://github.com/softwords/plottable.git","ssh_url":"git@github.com:softwords/plottable.git","clone_url":"https://github.com/softwords/plottable.git","svn_url":"https://github.com/softwords/plottable","homepage":"plottablejs.org","size":64217,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"palantir:objectConstancy","ref":"objectConstancy","sha":"5f8b0ed84c3b032a6d9cc138ddef88dd0897476d","user":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"repo":{"id":16149854,"name":"plottable","full_name":"palantir/plottable","owner":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/palantir/plottable","description":"A library of modular chart components, built on D3","fork":false,"url":"https://api.github.com/repos/palantir/plottable","forks_url":"https://api.github.com/repos/palantir/plottable/forks","keys_url":"https://api.github.com/repos/palantir/plottable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/palantir/plottable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/palantir/plottable/teams","hooks_url":"https://api.github.com/repos/palantir/plottable/hooks","issue_events_url":"https://api.github.com/repos/palantir/plottable/issues/events{/number}","events_url":"https://api.github.com/repos/palantir/plottable/events","assignees_url":"https://api.github.com/repos/palantir/plottable/assignees{/user}","branches_url":"https://api.github.com/repos/palantir/plottable/branches{/branch}","tags_url":"https://api.github.com/repos/palantir/plottable/tags","blobs_url":"https://api.github.com/repos/palantir/plottable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/palantir/plottable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/palantir/plottable/git/refs{/sha}","trees_url":"https://api.github.com/repos/palantir/plottable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/palantir/plottable/statuses/{sha}","languages_url":"https://api.github.com/repos/palantir/plottable/languages","stargazers_url":"https://api.github.com/repos/palantir/plottable/stargazers","contributors_url":"https://api.github.com/repos/palantir/plottable/contributors","subscribers_url":"https://api.github.com/repos/palantir/plottable/subscribers","subscription_url":"https://api.github.com/repos/palantir/plottable/subscription","commits_url":"https://api.github.com/repos/palantir/plottable/commits{/sha}","git_commits_url":"https://api.github.com/repos/palantir/plottable/git/commits{/sha}","comments_url":"https://api.github.com/repos/palantir/plottable/comments{/number}","issue_comment_url":"https://api.github.com/repos/palantir/plottable/issues/comments{/number}","contents_url":"https://api.github.com/repos/palantir/plottable/contents/{+path}","compare_url":"https://api.github.com/repos/palantir/plottable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/palantir/plottable/merges","archive_url":"https://api.github.com/repos/palantir/plottable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/palantir/plottable/downloads","issues_url":"https://api.github.com/repos/palantir/plottable/issues{/number}","pulls_url":"https://api.github.com/repos/palantir/plottable/pulls{/number}","milestones_url":"https://api.github.com/repos/palantir/plottable/milestones{/number}","notifications_url":"https://api.github.com/repos/palantir/plottable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/palantir/plottable/labels{/name}","releases_url":"https://api.github.com/repos/palantir/plottable/releases{/id}","created_at":"2014-01-22T19:29:19Z","updated_at":"2015-10-27T04:40:56Z","pushed_at":"2015-10-28T00:46:50Z","git_url":"git://github.com/palantir/plottable.git","ssh_url":"git@github.com:palantir/plottable.git","clone_url":"https://github.com/palantir/plottable.git","svn_url":"https://github.com/palantir/plottable","homepage":"plottablejs.org","size":140424,"stargazers_count":776,"watchers_count":776,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":82,"mirror_url":null,"open_issues_count":240,"forks":82,"open_issues":240,"watchers":776,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2930"},"html":{"href":"https://github.com/palantir/plottable/pull/2930"},"issue":{"href":"https://api.github.com/repos/palantir/plottable/issues/2930"},"comments":{"href":"https://api.github.com/repos/palantir/plottable/issues/2930/comments"},"review_comments":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2930/comments"},"review_comment":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2930/commits"},"statuses":{"href":"https://api.github.com/repos/palantir/plottable/statuses/2da3fedc9060754f796a541aae0c404e271d7926"}}}}