{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/26970453","id":26970453,"diff_hunk":"@@ -109,32 +109,13 @@ Stats.controller = function(vm) {\n \n     self.drawGraph = function(divId, graphFunction) {\n         return m('div', {id: divId, config: function(e, i) {\n-            if (i) {\n-                return;\n-            }\n-            self.graphs[divId] = graphFunction(self.vm.statsData, self.vm);\n+            if (i) return;\n+            self.vm.graphs[divId] = graphFunction(self.vm.statsData, self.vm);\n         }});\n     };\n \n-    self.loadStats = function() {\n-        self.vm.statsLoaded(false);\n-\n-        m.request({\n-            method: 'GET',\n-            url: '/api/v1/share/stats/?' + $.param({q: self.vm.query()}),\n-            background: true\n-        }).then(function(data) {\n-            self.vm.statsData = data;\n-            Object.keys(self.graphs).map(function(type) {\n-                self.vm.statsData.charts[type].unload = true;\n-                if(type === 'shareDonutGraph') {\n-                    var count = data.charts.shareDonutGraph.columns.filter(function(val){return val[1] > 0;}).length;\n-                    $('.c3-chart-arcs-title').text(count + ' Provider' + (count !== 1 ? 's' : ''));\n-                }\n-                self.graphs[type].load(self.vm.statsData.charts[type]);\n-            });\n-            self.vm.statsLoaded(true);\n-        }).then(m.redraw);\n+    self.loadStats = function(){\n+        utils.loadStats(self.vm);\n     };\n \n     utils.onSearch(self.loadStats);","path":"website/static/js/share/stats.js","position":86,"original_position":86,"commit_id":"e32375d874fb8e7da9b4ef918f22a42dee2b72c1","original_commit_id":"638980bc0a14ded3857170f7f846026cc1434285","user":{"login":"fabianvf","id":2431974,"avatar_url":"https://avatars.githubusercontent.com/u/2431974?v=3","gravatar_id":"","url":"https://api.github.com/users/fabianvf","html_url":"https://github.com/fabianvf","followers_url":"https://api.github.com/users/fabianvf/followers","following_url":"https://api.github.com/users/fabianvf/following{/other_user}","gists_url":"https://api.github.com/users/fabianvf/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianvf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianvf/subscriptions","organizations_url":"https://api.github.com/users/fabianvf/orgs","repos_url":"https://api.github.com/users/fabianvf/repos","events_url":"https://api.github.com/users/fabianvf/events{/privacy}","received_events_url":"https://api.github.com/users/fabianvf/received_events","type":"User","site_admin":false},"body":"will it automatically pass in the vm?","created_at":"2015-03-23T19:28:01Z","updated_at":"2015-03-23T19:28:01Z","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/2217#discussion_r26970453","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2217","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/26970453"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/2217#discussion_r26970453"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2217"}}},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2217","id":31388248,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/2217","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/2217.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/2217.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/2217","number":2217,"state":"open","locked":false,"title":"Add a sidebar to the share search page","user":{"login":"fabianvf","id":2431974,"avatar_url":"https://avatars.githubusercontent.com/u/2431974?v=3","gravatar_id":"","url":"https://api.github.com/users/fabianvf","html_url":"https://github.com/fabianvf","followers_url":"https://api.github.com/users/fabianvf/followers","following_url":"https://api.github.com/users/fabianvf/following{/other_user}","gists_url":"https://api.github.com/users/fabianvf/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianvf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianvf/subscriptions","organizations_url":"https://api.github.com/users/fabianvf/orgs","repos_url":"https://api.github.com/users/fabianvf/repos","events_url":"https://api.github.com/users/fabianvf/events{/privacy}","received_events_url":"https://api.github.com/users/fabianvf/received_events","type":"User","site_admin":false},"body":"Purposes\r\n--------------\r\nUpdate functionality and prettiness of SHARE UI\r\n\r\nChanges\r\n-------------\r\n- [x] Add filters to a sidebar that allows filtering out providers\r\n- [x] Adds optional filters (via the providers on the right), as well as required filters (clicking the graph, clicking tags, clicking contributors)\r\n- [x] Add the filter lists and such to the history.js state, to make it easier to recreate state on page load\r\n- [x] Make the checkboxes populate on page load\r\n- [x] Get the sorting working \r\n  - [x] and make it a query parameter\r\n- [x] Make it pretty\r\n- [x] Graphs should not unload and should always display correct counts\r\n- [x] Stop results from rendering twice when being linked to a page with less than 10 results\r\n- [x] Fix safari setting the number of providers to 30 in the graph every time regardless of results\r\n\r\n\r\nSide effects\r\n----------------\r\nNone anticipated","created_at":"2015-03-17T23:28:32Z","updated_at":"2015-03-23T19:28:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d93476ca0c7b7480b4b2b9fbce3c93d1524feac","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2217/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2217/comments","review_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/2217/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/e32375d874fb8e7da9b4ef918f22a42dee2b72c1","head":{"label":"fabianvf:feature/share/UI","ref":"feature/share/UI","sha":"e32375d874fb8e7da9b4ef918f22a42dee2b72c1","user":{"login":"fabianvf","id":2431974,"avatar_url":"https://avatars.githubusercontent.com/u/2431974?v=3","gravatar_id":"","url":"https://api.github.com/users/fabianvf","html_url":"https://github.com/fabianvf","followers_url":"https://api.github.com/users/fabianvf/followers","following_url":"https://api.github.com/users/fabianvf/following{/other_user}","gists_url":"https://api.github.com/users/fabianvf/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianvf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianvf/subscriptions","organizations_url":"https://api.github.com/users/fabianvf/orgs","repos_url":"https://api.github.com/users/fabianvf/repos","events_url":"https://api.github.com/users/fabianvf/events{/privacy}","received_events_url":"https://api.github.com/users/fabianvf/received_events","type":"User","site_admin":false},"repo":{"id":26976354,"name":"osf.io","full_name":"fabianvf/osf.io","owner":{"login":"fabianvf","id":2431974,"avatar_url":"https://avatars.githubusercontent.com/u/2431974?v=3","gravatar_id":"","url":"https://api.github.com/users/fabianvf","html_url":"https://github.com/fabianvf","followers_url":"https://api.github.com/users/fabianvf/followers","following_url":"https://api.github.com/users/fabianvf/following{/other_user}","gists_url":"https://api.github.com/users/fabianvf/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianvf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianvf/subscriptions","organizations_url":"https://api.github.com/users/fabianvf/orgs","repos_url":"https://api.github.com/users/fabianvf/repos","events_url":"https://api.github.com/users/fabianvf/events{/privacy}","received_events_url":"https://api.github.com/users/fabianvf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fabianvf/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/fabianvf/osf.io","forks_url":"https://api.github.com/repos/fabianvf/osf.io/forks","keys_url":"https://api.github.com/repos/fabianvf/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabianvf/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabianvf/osf.io/teams","hooks_url":"https://api.github.com/repos/fabianvf/osf.io/hooks","issue_events_url":"https://api.github.com/repos/fabianvf/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/fabianvf/osf.io/events","assignees_url":"https://api.github.com/repos/fabianvf/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/fabianvf/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/fabianvf/osf.io/tags","blobs_url":"https://api.github.com/repos/fabianvf/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabianvf/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabianvf/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabianvf/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabianvf/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/fabianvf/osf.io/languages","stargazers_url":"https://api.github.com/repos/fabianvf/osf.io/stargazers","contributors_url":"https://api.github.com/repos/fabianvf/osf.io/contributors","subscribers_url":"https://api.github.com/repos/fabianvf/osf.io/subscribers","subscription_url":"https://api.github.com/repos/fabianvf/osf.io/subscription","commits_url":"https://api.github.com/repos/fabianvf/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabianvf/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabianvf/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabianvf/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabianvf/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/fabianvf/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabianvf/osf.io/merges","archive_url":"https://api.github.com/repos/fabianvf/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabianvf/osf.io/downloads","issues_url":"https://api.github.com/repos/fabianvf/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/fabianvf/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/fabianvf/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/fabianvf/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabianvf/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/fabianvf/osf.io/releases{/id}","created_at":"2014-11-21T20:18:30Z","updated_at":"2015-03-13T17:15:32Z","pushed_at":"2015-03-23T19:27:36Z","git_url":"git://github.com/fabianvf/osf.io.git","ssh_url":"git@github.com:fabianvf/osf.io.git","clone_url":"https://github.com/fabianvf/osf.io.git","svn_url":"https://github.com/fabianvf/osf.io","homepage":"http://osf.io","size":83032,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"CenterForOpenScience:develop","ref":"develop","sha":"1936d2fbe35d7bd1e3753d1eed05ecc43de64b1b","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"repo":{"id":10199599,"name":"osf.io","full_name":"CenterForOpenScience/osf.io","owner":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CenterForOpenScience/osf.io","description":"Facilitating Open Science","fork":false,"url":"https://api.github.com/repos/CenterForOpenScience/osf.io","forks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/forks","keys_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/teams","hooks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/hooks","issue_events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/events","assignees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/tags","blobs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/languages","stargazers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/stargazers","contributors_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contributors","subscribers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscribers","subscription_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscription","commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/merges","archive_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/downloads","issues_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/releases{/id}","created_at":"2013-05-21T15:53:37Z","updated_at":"2015-03-23T19:23:11Z","pushed_at":"2015-03-23T19:27:36Z","git_url":"git://github.com/CenterForOpenScience/osf.io.git","ssh_url":"git@github.com:CenterForOpenScience/osf.io.git","clone_url":"https://github.com/CenterForOpenScience/osf.io.git","svn_url":"https://github.com/CenterForOpenScience/osf.io","homepage":"http://osf.io","size":100889,"stargazers_count":85,"watchers_count":85,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":64,"mirror_url":null,"open_issues_count":369,"forks":64,"open_issues":369,"watchers":85,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2217"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/2217"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/2217"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/2217/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2217/comments"},"review_comment":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2217/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/e32375d874fb8e7da9b4ef918f22a42dee2b72c1"}}}}