{"action":"created","comment":{"url":"https://api.github.com/repos/airbnb/caravel/pulls/comments/82423268","pull_request_review_id":3334450,"id":82423268,"diff_hunk":"@@ -0,0 +1,135 @@\n+import React from 'react';\n+import Select from 'react-select';\n+import { bindActionCreators } from 'redux';\n+import * as actions from '../actions/exploreActions';\n+import { connect } from 'react-redux';\n+import {\n+  rollingOptions, periodRatioTypeOptions, resampleHowOptions,\n+  resampleRuleOptions, resampleFillOptions,\n+} from '../constants';\n+\n+const propTypes = {\n+  actions: React.PropTypes.object,\n+  rolling: React.PropTypes.string,\n+  periodRatioType: React.PropTypes.string,\n+  resampleHow: React.PropTypes.string,\n+  resampleRule: React.PropTypes.string,\n+  resampleFill: React.PropTypes.string,\n+};\n+\n+const defaultProps = {\n+  rolling: null,\n+  periodRatioType: null,\n+  resampleHow: null,\n+  resampleRule: null,\n+  resampleFill: null,\n+};\n+\n+class AdvancedAnalytics extends React.Component {\n+  changeSelectData(field, opt) {\n+    const val = opt ? opt.value : null;\n+    this.props.actions.setStateValue(field, val);\n+  }\n+  changeInput(field, event) {\n+    this.props.actions.setStateValue(field, event.target.value);\n+  }\n+  render() {\n+    return (\n+      <div className=\"panel space-1\">\n+        <div className=\"panel-header\">Advanced Analytics</div>\n+        <div className=\"panel-body\">\n+          <div className=\"col-sm-6\">\n+            <h5 className=\"section-heading\">Rolling</h5>\n+            <Select\n+              name=\"select-rolling\"\n+              options={rollingOptions.map((o) => ({ value: o, label: o }))}\n+              value={this.props.rolling}\n+              autosize={false}\n+              onChange={this.changeSelectData.bind(this, 'rolling')}\n+            />\n+          </div>\n+          <div className=\"col-sm-6\">\n+            <h5 className=\"section-heading\">Periods</h5>\n+            <input\n+              type=\"text\"\n+              onChange={this.changeInput.bind(this, 'periods')}\n+              className=\"form-control input-sm\"\n+            />\n+          </div>\n+          <h5 className=\"section-heading\">Time Shift</h5>\n+          <input\n+            type=\"text\"\n+            onChange={this.changeInput.bind(this, 'timeShift')}\n+            className=\"form-control input-sm\"\n+          />\n+          <div className=\"col-sm-6\">\n+            <h5 className=\"section-heading\">Period Ratio</h5>\n+            <input\n+              type=\"text\"\n+              onChange={this.changeInput.bind(this, 'periodRatio')}\n+              className=\"form-control input-sm\"\n+            />\n+          </div>\n+          <div className=\"col-sm-6\">\n+            <h5 className=\"section-heading\">Period Ratio Type</h5>\n+            <Select\n+              name=\"select-rolling\"\n+              options={periodRatioTypeOptions.map((o) => ({ value: o, label: o }))}\n+              value={this.props.periodRatioType}\n+              autosize={false}\n+              onChange={this.changeSelectData.bind(this, 'periodRatioType')}\n+            />\n+          </div>\n+          <div className=\"col-sm-6\">\n+            <h5 className=\"section-heading\">Resample How</h5>\n+            <Select\n+              name=\"select-rolling\"\n+              options={resampleHowOptions.map((o) => ({ value: o, label: o }))}\n+              value={this.props.resampleHow}\n+              autosize={false}\n+              onChange={this.changeSelectData.bind(this, 'resampleHow')}\n+            />\n+          </div>\n+          <div className=\"col-sm-6\">\n+            <h5 className=\"section-heading\">Resample Rule</h5>\n+            <Select\n+              name=\"select-rolling\"\n+              options={resampleRuleOptions.map((o) => ({ value: o, label: o }))}\n+              value={this.props.resampleRule}\n+              autosize={false}\n+              onChange={this.changeSelectData.bind(this, 'resampleRule')}\n+            />\n+          </div>\n+          <h5 className=\"section-heading\">Resample Fill Method</h5>\n+          <Select\n+            name=\"select-rolling\"\n+            options={resampleFillOptions.map((o) => ({ value: o, label: o }))}\n+            value={this.props.resampleFill}\n+            autosize={false}\n+            onChange={this.changeSelectData.bind(this, 'resampleFill')}\n+          />\n+        </div>\n+      </div>\n+    );\n+  }\n+}\n+\n+AdvancedAnalytics.propTypes = propTypes;\n+AdvancedAnalytics.defaultProps = defaultProps;\n+\n+function mapStateToProps(state) {\n+  return {\n+    rolling: state.rolling,","path":"caravel/assets/javascripts/explorev2/components/AdvancedAnalytics.jsx","position":122,"original_position":122,"commit_id":"ea4f555cb5d2d013a2d6fcde525cd97975961fb7","original_commit_id":"ea4f555cb5d2d013a2d6fcde525cd97975961fb7","user":{"login":"bkyryliuk","id":5727938,"avatar_url":"https://avatars.githubusercontent.com/u/5727938?v=3","gravatar_id":"","url":"https://api.github.com/users/bkyryliuk","html_url":"https://github.com/bkyryliuk","followers_url":"https://api.github.com/users/bkyryliuk/followers","following_url":"https://api.github.com/users/bkyryliuk/following{/other_user}","gists_url":"https://api.github.com/users/bkyryliuk/gists{/gist_id}","starred_url":"https://api.github.com/users/bkyryliuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkyryliuk/subscriptions","organizations_url":"https://api.github.com/users/bkyryliuk/orgs","repos_url":"https://api.github.com/users/bkyryliuk/repos","events_url":"https://api.github.com/users/bkyryliuk/events{/privacy}","received_events_url":"https://api.github.com/users/bkyryliuk/received_events","type":"User","site_admin":false},"body":"I am not sure if they should be top level args in the redux store, maybe `state.viz.advancedAnalytics` or `state.explore.advancedAnalytics`","created_at":"2016-10-07T16:28:08Z","updated_at":"2016-10-07T16:28:08Z","html_url":"https://github.com/airbnb/caravel/pull/1267#discussion_r82423268","pull_request_url":"https://api.github.com/repos/airbnb/caravel/pulls/1267","_links":{"self":{"href":"https://api.github.com/repos/airbnb/caravel/pulls/comments/82423268"},"html":{"href":"https://github.com/airbnb/caravel/pull/1267#discussion_r82423268"},"pull_request":{"href":"https://api.github.com/repos/airbnb/caravel/pulls/1267"}}},"pull_request":{"url":"https://api.github.com/repos/airbnb/caravel/pulls/1267","id":88185836,"html_url":"https://github.com/airbnb/caravel/pull/1267","diff_url":"https://github.com/airbnb/caravel/pull/1267.diff","patch_url":"https://github.com/airbnb/caravel/pull/1267.patch","issue_url":"https://api.github.com/repos/airbnb/caravel/issues/1267","number":1267,"state":"open","locked":false,"title":"[Work in Progress] Added Advcanced Analytics panel and Chart Options for Line chart","user":{"login":"vera-liu","id":20978302,"avatar_url":"https://avatars.githubusercontent.com/u/20978302?v=3","gravatar_id":"","url":"https://api.github.com/users/vera-liu","html_url":"https://github.com/vera-liu","followers_url":"https://api.github.com/users/vera-liu/followers","following_url":"https://api.github.com/users/vera-liu/following{/other_user}","gists_url":"https://api.github.com/users/vera-liu/gists{/gist_id}","starred_url":"https://api.github.com/users/vera-liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vera-liu/subscriptions","organizations_url":"https://api.github.com/users/vera-liu/orgs","repos_url":"https://api.github.com/users/vera-liu/repos","events_url":"https://api.github.com/users/vera-liu/events{/privacy}","received_events_url":"https://api.github.com/users/vera-liu/received_events","type":"User","site_admin":false},"body":"Done:\r\n - Advanced Analytics and Chart Options components\r\nOld:\r\n![screen shot 2016-10-05 at 6 31 23 pm](https://cloud.githubusercontent.com/assets/20978302/19137606/fc594c3e-8b29-11e6-8b26-bff0a5e2e25a.png)\r\n\r\nNew:\r\n![screen shot 2016-10-06 at 1 49 13 pm](https://cloud.githubusercontent.com/assets/20978302/19170050/c1828240-8bcb-11e6-8bee-b1b743fcac42.png)\r\n\r\n\r\n\r\nTodo:\r\n - Organize the UI so that checkboxes and select are aligned well\r\n - Our bootstrap data-passing in index.jsx is getting fairly large, need to figure out a smarter way to pass in the data\r\n - As we have a lot of Select/input in our control panel, it makes sense to have one general action creator/reducer to update a property in the state. Like what we have here:[https://github.com/airbnb/caravel/pull/1267/files#diff-a1f5feeb69d0c72dd77f1c4a22a267e7R216](url) I need to generalize this for other components as well\r\n - Our store is getting large too, I'm thinking if we want to have separate store for different viz types ","created_at":"2016-10-06T01:31:08Z","updated_at":"2016-10-07T16:28:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23730d289711e8a6fc1e0cb74dc734df636625f1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/airbnb/caravel/pulls/1267/commits","review_comments_url":"https://api.github.com/repos/airbnb/caravel/pulls/1267/comments","review_comment_url":"https://api.github.com/repos/airbnb/caravel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/airbnb/caravel/issues/1267/comments","statuses_url":"https://api.github.com/repos/airbnb/caravel/statuses/ea4f555cb5d2d013a2d6fcde525cd97975961fb7","head":{"label":"vera-liu:vliu_line_controls","ref":"vliu_line_controls","sha":"ea4f555cb5d2d013a2d6fcde525cd97975961fb7","user":{"login":"vera-liu","id":20978302,"avatar_url":"https://avatars.githubusercontent.com/u/20978302?v=3","gravatar_id":"","url":"https://api.github.com/users/vera-liu","html_url":"https://github.com/vera-liu","followers_url":"https://api.github.com/users/vera-liu/followers","following_url":"https://api.github.com/users/vera-liu/following{/other_user}","gists_url":"https://api.github.com/users/vera-liu/gists{/gist_id}","starred_url":"https://api.github.com/users/vera-liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vera-liu/subscriptions","organizations_url":"https://api.github.com/users/vera-liu/orgs","repos_url":"https://api.github.com/users/vera-liu/repos","events_url":"https://api.github.com/users/vera-liu/events{/privacy}","received_events_url":"https://api.github.com/users/vera-liu/received_events","type":"User","site_admin":false},"repo":{"id":65501764,"name":"caravel","full_name":"vera-liu/caravel","owner":{"login":"vera-liu","id":20978302,"avatar_url":"https://avatars.githubusercontent.com/u/20978302?v=3","gravatar_id":"","url":"https://api.github.com/users/vera-liu","html_url":"https://github.com/vera-liu","followers_url":"https://api.github.com/users/vera-liu/followers","following_url":"https://api.github.com/users/vera-liu/following{/other_user}","gists_url":"https://api.github.com/users/vera-liu/gists{/gist_id}","starred_url":"https://api.github.com/users/vera-liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vera-liu/subscriptions","organizations_url":"https://api.github.com/users/vera-liu/orgs","repos_url":"https://api.github.com/users/vera-liu/repos","events_url":"https://api.github.com/users/vera-liu/events{/privacy}","received_events_url":"https://api.github.com/users/vera-liu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vera-liu/caravel","description":"Caravel is a data exploration platform designed to be visual, intuitive, and interactive","fork":true,"url":"https://api.github.com/repos/vera-liu/caravel","forks_url":"https://api.github.com/repos/vera-liu/caravel/forks","keys_url":"https://api.github.com/repos/vera-liu/caravel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vera-liu/caravel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vera-liu/caravel/teams","hooks_url":"https://api.github.com/repos/vera-liu/caravel/hooks","issue_events_url":"https://api.github.com/repos/vera-liu/caravel/issues/events{/number}","events_url":"https://api.github.com/repos/vera-liu/caravel/events","assignees_url":"https://api.github.com/repos/vera-liu/caravel/assignees{/user}","branches_url":"https://api.github.com/repos/vera-liu/caravel/branches{/branch}","tags_url":"https://api.github.com/repos/vera-liu/caravel/tags","blobs_url":"https://api.github.com/repos/vera-liu/caravel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vera-liu/caravel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vera-liu/caravel/git/refs{/sha}","trees_url":"https://api.github.com/repos/vera-liu/caravel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vera-liu/caravel/statuses/{sha}","languages_url":"https://api.github.com/repos/vera-liu/caravel/languages","stargazers_url":"https://api.github.com/repos/vera-liu/caravel/stargazers","contributors_url":"https://api.github.com/repos/vera-liu/caravel/contributors","subscribers_url":"https://api.github.com/repos/vera-liu/caravel/subscribers","subscription_url":"https://api.github.com/repos/vera-liu/caravel/subscription","commits_url":"https://api.github.com/repos/vera-liu/caravel/commits{/sha}","git_commits_url":"https://api.github.com/repos/vera-liu/caravel/git/commits{/sha}","comments_url":"https://api.github.com/repos/vera-liu/caravel/comments{/number}","issue_comment_url":"https://api.github.com/repos/vera-liu/caravel/issues/comments{/number}","contents_url":"https://api.github.com/repos/vera-liu/caravel/contents/{+path}","compare_url":"https://api.github.com/repos/vera-liu/caravel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vera-liu/caravel/merges","archive_url":"https://api.github.com/repos/vera-liu/caravel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vera-liu/caravel/downloads","issues_url":"https://api.github.com/repos/vera-liu/caravel/issues{/number}","pulls_url":"https://api.github.com/repos/vera-liu/caravel/pulls{/number}","milestones_url":"https://api.github.com/repos/vera-liu/caravel/milestones{/number}","notifications_url":"https://api.github.com/repos/vera-liu/caravel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vera-liu/caravel/labels{/name}","releases_url":"https://api.github.com/repos/vera-liu/caravel/releases{/id}","deployments_url":"https://api.github.com/repos/vera-liu/caravel/deployments","created_at":"2016-08-11T21:10:17Z","updated_at":"2016-08-11T21:10:18Z","pushed_at":"2016-10-07T16:23:09Z","git_url":"git://github.com/vera-liu/caravel.git","ssh_url":"git@github.com:vera-liu/caravel.git","clone_url":"https://github.com/vera-liu/caravel.git","svn_url":"https://github.com/vera-liu/caravel","homepage":"","size":37566,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"airbnb:master","ref":"master","sha":"8a5f050f6cbf2a4eca7f2799a244f94218bb11c1","user":{"login":"airbnb","id":698437,"avatar_url":"https://avatars.githubusercontent.com/u/698437?v=3","gravatar_id":"","url":"https://api.github.com/users/airbnb","html_url":"https://github.com/airbnb","followers_url":"https://api.github.com/users/airbnb/followers","following_url":"https://api.github.com/users/airbnb/following{/other_user}","gists_url":"https://api.github.com/users/airbnb/gists{/gist_id}","starred_url":"https://api.github.com/users/airbnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airbnb/subscriptions","organizations_url":"https://api.github.com/users/airbnb/orgs","repos_url":"https://api.github.com/users/airbnb/repos","events_url":"https://api.github.com/users/airbnb/events{/privacy}","received_events_url":"https://api.github.com/users/airbnb/received_events","type":"Organization","site_admin":false},"repo":{"id":39464018,"name":"caravel","full_name":"airbnb/caravel","owner":{"login":"airbnb","id":698437,"avatar_url":"https://avatars.githubusercontent.com/u/698437?v=3","gravatar_id":"","url":"https://api.github.com/users/airbnb","html_url":"https://github.com/airbnb","followers_url":"https://api.github.com/users/airbnb/followers","following_url":"https://api.github.com/users/airbnb/following{/other_user}","gists_url":"https://api.github.com/users/airbnb/gists{/gist_id}","starred_url":"https://api.github.com/users/airbnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airbnb/subscriptions","organizations_url":"https://api.github.com/users/airbnb/orgs","repos_url":"https://api.github.com/users/airbnb/repos","events_url":"https://api.github.com/users/airbnb/events{/privacy}","received_events_url":"https://api.github.com/users/airbnb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/airbnb/caravel","description":"Caravel is a data exploration platform designed to be visual, intuitive, and interactive","fork":false,"url":"https://api.github.com/repos/airbnb/caravel","forks_url":"https://api.github.com/repos/airbnb/caravel/forks","keys_url":"https://api.github.com/repos/airbnb/caravel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/airbnb/caravel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/airbnb/caravel/teams","hooks_url":"https://api.github.com/repos/airbnb/caravel/hooks","issue_events_url":"https://api.github.com/repos/airbnb/caravel/issues/events{/number}","events_url":"https://api.github.com/repos/airbnb/caravel/events","assignees_url":"https://api.github.com/repos/airbnb/caravel/assignees{/user}","branches_url":"https://api.github.com/repos/airbnb/caravel/branches{/branch}","tags_url":"https://api.github.com/repos/airbnb/caravel/tags","blobs_url":"https://api.github.com/repos/airbnb/caravel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/airbnb/caravel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/airbnb/caravel/git/refs{/sha}","trees_url":"https://api.github.com/repos/airbnb/caravel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/airbnb/caravel/statuses/{sha}","languages_url":"https://api.github.com/repos/airbnb/caravel/languages","stargazers_url":"https://api.github.com/repos/airbnb/caravel/stargazers","contributors_url":"https://api.github.com/repos/airbnb/caravel/contributors","subscribers_url":"https://api.github.com/repos/airbnb/caravel/subscribers","subscription_url":"https://api.github.com/repos/airbnb/caravel/subscription","commits_url":"https://api.github.com/repos/airbnb/caravel/commits{/sha}","git_commits_url":"https://api.github.com/repos/airbnb/caravel/git/commits{/sha}","comments_url":"https://api.github.com/repos/airbnb/caravel/comments{/number}","issue_comment_url":"https://api.github.com/repos/airbnb/caravel/issues/comments{/number}","contents_url":"https://api.github.com/repos/airbnb/caravel/contents/{+path}","compare_url":"https://api.github.com/repos/airbnb/caravel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/airbnb/caravel/merges","archive_url":"https://api.github.com/repos/airbnb/caravel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/airbnb/caravel/downloads","issues_url":"https://api.github.com/repos/airbnb/caravel/issues{/number}","pulls_url":"https://api.github.com/repos/airbnb/caravel/pulls{/number}","milestones_url":"https://api.github.com/repos/airbnb/caravel/milestones{/number}","notifications_url":"https://api.github.com/repos/airbnb/caravel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/airbnb/caravel/labels{/name}","releases_url":"https://api.github.com/repos/airbnb/caravel/releases{/id}","deployments_url":"https://api.github.com/repos/airbnb/caravel/deployments","created_at":"2015-07-21T18:55:34Z","updated_at":"2016-10-07T15:49:59Z","pushed_at":"2016-10-07T16:27:15Z","git_url":"git://github.com/airbnb/caravel.git","ssh_url":"git@github.com:airbnb/caravel.git","clone_url":"https://github.com/airbnb/caravel.git","svn_url":"https://github.com/airbnb/caravel","homepage":"","size":43380,"stargazers_count":7605,"watchers_count":7605,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":887,"mirror_url":null,"open_issues_count":268,"forks":887,"open_issues":268,"watchers":7605,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/airbnb/caravel/pulls/1267"},"html":{"href":"https://github.com/airbnb/caravel/pull/1267"},"issue":{"href":"https://api.github.com/repos/airbnb/caravel/issues/1267"},"comments":{"href":"https://api.github.com/repos/airbnb/caravel/issues/1267/comments"},"review_comments":{"href":"https://api.github.com/repos/airbnb/caravel/pulls/1267/comments"},"review_comment":{"href":"https://api.github.com/repos/airbnb/caravel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/airbnb/caravel/pulls/1267/commits"},"statuses":{"href":"https://api.github.com/repos/airbnb/caravel/statuses/ea4f555cb5d2d013a2d6fcde525cd97975961fb7"}}}}
{"actor":{"display_login":"bkyryliuk"}}