{"action":"opened","number":263,"pull_request":{"url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/pulls/263","id":132542883,"html_url":"https://github.com/datasciencecampus/sdg-indicators/pull/263","diff_url":"https://github.com/datasciencecampus/sdg-indicators/pull/263.diff","patch_url":"https://github.com/datasciencecampus/sdg-indicators/pull/263.patch","issue_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/issues/263","number":263,"state":"open","locked":false,"title":"Automatic x axis scale on data updates","user":{"login":"shaneporter","id":2493614,"avatar_url":"https://avatars3.githubusercontent.com/u/2493614?v=4","gravatar_id":"","url":"https://api.github.com/users/shaneporter","html_url":"https://github.com/shaneporter","followers_url":"https://api.github.com/users/shaneporter/followers","following_url":"https://api.github.com/users/shaneporter/following{/other_user}","gists_url":"https://api.github.com/users/shaneporter/gists{/gist_id}","starred_url":"https://api.github.com/users/shaneporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaneporter/subscriptions","organizations_url":"https://api.github.com/users/shaneporter/orgs","repos_url":"https://api.github.com/users/shaneporter/repos","events_url":"https://api.github.com/users/shaneporter/events{/privacy}","received_events_url":"https://api.github.com/users/shaneporter/received_events","type":"User","site_admin":false},"body":"I had to write a plugin to update the scale when there are data updates.\r\n\r\nIn the plugin, initial scale data (`allLabels`) is stored in a variable. When datasets are added (initially, this will be the 'headline' values) they get an 'allData' property, assigned from their `data` property.\r\n\r\nWhen a chart update is made, the plugin examines the lower and lower ranges for each dataset that have defined values, and an overall 'min' and 'max' indexes across all datasets is derived.\r\n\r\nThis 'min'/'max' data is then used to do a JavaScript `slice` on the 'all' values, as well as the labels used on the x axis. These 'all' values and labels are retained and used again because the range can increase as well as decrease, so the full set needs to be available for `splice`ing.","created_at":"2017-07-26T15:19:55Z","updated_at":"2017-07-26T15:19:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/pulls/263/commits","review_comments_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/pulls/263/comments","review_comment_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/pulls/comments{/number}","comments_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/issues/263/comments","statuses_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/statuses/1ac56cb642a75dc6f300dd64f7811549afdfe7e3","head":{"label":"datasciencecampus:e/197","ref":"e/197","sha":"1ac56cb642a75dc6f300dd64f7811549afdfe7e3","user":{"login":"datasciencecampus","id":25666867,"avatar_url":"https://avatars1.githubusercontent.com/u/25666867?v=4","gravatar_id":"","url":"https://api.github.com/users/datasciencecampus","html_url":"https://github.com/datasciencecampus","followers_url":"https://api.github.com/users/datasciencecampus/followers","following_url":"https://api.github.com/users/datasciencecampus/following{/other_user}","gists_url":"https://api.github.com/users/datasciencecampus/gists{/gist_id}","starred_url":"https://api.github.com/users/datasciencecampus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datasciencecampus/subscriptions","organizations_url":"https://api.github.com/users/datasciencecampus/orgs","repos_url":"https://api.github.com/users/datasciencecampus/repos","events_url":"https://api.github.com/users/datasciencecampus/events{/privacy}","received_events_url":"https://api.github.com/users/datasciencecampus/received_events","type":"Organization","site_admin":false},"repo":{"id":72210114,"name":"sdg-indicators","full_name":"datasciencecampus/sdg-indicators","owner":{"login":"datasciencecampus","id":25666867,"avatar_url":"https://avatars1.githubusercontent.com/u/25666867?v=4","gravatar_id":"","url":"https://api.github.com/users/datasciencecampus","html_url":"https://github.com/datasciencecampus","followers_url":"https://api.github.com/users/datasciencecampus/followers","following_url":"https://api.github.com/users/datasciencecampus/following{/other_user}","gists_url":"https://api.github.com/users/datasciencecampus/gists{/gist_id}","starred_url":"https://api.github.com/users/datasciencecampus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datasciencecampus/subscriptions","organizations_url":"https://api.github.com/users/datasciencecampus/orgs","repos_url":"https://api.github.com/users/datasciencecampus/repos","events_url":"https://api.github.com/users/datasciencecampus/events{/privacy}","received_events_url":"https://api.github.com/users/datasciencecampus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datasciencecampus/sdg-indicators","description":"Development website for collecting and disseminating UK data for the Sustainable Development Goal global indicators","fork":true,"url":"https://api.github.com/repos/datasciencecampus/sdg-indicators","forks_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/forks","keys_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/teams","hooks_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/hooks","issue_events_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/issues/events{/number}","events_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/events","assignees_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/assignees{/user}","branches_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/branches{/branch}","tags_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/tags","blobs_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/git/refs{/sha}","trees_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/statuses/{sha}","languages_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/languages","stargazers_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/stargazers","contributors_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/contributors","subscribers_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/subscribers","subscription_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/subscription","commits_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/commits{/sha}","git_commits_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/git/commits{/sha}","comments_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/comments{/number}","issue_comment_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/issues/comments{/number}","contents_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/contents/{+path}","compare_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/merges","archive_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/downloads","issues_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/issues{/number}","pulls_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/pulls{/number}","milestones_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/milestones{/number}","notifications_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/labels{/name}","releases_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/releases{/id}","deployments_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/deployments","created_at":"2016-10-28T13:32:58Z","updated_at":"2017-05-08T18:57:42Z","pushed_at":"2017-07-26T15:02:36Z","git_url":"git://github.com/datasciencecampus/sdg-indicators.git","ssh_url":"git@github.com:datasciencecampus/sdg-indicators.git","clone_url":"https://github.com/datasciencecampus/sdg-indicators.git","svn_url":"https://github.com/datasciencecampus/sdg-indicators","homepage":"https://datasciencecampus.github.io/sdg-indicators/","size":9306,"stargazers_count":3,"watchers_count":3,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":11,"mirror_url":null,"open_issues_count":48,"forks":11,"open_issues":48,"watchers":3,"default_branch":"gh-pages"}},"base":{"label":"datasciencecampus:gh-pages","ref":"gh-pages","sha":"7c912cf42a36c8b6435f0db83d2f54f645a58dd6","user":{"login":"datasciencecampus","id":25666867,"avatar_url":"https://avatars1.githubusercontent.com/u/25666867?v=4","gravatar_id":"","url":"https://api.github.com/users/datasciencecampus","html_url":"https://github.com/datasciencecampus","followers_url":"https://api.github.com/users/datasciencecampus/followers","following_url":"https://api.github.com/users/datasciencecampus/following{/other_user}","gists_url":"https://api.github.com/users/datasciencecampus/gists{/gist_id}","starred_url":"https://api.github.com/users/datasciencecampus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datasciencecampus/subscriptions","organizations_url":"https://api.github.com/users/datasciencecampus/orgs","repos_url":"https://api.github.com/users/datasciencecampus/repos","events_url":"https://api.github.com/users/datasciencecampus/events{/privacy}","received_events_url":"https://api.github.com/users/datasciencecampus/received_events","type":"Organization","site_admin":false},"repo":{"id":72210114,"name":"sdg-indicators","full_name":"datasciencecampus/sdg-indicators","owner":{"login":"datasciencecampus","id":25666867,"avatar_url":"https://avatars1.githubusercontent.com/u/25666867?v=4","gravatar_id":"","url":"https://api.github.com/users/datasciencecampus","html_url":"https://github.com/datasciencecampus","followers_url":"https://api.github.com/users/datasciencecampus/followers","following_url":"https://api.github.com/users/datasciencecampus/following{/other_user}","gists_url":"https://api.github.com/users/datasciencecampus/gists{/gist_id}","starred_url":"https://api.github.com/users/datasciencecampus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datasciencecampus/subscriptions","organizations_url":"https://api.github.com/users/datasciencecampus/orgs","repos_url":"https://api.github.com/users/datasciencecampus/repos","events_url":"https://api.github.com/users/datasciencecampus/events{/privacy}","received_events_url":"https://api.github.com/users/datasciencecampus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datasciencecampus/sdg-indicators","description":"Development website for collecting and disseminating UK data for the Sustainable Development Goal global indicators","fork":true,"url":"https://api.github.com/repos/datasciencecampus/sdg-indicators","forks_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/forks","keys_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/teams","hooks_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/hooks","issue_events_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/issues/events{/number}","events_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/events","assignees_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/assignees{/user}","branches_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/branches{/branch}","tags_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/tags","blobs_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/git/refs{/sha}","trees_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/statuses/{sha}","languages_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/languages","stargazers_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/stargazers","contributors_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/contributors","subscribers_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/subscribers","subscription_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/subscription","commits_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/commits{/sha}","git_commits_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/git/commits{/sha}","comments_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/comments{/number}","issue_comment_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/issues/comments{/number}","contents_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/contents/{+path}","compare_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/merges","archive_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/downloads","issues_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/issues{/number}","pulls_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/pulls{/number}","milestones_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/milestones{/number}","notifications_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/labels{/name}","releases_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/releases{/id}","deployments_url":"https://api.github.com/repos/datasciencecampus/sdg-indicators/deployments","created_at":"2016-10-28T13:32:58Z","updated_at":"2017-05-08T18:57:42Z","pushed_at":"2017-07-26T15:02:36Z","git_url":"git://github.com/datasciencecampus/sdg-indicators.git","ssh_url":"git@github.com:datasciencecampus/sdg-indicators.git","clone_url":"https://github.com/datasciencecampus/sdg-indicators.git","svn_url":"https://github.com/datasciencecampus/sdg-indicators","homepage":"https://datasciencecampus.github.io/sdg-indicators/","size":9306,"stargazers_count":3,"watchers_count":3,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":11,"mirror_url":null,"open_issues_count":48,"forks":11,"open_issues":48,"watchers":3,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/datasciencecampus/sdg-indicators/pulls/263"},"html":{"href":"https://github.com/datasciencecampus/sdg-indicators/pull/263"},"issue":{"href":"https://api.github.com/repos/datasciencecampus/sdg-indicators/issues/263"},"comments":{"href":"https://api.github.com/repos/datasciencecampus/sdg-indicators/issues/263/comments"},"review_comments":{"href":"https://api.github.com/repos/datasciencecampus/sdg-indicators/pulls/263/comments"},"review_comment":{"href":"https://api.github.com/repos/datasciencecampus/sdg-indicators/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/datasciencecampus/sdg-indicators/pulls/263/commits"},"statuses":{"href":"https://api.github.com/repos/datasciencecampus/sdg-indicators/statuses/1ac56cb642a75dc6f300dd64f7811549afdfe7e3"}},"merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":5,"additions":57,"deletions":4,"changed_files":6}}
{"actor":{"display_login":"shaneporter"}}