{"action":"created","comment":{"url":"https://api.github.com/repos/nengo/nengo_gui/pulls/comments/42680113","id":42680113,"diff_hunk":"@@ -56,6 +56,27 @@ Nengo.Value = function(parent, sim, args) {\n     this.on_resize(this.get_screen_width(), this.get_screen_height());\n     this.axes2d.axis_y.tickValues([args.min_value, args.max_value]);\n     this.axes2d.fit_ticks(this);\n+\n+    this.colors = Nengo.make_colors(6);\n+    this.color_func = function(d, i) {return self.colors[i % 6]};\n+    this.legend = document.createElement('div');\n+    this.legend.classList.add('legend');\n+    this.div.appendChild(this.legend);\n+\n+    this.legend_labels = args.legend_labels || [];\n+    if(this.legend_labels.length !== this.n_lines){\n+        // fill up an array with temporary labels\n+        for(i=0; i<this.n_lines; i++){\n+            if(this.legend_labels[i] === undefined){","path":"nengo_gui/static/components/value.js","position":15,"original_position":15,"commit_id":"ed0adfc0924a1dbf51132e8e5db853aa13dc67eb","original_commit_id":"ed0adfc0924a1dbf51132e8e5db853aa13dc67eb","user":{"login":"tcstewar","id":2380772,"avatar_url":"https://avatars.githubusercontent.com/u/2380772?v=3","gravatar_id":"","url":"https://api.github.com/users/tcstewar","html_url":"https://github.com/tcstewar","followers_url":"https://api.github.com/users/tcstewar/followers","following_url":"https://api.github.com/users/tcstewar/following{/other_user}","gists_url":"https://api.github.com/users/tcstewar/gists{/gist_id}","starred_url":"https://api.github.com/users/tcstewar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcstewar/subscriptions","organizations_url":"https://api.github.com/users/tcstewar/orgs","repos_url":"https://api.github.com/users/tcstewar/repos","events_url":"https://api.github.com/users/tcstewar/events{/privacy}","received_events_url":"https://api.github.com/users/tcstewar/received_events","type":"User","site_admin":false},"body":"Why not ```for (var i=this.legend_labels.length; i<this.n_lines; i++)``` and get rid of the undefined check?","created_at":"2015-10-21T20:47:57Z","updated_at":"2015-10-21T20:47:57Z","html_url":"https://github.com/nengo/nengo_gui/pull/565#discussion_r42680113","pull_request_url":"https://api.github.com/repos/nengo/nengo_gui/pulls/565","_links":{"self":{"href":"https://api.github.com/repos/nengo/nengo_gui/pulls/comments/42680113"},"html":{"href":"https://github.com/nengo/nengo_gui/pull/565#discussion_r42680113"},"pull_request":{"href":"https://api.github.com/repos/nengo/nengo_gui/pulls/565"}}},"pull_request":{"url":"https://api.github.com/repos/nengo/nengo_gui/pulls/565","id":46716638,"html_url":"https://github.com/nengo/nengo_gui/pull/565","diff_url":"https://github.com/nengo/nengo_gui/pull/565.diff","patch_url":"https://github.com/nengo/nengo_gui/pull/565.patch","issue_url":"https://api.github.com/repos/nengo/nengo_gui/issues/565","number":565,"state":"open","locked":false,"title":"Value legend","user":{"login":"Seanny123","id":1918825,"avatar_url":"https://avatars.githubusercontent.com/u/1918825?v=3","gravatar_id":"","url":"https://api.github.com/users/Seanny123","html_url":"https://github.com/Seanny123","followers_url":"https://api.github.com/users/Seanny123/followers","following_url":"https://api.github.com/users/Seanny123/following{/other_user}","gists_url":"https://api.github.com/users/Seanny123/gists{/gist_id}","starred_url":"https://api.github.com/users/Seanny123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Seanny123/subscriptions","organizations_url":"https://api.github.com/users/Seanny123/orgs","repos_url":"https://api.github.com/users/Seanny123/repos","events_url":"https://api.github.com/users/Seanny123/events{/privacy}","received_events_url":"https://api.github.com/users/Seanny123/received_events","type":"User","site_admin":false},"body":"Added labels to the value plot and the ability to edit them. This is an intermediary step to allowing the basal-ganglia to have it's own specialised plot.","created_at":"2015-10-04T00:53:20Z","updated_at":"2015-10-21T20:47:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d32aced379226321bbcfa7e008e59cceb3d1c0b2","assignee":null,"milestone":{"url":"https://api.github.com/repos/nengo/nengo_gui/milestones/6","html_url":"https://github.com/nengo/nengo_gui/milestones/0.2%20release","labels_url":"https://api.github.com/repos/nengo/nengo_gui/milestones/6/labels","id":1197167,"number":6,"title":"0.2 release","description":"","creator":{"login":"tcstewar","id":2380772,"avatar_url":"https://avatars.githubusercontent.com/u/2380772?v=3","gravatar_id":"","url":"https://api.github.com/users/tcstewar","html_url":"https://github.com/tcstewar","followers_url":"https://api.github.com/users/tcstewar/followers","following_url":"https://api.github.com/users/tcstewar/following{/other_user}","gists_url":"https://api.github.com/users/tcstewar/gists{/gist_id}","starred_url":"https://api.github.com/users/tcstewar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcstewar/subscriptions","organizations_url":"https://api.github.com/users/tcstewar/orgs","repos_url":"https://api.github.com/users/tcstewar/repos","events_url":"https://api.github.com/users/tcstewar/events{/privacy}","received_events_url":"https://api.github.com/users/tcstewar/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":30,"state":"open","created_at":"2015-07-07T17:02:22Z","updated_at":"2015-10-20T01:37:52Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/nengo/nengo_gui/pulls/565/commits","review_comments_url":"https://api.github.com/repos/nengo/nengo_gui/pulls/565/comments","review_comment_url":"https://api.github.com/repos/nengo/nengo_gui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nengo/nengo_gui/issues/565/comments","statuses_url":"https://api.github.com/repos/nengo/nengo_gui/statuses/ed0adfc0924a1dbf51132e8e5db853aa13dc67eb","head":{"label":"nengo:value-legend","ref":"value-legend","sha":"ed0adfc0924a1dbf51132e8e5db853aa13dc67eb","user":{"login":"nengo","id":9197486,"avatar_url":"https://avatars.githubusercontent.com/u/9197486?v=3","gravatar_id":"","url":"https://api.github.com/users/nengo","html_url":"https://github.com/nengo","followers_url":"https://api.github.com/users/nengo/followers","following_url":"https://api.github.com/users/nengo/following{/other_user}","gists_url":"https://api.github.com/users/nengo/gists{/gist_id}","starred_url":"https://api.github.com/users/nengo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nengo/subscriptions","organizations_url":"https://api.github.com/users/nengo/orgs","repos_url":"https://api.github.com/users/nengo/repos","events_url":"https://api.github.com/users/nengo/events{/privacy}","received_events_url":"https://api.github.com/users/nengo/received_events","type":"Organization","site_admin":false},"repo":{"id":28949681,"name":"nengo_gui","full_name":"nengo/nengo_gui","owner":{"login":"nengo","id":9197486,"avatar_url":"https://avatars.githubusercontent.com/u/9197486?v=3","gravatar_id":"","url":"https://api.github.com/users/nengo","html_url":"https://github.com/nengo","followers_url":"https://api.github.com/users/nengo/followers","following_url":"https://api.github.com/users/nengo/following{/other_user}","gists_url":"https://api.github.com/users/nengo/gists{/gist_id}","starred_url":"https://api.github.com/users/nengo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nengo/subscriptions","organizations_url":"https://api.github.com/users/nengo/orgs","repos_url":"https://api.github.com/users/nengo/repos","events_url":"https://api.github.com/users/nengo/events{/privacy}","received_events_url":"https://api.github.com/users/nengo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nengo/nengo_gui","description":"Nengo interactive visualizer","fork":false,"url":"https://api.github.com/repos/nengo/nengo_gui","forks_url":"https://api.github.com/repos/nengo/nengo_gui/forks","keys_url":"https://api.github.com/repos/nengo/nengo_gui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nengo/nengo_gui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nengo/nengo_gui/teams","hooks_url":"https://api.github.com/repos/nengo/nengo_gui/hooks","issue_events_url":"https://api.github.com/repos/nengo/nengo_gui/issues/events{/number}","events_url":"https://api.github.com/repos/nengo/nengo_gui/events","assignees_url":"https://api.github.com/repos/nengo/nengo_gui/assignees{/user}","branches_url":"https://api.github.com/repos/nengo/nengo_gui/branches{/branch}","tags_url":"https://api.github.com/repos/nengo/nengo_gui/tags","blobs_url":"https://api.github.com/repos/nengo/nengo_gui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nengo/nengo_gui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nengo/nengo_gui/git/refs{/sha}","trees_url":"https://api.github.com/repos/nengo/nengo_gui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nengo/nengo_gui/statuses/{sha}","languages_url":"https://api.github.com/repos/nengo/nengo_gui/languages","stargazers_url":"https://api.github.com/repos/nengo/nengo_gui/stargazers","contributors_url":"https://api.github.com/repos/nengo/nengo_gui/contributors","subscribers_url":"https://api.github.com/repos/nengo/nengo_gui/subscribers","subscription_url":"https://api.github.com/repos/nengo/nengo_gui/subscription","commits_url":"https://api.github.com/repos/nengo/nengo_gui/commits{/sha}","git_commits_url":"https://api.github.com/repos/nengo/nengo_gui/git/commits{/sha}","comments_url":"https://api.github.com/repos/nengo/nengo_gui/comments{/number}","issue_comment_url":"https://api.github.com/repos/nengo/nengo_gui/issues/comments{/number}","contents_url":"https://api.github.com/repos/nengo/nengo_gui/contents/{+path}","compare_url":"https://api.github.com/repos/nengo/nengo_gui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nengo/nengo_gui/merges","archive_url":"https://api.github.com/repos/nengo/nengo_gui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nengo/nengo_gui/downloads","issues_url":"https://api.github.com/repos/nengo/nengo_gui/issues{/number}","pulls_url":"https://api.github.com/repos/nengo/nengo_gui/pulls{/number}","milestones_url":"https://api.github.com/repos/nengo/nengo_gui/milestones{/number}","notifications_url":"https://api.github.com/repos/nengo/nengo_gui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nengo/nengo_gui/labels{/name}","releases_url":"https://api.github.com/repos/nengo/nengo_gui/releases{/id}","created_at":"2015-01-08T05:00:06Z","updated_at":"2015-10-10T05:21:46Z","pushed_at":"2015-10-21T19:28:11Z","git_url":"git://github.com/nengo/nengo_gui.git","ssh_url":"git@github.com:nengo/nengo_gui.git","clone_url":"https://github.com/nengo/nengo_gui.git","svn_url":"https://github.com/nengo/nengo_gui","homepage":"","size":9196,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":174,"forks":4,"open_issues":174,"watchers":9,"default_branch":"master"}},"base":{"label":"nengo:master","ref":"master","sha":"bbf818e5dbb71d787c43b16af69ae834aef20a7f","user":{"login":"nengo","id":9197486,"avatar_url":"https://avatars.githubusercontent.com/u/9197486?v=3","gravatar_id":"","url":"https://api.github.com/users/nengo","html_url":"https://github.com/nengo","followers_url":"https://api.github.com/users/nengo/followers","following_url":"https://api.github.com/users/nengo/following{/other_user}","gists_url":"https://api.github.com/users/nengo/gists{/gist_id}","starred_url":"https://api.github.com/users/nengo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nengo/subscriptions","organizations_url":"https://api.github.com/users/nengo/orgs","repos_url":"https://api.github.com/users/nengo/repos","events_url":"https://api.github.com/users/nengo/events{/privacy}","received_events_url":"https://api.github.com/users/nengo/received_events","type":"Organization","site_admin":false},"repo":{"id":28949681,"name":"nengo_gui","full_name":"nengo/nengo_gui","owner":{"login":"nengo","id":9197486,"avatar_url":"https://avatars.githubusercontent.com/u/9197486?v=3","gravatar_id":"","url":"https://api.github.com/users/nengo","html_url":"https://github.com/nengo","followers_url":"https://api.github.com/users/nengo/followers","following_url":"https://api.github.com/users/nengo/following{/other_user}","gists_url":"https://api.github.com/users/nengo/gists{/gist_id}","starred_url":"https://api.github.com/users/nengo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nengo/subscriptions","organizations_url":"https://api.github.com/users/nengo/orgs","repos_url":"https://api.github.com/users/nengo/repos","events_url":"https://api.github.com/users/nengo/events{/privacy}","received_events_url":"https://api.github.com/users/nengo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nengo/nengo_gui","description":"Nengo interactive visualizer","fork":false,"url":"https://api.github.com/repos/nengo/nengo_gui","forks_url":"https://api.github.com/repos/nengo/nengo_gui/forks","keys_url":"https://api.github.com/repos/nengo/nengo_gui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nengo/nengo_gui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nengo/nengo_gui/teams","hooks_url":"https://api.github.com/repos/nengo/nengo_gui/hooks","issue_events_url":"https://api.github.com/repos/nengo/nengo_gui/issues/events{/number}","events_url":"https://api.github.com/repos/nengo/nengo_gui/events","assignees_url":"https://api.github.com/repos/nengo/nengo_gui/assignees{/user}","branches_url":"https://api.github.com/repos/nengo/nengo_gui/branches{/branch}","tags_url":"https://api.github.com/repos/nengo/nengo_gui/tags","blobs_url":"https://api.github.com/repos/nengo/nengo_gui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nengo/nengo_gui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nengo/nengo_gui/git/refs{/sha}","trees_url":"https://api.github.com/repos/nengo/nengo_gui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nengo/nengo_gui/statuses/{sha}","languages_url":"https://api.github.com/repos/nengo/nengo_gui/languages","stargazers_url":"https://api.github.com/repos/nengo/nengo_gui/stargazers","contributors_url":"https://api.github.com/repos/nengo/nengo_gui/contributors","subscribers_url":"https://api.github.com/repos/nengo/nengo_gui/subscribers","subscription_url":"https://api.github.com/repos/nengo/nengo_gui/subscription","commits_url":"https://api.github.com/repos/nengo/nengo_gui/commits{/sha}","git_commits_url":"https://api.github.com/repos/nengo/nengo_gui/git/commits{/sha}","comments_url":"https://api.github.com/repos/nengo/nengo_gui/comments{/number}","issue_comment_url":"https://api.github.com/repos/nengo/nengo_gui/issues/comments{/number}","contents_url":"https://api.github.com/repos/nengo/nengo_gui/contents/{+path}","compare_url":"https://api.github.com/repos/nengo/nengo_gui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nengo/nengo_gui/merges","archive_url":"https://api.github.com/repos/nengo/nengo_gui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nengo/nengo_gui/downloads","issues_url":"https://api.github.com/repos/nengo/nengo_gui/issues{/number}","pulls_url":"https://api.github.com/repos/nengo/nengo_gui/pulls{/number}","milestones_url":"https://api.github.com/repos/nengo/nengo_gui/milestones{/number}","notifications_url":"https://api.github.com/repos/nengo/nengo_gui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nengo/nengo_gui/labels{/name}","releases_url":"https://api.github.com/repos/nengo/nengo_gui/releases{/id}","created_at":"2015-01-08T05:00:06Z","updated_at":"2015-10-10T05:21:46Z","pushed_at":"2015-10-21T19:28:11Z","git_url":"git://github.com/nengo/nengo_gui.git","ssh_url":"git@github.com:nengo/nengo_gui.git","clone_url":"https://github.com/nengo/nengo_gui.git","svn_url":"https://github.com/nengo/nengo_gui","homepage":"","size":9196,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":174,"forks":4,"open_issues":174,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nengo/nengo_gui/pulls/565"},"html":{"href":"https://github.com/nengo/nengo_gui/pull/565"},"issue":{"href":"https://api.github.com/repos/nengo/nengo_gui/issues/565"},"comments":{"href":"https://api.github.com/repos/nengo/nengo_gui/issues/565/comments"},"review_comments":{"href":"https://api.github.com/repos/nengo/nengo_gui/pulls/565/comments"},"review_comment":{"href":"https://api.github.com/repos/nengo/nengo_gui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nengo/nengo_gui/pulls/565/commits"},"statuses":{"href":"https://api.github.com/repos/nengo/nengo_gui/statuses/ed0adfc0924a1dbf51132e8e5db853aa13dc67eb"}}}}