{"action":"created","comment":{"url":"https://api.github.com/repos/bigdatr/pnut/pulls/comments/98370533","pull_request_review_id":19008972,"id":98370533,"diff_hunk":"@@ -0,0 +1,879 @@\n+// @flow\n+\n+import {\n+    min,\n+    max,\n+    sum,\n+    average,\n+    median\n+} from 'immutable-math';\n+\n+import {\n+    fromJS,\n+    Map,\n+    List,\n+    OrderedMap,\n+    Record\n+} from 'immutable';\n+\n+import Column from './ChartColumn';\n+import type {ChartColumnDefinition, ChartColumn} from './ChartColumn';\n+\n+export type ChartScalar = string|number|null;\n+export type ChartRowDefinition = {[key: string]: ChartScalar}|Map<string,ChartScalar>;\n+export type ChartRow = Map<string,ChartScalar>;\n+export type ChartColumnArg = string|Array<string>|List<string>;\n+\n+type RowUpdater = (rows: List<ChartRow>) => List<ChartRow>;\n+type RowMapper = (row: ChartRow) => ChartRow;\n+\n+/**\n+ * A valid chart value, which can only accept data of type `string`, `number` and `null`.\n+ *\n+ * @typedef ChartScalar\n+ * @type {string|number|null}\n+ */\n+\n+/**\n+ * An `Object` or `Map` that defines data for a row. Once passed into a `ChartData` constructor\n+ * these are replaced with equivalent Immutable `Map`s.\n+ *\n+ * @typedef ChartRowDefinition\n+ * @type {Object<string, ChartScalar>|Map<string, ChartScalar>}\n+ */\n+\n+/**\n+ * An Immutable `Map` representing a row of keyed data. Each value is a `ChartScalar`\n+ * (data of type `string`, `number` or `null`).\n+ *\n+ * @typedef ChartRow\n+ * @type {Map<string,ChartScalar>}\n+ */\n+\n+/**\n+ * This function is passed the `rows` of the current `ChartData`, and should return the new `List`\n+ * of rows to use in the new `ChartData` object.\n+ *\n+ * @callback RowUpdater\n+ * @param {List<ChartRow>} row The `rows` of the current `ChartData`.\n+ * @return {List<ChartRow>} The replacement `rows`.\n+ */\n+\n+/**\n+ * A function called for every row in a `ChartData` object, whose results are used to\n+ * construct a new `ChartData`.\n+ *\n+ * @callback RowMapper\n+ * @param {ChartRow} row The current row.\n+ * @param {number} key The key of the current row.\n+ * @return {ChartRow} The replacement row.\n+ */\n+\n+/**\n+ * @class\n+ *\n+ * ChartData is an Immutable Record used by pnut charts to represent chart data.\n+ * It stores rows of data objects whose members correspond to columns, and metadata about\n+ * the columns.\n+ */\n+\n+class ChartData extends Record({\n+    columns: OrderedMap(),\n+    rows: List()","path":"src/chartdata/ChartData.js","position":82,"original_position":82,"commit_id":"9aed0ddd3398c0e7f26540947b8d6bff875c47da","original_commit_id":"9aed0ddd3398c0e7f26540947b8d6bff875c47da","user":{"login":"dancoates","id":1946998,"avatar_url":"https://avatars.githubusercontent.com/u/1946998?v=3","gravatar_id":"","url":"https://api.github.com/users/dancoates","html_url":"https://github.com/dancoates","followers_url":"https://api.github.com/users/dancoates/followers","following_url":"https://api.github.com/users/dancoates/following{/other_user}","gists_url":"https://api.github.com/users/dancoates/gists{/gist_id}","starred_url":"https://api.github.com/users/dancoates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dancoates/subscriptions","organizations_url":"https://api.github.com/users/dancoates/orgs","repos_url":"https://api.github.com/users/dancoates/repos","events_url":"https://api.github.com/users/dancoates/events{/privacy}","received_events_url":"https://api.github.com/users/dancoates/received_events","type":"User","site_admin":false},"body":"whoops","created_at":"2017-01-30T01:20:28Z","updated_at":"2017-01-30T01:20:28Z","html_url":"https://github.com/bigdatr/pnut/pull/3#discussion_r98370533","pull_request_url":"https://api.github.com/repos/bigdatr/pnut/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/bigdatr/pnut/pulls/comments/98370533"},"html":{"href":"https://github.com/bigdatr/pnut/pull/3#discussion_r98370533"},"pull_request":{"href":"https://api.github.com/repos/bigdatr/pnut/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/bigdatr/pnut/pulls/3","id":102849100,"html_url":"https://github.com/bigdatr/pnut/pull/3","diff_url":"https://github.com/bigdatr/pnut/pull/3.diff","patch_url":"https://github.com/bigdatr/pnut/pull/3.patch","issue_url":"https://api.github.com/repos/bigdatr/pnut/issues/3","number":3,"state":"open","locked":false,"title":"Feature/chartdata","user":{"login":"dxinteractive","id":345320,"avatar_url":"https://avatars.githubusercontent.com/u/345320?v=3","gravatar_id":"","url":"https://api.github.com/users/dxinteractive","html_url":"https://github.com/dxinteractive","followers_url":"https://api.github.com/users/dxinteractive/followers","following_url":"https://api.github.com/users/dxinteractive/following{/other_user}","gists_url":"https://api.github.com/users/dxinteractive/gists{/gist_id}","starred_url":"https://api.github.com/users/dxinteractive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dxinteractive/subscriptions","organizations_url":"https://api.github.com/users/dxinteractive/orgs","repos_url":"https://api.github.com/users/dxinteractive/repos","events_url":"https://api.github.com/users/dxinteractive/events{/privacy}","received_events_url":"https://api.github.com/users/dxinteractive/received_events","type":"User","site_admin":false},"body":"- Add frame methods\r\n- Add lerp method (can expand to other interpolation types later with care)\r\n- Lots of renames, organize tests\r\n- Test memoization more thoroughly\r\n- Move column jsdoc and flow types to column file\r\n- A billion more tests","created_at":"2017-01-24T03:56:43Z","updated_at":"2017-01-30T01:20:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0dffe8bba458b062d149df1a5917efab29563e2c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/bigdatr/pnut/pulls/3/commits","review_comments_url":"https://api.github.com/repos/bigdatr/pnut/pulls/3/comments","review_comment_url":"https://api.github.com/repos/bigdatr/pnut/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bigdatr/pnut/issues/3/comments","statuses_url":"https://api.github.com/repos/bigdatr/pnut/statuses/9aed0ddd3398c0e7f26540947b8d6bff875c47da","head":{"label":"bigdatr:feature/chartdata","ref":"feature/chartdata","sha":"9aed0ddd3398c0e7f26540947b8d6bff875c47da","user":{"login":"bigdatr","id":7624274,"avatar_url":"https://avatars.githubusercontent.com/u/7624274?v=3","gravatar_id":"","url":"https://api.github.com/users/bigdatr","html_url":"https://github.com/bigdatr","followers_url":"https://api.github.com/users/bigdatr/followers","following_url":"https://api.github.com/users/bigdatr/following{/other_user}","gists_url":"https://api.github.com/users/bigdatr/gists{/gist_id}","starred_url":"https://api.github.com/users/bigdatr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigdatr/subscriptions","organizations_url":"https://api.github.com/users/bigdatr/orgs","repos_url":"https://api.github.com/users/bigdatr/repos","events_url":"https://api.github.com/users/bigdatr/events{/privacy}","received_events_url":"https://api.github.com/users/bigdatr/received_events","type":"Organization","site_admin":false},"repo":{"id":78501447,"name":"pnut","full_name":"bigdatr/pnut","owner":{"login":"bigdatr","id":7624274,"avatar_url":"https://avatars.githubusercontent.com/u/7624274?v=3","gravatar_id":"","url":"https://api.github.com/users/bigdatr","html_url":"https://github.com/bigdatr","followers_url":"https://api.github.com/users/bigdatr/followers","following_url":"https://api.github.com/users/bigdatr/following{/other_user}","gists_url":"https://api.github.com/users/bigdatr/gists{/gist_id}","starred_url":"https://api.github.com/users/bigdatr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigdatr/subscriptions","organizations_url":"https://api.github.com/users/bigdatr/orgs","repos_url":"https://api.github.com/users/bigdatr/repos","events_url":"https://api.github.com/users/bigdatr/events{/privacy}","received_events_url":"https://api.github.com/users/bigdatr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bigdatr/pnut","description":"React charts","fork":false,"url":"https://api.github.com/repos/bigdatr/pnut","forks_url":"https://api.github.com/repos/bigdatr/pnut/forks","keys_url":"https://api.github.com/repos/bigdatr/pnut/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bigdatr/pnut/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bigdatr/pnut/teams","hooks_url":"https://api.github.com/repos/bigdatr/pnut/hooks","issue_events_url":"https://api.github.com/repos/bigdatr/pnut/issues/events{/number}","events_url":"https://api.github.com/repos/bigdatr/pnut/events","assignees_url":"https://api.github.com/repos/bigdatr/pnut/assignees{/user}","branches_url":"https://api.github.com/repos/bigdatr/pnut/branches{/branch}","tags_url":"https://api.github.com/repos/bigdatr/pnut/tags","blobs_url":"https://api.github.com/repos/bigdatr/pnut/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bigdatr/pnut/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bigdatr/pnut/git/refs{/sha}","trees_url":"https://api.github.com/repos/bigdatr/pnut/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bigdatr/pnut/statuses/{sha}","languages_url":"https://api.github.com/repos/bigdatr/pnut/languages","stargazers_url":"https://api.github.com/repos/bigdatr/pnut/stargazers","contributors_url":"https://api.github.com/repos/bigdatr/pnut/contributors","subscribers_url":"https://api.github.com/repos/bigdatr/pnut/subscribers","subscription_url":"https://api.github.com/repos/bigdatr/pnut/subscription","commits_url":"https://api.github.com/repos/bigdatr/pnut/commits{/sha}","git_commits_url":"https://api.github.com/repos/bigdatr/pnut/git/commits{/sha}","comments_url":"https://api.github.com/repos/bigdatr/pnut/comments{/number}","issue_comment_url":"https://api.github.com/repos/bigdatr/pnut/issues/comments{/number}","contents_url":"https://api.github.com/repos/bigdatr/pnut/contents/{+path}","compare_url":"https://api.github.com/repos/bigdatr/pnut/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bigdatr/pnut/merges","archive_url":"https://api.github.com/repos/bigdatr/pnut/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bigdatr/pnut/downloads","issues_url":"https://api.github.com/repos/bigdatr/pnut/issues{/number}","pulls_url":"https://api.github.com/repos/bigdatr/pnut/pulls{/number}","milestones_url":"https://api.github.com/repos/bigdatr/pnut/milestones{/number}","notifications_url":"https://api.github.com/repos/bigdatr/pnut/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bigdatr/pnut/labels{/name}","releases_url":"https://api.github.com/repos/bigdatr/pnut/releases{/id}","deployments_url":"https://api.github.com/repos/bigdatr/pnut/deployments","created_at":"2017-01-10T05:41:03Z","updated_at":"2017-01-10T06:01:17Z","pushed_at":"2017-01-29T23:22:09Z","git_url":"git://github.com/bigdatr/pnut.git","ssh_url":"git@github.com:bigdatr/pnut.git","clone_url":"https://github.com/bigdatr/pnut.git","svn_url":"https://github.com/bigdatr/pnut","homepage":null,"size":199,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"bigdatr:master","ref":"master","sha":"c47c00b11ac784ab00d8c5fd023495b28146c60c","user":{"login":"bigdatr","id":7624274,"avatar_url":"https://avatars.githubusercontent.com/u/7624274?v=3","gravatar_id":"","url":"https://api.github.com/users/bigdatr","html_url":"https://github.com/bigdatr","followers_url":"https://api.github.com/users/bigdatr/followers","following_url":"https://api.github.com/users/bigdatr/following{/other_user}","gists_url":"https://api.github.com/users/bigdatr/gists{/gist_id}","starred_url":"https://api.github.com/users/bigdatr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigdatr/subscriptions","organizations_url":"https://api.github.com/users/bigdatr/orgs","repos_url":"https://api.github.com/users/bigdatr/repos","events_url":"https://api.github.com/users/bigdatr/events{/privacy}","received_events_url":"https://api.github.com/users/bigdatr/received_events","type":"Organization","site_admin":false},"repo":{"id":78501447,"name":"pnut","full_name":"bigdatr/pnut","owner":{"login":"bigdatr","id":7624274,"avatar_url":"https://avatars.githubusercontent.com/u/7624274?v=3","gravatar_id":"","url":"https://api.github.com/users/bigdatr","html_url":"https://github.com/bigdatr","followers_url":"https://api.github.com/users/bigdatr/followers","following_url":"https://api.github.com/users/bigdatr/following{/other_user}","gists_url":"https://api.github.com/users/bigdatr/gists{/gist_id}","starred_url":"https://api.github.com/users/bigdatr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigdatr/subscriptions","organizations_url":"https://api.github.com/users/bigdatr/orgs","repos_url":"https://api.github.com/users/bigdatr/repos","events_url":"https://api.github.com/users/bigdatr/events{/privacy}","received_events_url":"https://api.github.com/users/bigdatr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bigdatr/pnut","description":"React charts","fork":false,"url":"https://api.github.com/repos/bigdatr/pnut","forks_url":"https://api.github.com/repos/bigdatr/pnut/forks","keys_url":"https://api.github.com/repos/bigdatr/pnut/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bigdatr/pnut/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bigdatr/pnut/teams","hooks_url":"https://api.github.com/repos/bigdatr/pnut/hooks","issue_events_url":"https://api.github.com/repos/bigdatr/pnut/issues/events{/number}","events_url":"https://api.github.com/repos/bigdatr/pnut/events","assignees_url":"https://api.github.com/repos/bigdatr/pnut/assignees{/user}","branches_url":"https://api.github.com/repos/bigdatr/pnut/branches{/branch}","tags_url":"https://api.github.com/repos/bigdatr/pnut/tags","blobs_url":"https://api.github.com/repos/bigdatr/pnut/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bigdatr/pnut/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bigdatr/pnut/git/refs{/sha}","trees_url":"https://api.github.com/repos/bigdatr/pnut/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bigdatr/pnut/statuses/{sha}","languages_url":"https://api.github.com/repos/bigdatr/pnut/languages","stargazers_url":"https://api.github.com/repos/bigdatr/pnut/stargazers","contributors_url":"https://api.github.com/repos/bigdatr/pnut/contributors","subscribers_url":"https://api.github.com/repos/bigdatr/pnut/subscribers","subscription_url":"https://api.github.com/repos/bigdatr/pnut/subscription","commits_url":"https://api.github.com/repos/bigdatr/pnut/commits{/sha}","git_commits_url":"https://api.github.com/repos/bigdatr/pnut/git/commits{/sha}","comments_url":"https://api.github.com/repos/bigdatr/pnut/comments{/number}","issue_comment_url":"https://api.github.com/repos/bigdatr/pnut/issues/comments{/number}","contents_url":"https://api.github.com/repos/bigdatr/pnut/contents/{+path}","compare_url":"https://api.github.com/repos/bigdatr/pnut/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bigdatr/pnut/merges","archive_url":"https://api.github.com/repos/bigdatr/pnut/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bigdatr/pnut/downloads","issues_url":"https://api.github.com/repos/bigdatr/pnut/issues{/number}","pulls_url":"https://api.github.com/repos/bigdatr/pnut/pulls{/number}","milestones_url":"https://api.github.com/repos/bigdatr/pnut/milestones{/number}","notifications_url":"https://api.github.com/repos/bigdatr/pnut/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bigdatr/pnut/labels{/name}","releases_url":"https://api.github.com/repos/bigdatr/pnut/releases{/id}","deployments_url":"https://api.github.com/repos/bigdatr/pnut/deployments","created_at":"2017-01-10T05:41:03Z","updated_at":"2017-01-10T06:01:17Z","pushed_at":"2017-01-29T23:22:09Z","git_url":"git://github.com/bigdatr/pnut.git","ssh_url":"git@github.com:bigdatr/pnut.git","clone_url":"https://github.com/bigdatr/pnut.git","svn_url":"https://github.com/bigdatr/pnut","homepage":null,"size":199,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bigdatr/pnut/pulls/3"},"html":{"href":"https://github.com/bigdatr/pnut/pull/3"},"issue":{"href":"https://api.github.com/repos/bigdatr/pnut/issues/3"},"comments":{"href":"https://api.github.com/repos/bigdatr/pnut/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/bigdatr/pnut/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/bigdatr/pnut/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bigdatr/pnut/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/bigdatr/pnut/statuses/9aed0ddd3398c0e7f26540947b8d6bff875c47da"}}}}
{"actor":{"display_login":"dancoates"}}