{"action":"created","comment":{"url":"https://api.github.com/repos/bvaughn/react-flame-graph/pulls/comments/216132731","pull_request_review_id":153556339,"id":216132731,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNjEzMjczMQ==","diff_hunk":"@@ -9,19 +9,17 @@ const colorGradientLength = colorGradient.length;\n \n function getNodeBackgroundColor(value, maxValue) {\n   return backgroundColorGradient[\n-    Math.round(value / maxValue * (backgroundColorGradientLength - 1))\n+    Math.round((value / maxValue) * (backgroundColorGradientLength - 1))","path":"src/utils.js","position":5,"original_position":5,"commit_id":"7d93f4caa3fd46ae2a0fa68eb147e05f228796cd","original_commit_id":"12844f0cc0b7f3ab98150c7f4b5b8e54ad014a37","user":{"login":"bvaughn","id":29597,"node_id":"MDQ6VXNlcjI5NTk3","avatar_url":"https://avatars0.githubusercontent.com/u/29597?v=4","gravatar_id":"","url":"https://api.github.com/users/bvaughn","html_url":"https://github.com/bvaughn","followers_url":"https://api.github.com/users/bvaughn/followers","following_url":"https://api.github.com/users/bvaughn/following{/other_user}","gists_url":"https://api.github.com/users/bvaughn/gists{/gist_id}","starred_url":"https://api.github.com/users/bvaughn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvaughn/subscriptions","organizations_url":"https://api.github.com/users/bvaughn/orgs","repos_url":"https://api.github.com/users/bvaughn/repos","events_url":"https://api.github.com/users/bvaughn/events{/privacy}","received_events_url":"https://api.github.com/users/bvaughn/received_events","type":"User","site_admin":false},"body":"Oh! My bad then 😄 ","created_at":"2018-09-08T15:06:18Z","updated_at":"2018-09-08T15:06:18Z","html_url":"https://github.com/bvaughn/react-flame-graph/pull/17#discussion_r216132731","pull_request_url":"https://api.github.com/repos/bvaughn/react-flame-graph/pulls/17","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/bvaughn/react-flame-graph/pulls/comments/216132731"},"html":{"href":"https://github.com/bvaughn/react-flame-graph/pull/17#discussion_r216132731"},"pull_request":{"href":"https://api.github.com/repos/bvaughn/react-flame-graph/pulls/17"}},"in_reply_to_id":215299010},"pull_request":{"url":"https://api.github.com/repos/bvaughn/react-flame-graph/pulls/17","id":213149344,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzMTQ5MzQ0","html_url":"https://github.com/bvaughn/react-flame-graph/pull/17","diff_url":"https://github.com/bvaughn/react-flame-graph/pull/17.diff","patch_url":"https://github.com/bvaughn/react-flame-graph/pull/17.patch","issue_url":"https://api.github.com/repos/bvaughn/react-flame-graph/issues/17","number":17,"state":"open","locked":false,"title":"Add option for focusedId prop","user":{"login":"jgzuke","id":6856868,"node_id":"MDQ6VXNlcjY4NTY4Njg=","avatar_url":"https://avatars3.githubusercontent.com/u/6856868?v=4","gravatar_id":"","url":"https://api.github.com/users/jgzuke","html_url":"https://github.com/jgzuke","followers_url":"https://api.github.com/users/jgzuke/followers","following_url":"https://api.github.com/users/jgzuke/following{/other_user}","gists_url":"https://api.github.com/users/jgzuke/gists{/gist_id}","starred_url":"https://api.github.com/users/jgzuke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgzuke/subscriptions","organizations_url":"https://api.github.com/users/jgzuke/orgs","repos_url":"https://api.github.com/users/jgzuke/repos","events_url":"https://api.github.com/users/jgzuke/events{/privacy}","received_events_url":"https://api.github.com/users/jgzuke/received_events","type":"User","site_admin":false},"body":"Follow up to https://github.com/bvaughn/react-flame-graph/issues/16.\r\n\r\nAdded `focusedId` prop to `FlameGraph`. When this prop is modified it will set the `focusedNode` state. In order to pass an id, switched ids to be the path of indices representing the node. We only update state on prop modification to avoid reseting the state for irrelevant prop changes.\r\n\r\nIf we wanted to focus a node in the graph we would pass its id eg `focusedId='1/0/2'`.\r\n\r\nI wasn't sure what the right approach here was, the current approach implicitly relies on the ordering not changing in the data conversion so we know what our id will look like. However, I couldn't think of another way of uniquely identifying nodes from outside the component. One other option would be to optionally pass in our own uids ad keep track ourselves. Or we could leave the same ids as before but there would need to be a way to tell what the id for my given node is","created_at":"2018-09-05T02:03:18Z","updated_at":"2018-09-08T15:06:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dcd21386c98737ded7eeb5473d0bc76ab0fbb6b9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/bvaughn/react-flame-graph/pulls/17/commits","review_comments_url":"https://api.github.com/repos/bvaughn/react-flame-graph/pulls/17/comments","review_comment_url":"https://api.github.com/repos/bvaughn/react-flame-graph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bvaughn/react-flame-graph/issues/17/comments","statuses_url":"https://api.github.com/repos/bvaughn/react-flame-graph/statuses/7d93f4caa3fd46ae2a0fa68eb147e05f228796cd","head":{"label":"jgzuke:jgzuke-add-focusing","ref":"jgzuke-add-focusing","sha":"7d93f4caa3fd46ae2a0fa68eb147e05f228796cd","user":{"login":"jgzuke","id":6856868,"node_id":"MDQ6VXNlcjY4NTY4Njg=","avatar_url":"https://avatars3.githubusercontent.com/u/6856868?v=4","gravatar_id":"","url":"https://api.github.com/users/jgzuke","html_url":"https://github.com/jgzuke","followers_url":"https://api.github.com/users/jgzuke/followers","following_url":"https://api.github.com/users/jgzuke/following{/other_user}","gists_url":"https://api.github.com/users/jgzuke/gists{/gist_id}","starred_url":"https://api.github.com/users/jgzuke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgzuke/subscriptions","organizations_url":"https://api.github.com/users/jgzuke/orgs","repos_url":"https://api.github.com/users/jgzuke/repos","events_url":"https://api.github.com/users/jgzuke/events{/privacy}","received_events_url":"https://api.github.com/users/jgzuke/received_events","type":"User","site_admin":false},"repo":{"id":146248700,"node_id":"MDEwOlJlcG9zaXRvcnkxNDYyNDg3MDA=","name":"react-flame-graph","full_name":"jgzuke/react-flame-graph","owner":{"login":"jgzuke","id":6856868,"node_id":"MDQ6VXNlcjY4NTY4Njg=","avatar_url":"https://avatars3.githubusercontent.com/u/6856868?v=4","gravatar_id":"","url":"https://api.github.com/users/jgzuke","html_url":"https://github.com/jgzuke","followers_url":"https://api.github.com/users/jgzuke/followers","following_url":"https://api.github.com/users/jgzuke/following{/other_user}","gists_url":"https://api.github.com/users/jgzuke/gists{/gist_id}","starred_url":"https://api.github.com/users/jgzuke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgzuke/subscriptions","organizations_url":"https://api.github.com/users/jgzuke/orgs","repos_url":"https://api.github.com/users/jgzuke/repos","events_url":"https://api.github.com/users/jgzuke/events{/privacy}","received_events_url":"https://api.github.com/users/jgzuke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jgzuke/react-flame-graph","description":"React component for visualizing profiling data","fork":true,"url":"https://api.github.com/repos/jgzuke/react-flame-graph","forks_url":"https://api.github.com/repos/jgzuke/react-flame-graph/forks","keys_url":"https://api.github.com/repos/jgzuke/react-flame-graph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jgzuke/react-flame-graph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jgzuke/react-flame-graph/teams","hooks_url":"https://api.github.com/repos/jgzuke/react-flame-graph/hooks","issue_events_url":"https://api.github.com/repos/jgzuke/react-flame-graph/issues/events{/number}","events_url":"https://api.github.com/repos/jgzuke/react-flame-graph/events","assignees_url":"https://api.github.com/repos/jgzuke/react-flame-graph/assignees{/user}","branches_url":"https://api.github.com/repos/jgzuke/react-flame-graph/branches{/branch}","tags_url":"https://api.github.com/repos/jgzuke/react-flame-graph/tags","blobs_url":"https://api.github.com/repos/jgzuke/react-flame-graph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jgzuke/react-flame-graph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jgzuke/react-flame-graph/git/refs{/sha}","trees_url":"https://api.github.com/repos/jgzuke/react-flame-graph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jgzuke/react-flame-graph/statuses/{sha}","languages_url":"https://api.github.com/repos/jgzuke/react-flame-graph/languages","stargazers_url":"https://api.github.com/repos/jgzuke/react-flame-graph/stargazers","contributors_url":"https://api.github.com/repos/jgzuke/react-flame-graph/contributors","subscribers_url":"https://api.github.com/repos/jgzuke/react-flame-graph/subscribers","subscription_url":"https://api.github.com/repos/jgzuke/react-flame-graph/subscription","commits_url":"https://api.github.com/repos/jgzuke/react-flame-graph/commits{/sha}","git_commits_url":"https://api.github.com/repos/jgzuke/react-flame-graph/git/commits{/sha}","comments_url":"https://api.github.com/repos/jgzuke/react-flame-graph/comments{/number}","issue_comment_url":"https://api.github.com/repos/jgzuke/react-flame-graph/issues/comments{/number}","contents_url":"https://api.github.com/repos/jgzuke/react-flame-graph/contents/{+path}","compare_url":"https://api.github.com/repos/jgzuke/react-flame-graph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jgzuke/react-flame-graph/merges","archive_url":"https://api.github.com/repos/jgzuke/react-flame-graph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jgzuke/react-flame-graph/downloads","issues_url":"https://api.github.com/repos/jgzuke/react-flame-graph/issues{/number}","pulls_url":"https://api.github.com/repos/jgzuke/react-flame-graph/pulls{/number}","milestones_url":"https://api.github.com/repos/jgzuke/react-flame-graph/milestones{/number}","notifications_url":"https://api.github.com/repos/jgzuke/react-flame-graph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jgzuke/react-flame-graph/labels{/name}","releases_url":"https://api.github.com/repos/jgzuke/react-flame-graph/releases{/id}","deployments_url":"https://api.github.com/repos/jgzuke/react-flame-graph/deployments","created_at":"2018-08-27T04:58:05Z","updated_at":"2018-08-27T04:58:07Z","pushed_at":"2018-09-06T05:51:15Z","git_url":"git://github.com/jgzuke/react-flame-graph.git","ssh_url":"git@github.com:jgzuke/react-flame-graph.git","clone_url":"https://github.com/jgzuke/react-flame-graph.git","svn_url":"https://github.com/jgzuke/react-flame-graph","homepage":null,"size":297,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bvaughn:master","ref":"master","sha":"e3ba9748681e6c1458b1f0344533644078543732","user":{"login":"bvaughn","id":29597,"node_id":"MDQ6VXNlcjI5NTk3","avatar_url":"https://avatars0.githubusercontent.com/u/29597?v=4","gravatar_id":"","url":"https://api.github.com/users/bvaughn","html_url":"https://github.com/bvaughn","followers_url":"https://api.github.com/users/bvaughn/followers","following_url":"https://api.github.com/users/bvaughn/following{/other_user}","gists_url":"https://api.github.com/users/bvaughn/gists{/gist_id}","starred_url":"https://api.github.com/users/bvaughn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvaughn/subscriptions","organizations_url":"https://api.github.com/users/bvaughn/orgs","repos_url":"https://api.github.com/users/bvaughn/repos","events_url":"https://api.github.com/users/bvaughn/events{/privacy}","received_events_url":"https://api.github.com/users/bvaughn/received_events","type":"User","site_admin":false},"repo":{"id":140969947,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA5Njk5NDc=","name":"react-flame-graph","full_name":"bvaughn/react-flame-graph","owner":{"login":"bvaughn","id":29597,"node_id":"MDQ6VXNlcjI5NTk3","avatar_url":"https://avatars0.githubusercontent.com/u/29597?v=4","gravatar_id":"","url":"https://api.github.com/users/bvaughn","html_url":"https://github.com/bvaughn","followers_url":"https://api.github.com/users/bvaughn/followers","following_url":"https://api.github.com/users/bvaughn/following{/other_user}","gists_url":"https://api.github.com/users/bvaughn/gists{/gist_id}","starred_url":"https://api.github.com/users/bvaughn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvaughn/subscriptions","organizations_url":"https://api.github.com/users/bvaughn/orgs","repos_url":"https://api.github.com/users/bvaughn/repos","events_url":"https://api.github.com/users/bvaughn/events{/privacy}","received_events_url":"https://api.github.com/users/bvaughn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bvaughn/react-flame-graph","description":"React component for visualizing profiling data","fork":false,"url":"https://api.github.com/repos/bvaughn/react-flame-graph","forks_url":"https://api.github.com/repos/bvaughn/react-flame-graph/forks","keys_url":"https://api.github.com/repos/bvaughn/react-flame-graph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bvaughn/react-flame-graph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bvaughn/react-flame-graph/teams","hooks_url":"https://api.github.com/repos/bvaughn/react-flame-graph/hooks","issue_events_url":"https://api.github.com/repos/bvaughn/react-flame-graph/issues/events{/number}","events_url":"https://api.github.com/repos/bvaughn/react-flame-graph/events","assignees_url":"https://api.github.com/repos/bvaughn/react-flame-graph/assignees{/user}","branches_url":"https://api.github.com/repos/bvaughn/react-flame-graph/branches{/branch}","tags_url":"https://api.github.com/repos/bvaughn/react-flame-graph/tags","blobs_url":"https://api.github.com/repos/bvaughn/react-flame-graph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bvaughn/react-flame-graph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bvaughn/react-flame-graph/git/refs{/sha}","trees_url":"https://api.github.com/repos/bvaughn/react-flame-graph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bvaughn/react-flame-graph/statuses/{sha}","languages_url":"https://api.github.com/repos/bvaughn/react-flame-graph/languages","stargazers_url":"https://api.github.com/repos/bvaughn/react-flame-graph/stargazers","contributors_url":"https://api.github.com/repos/bvaughn/react-flame-graph/contributors","subscribers_url":"https://api.github.com/repos/bvaughn/react-flame-graph/subscribers","subscription_url":"https://api.github.com/repos/bvaughn/react-flame-graph/subscription","commits_url":"https://api.github.com/repos/bvaughn/react-flame-graph/commits{/sha}","git_commits_url":"https://api.github.com/repos/bvaughn/react-flame-graph/git/commits{/sha}","comments_url":"https://api.github.com/repos/bvaughn/react-flame-graph/comments{/number}","issue_comment_url":"https://api.github.com/repos/bvaughn/react-flame-graph/issues/comments{/number}","contents_url":"https://api.github.com/repos/bvaughn/react-flame-graph/contents/{+path}","compare_url":"https://api.github.com/repos/bvaughn/react-flame-graph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bvaughn/react-flame-graph/merges","archive_url":"https://api.github.com/repos/bvaughn/react-flame-graph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bvaughn/react-flame-graph/downloads","issues_url":"https://api.github.com/repos/bvaughn/react-flame-graph/issues{/number}","pulls_url":"https://api.github.com/repos/bvaughn/react-flame-graph/pulls{/number}","milestones_url":"https://api.github.com/repos/bvaughn/react-flame-graph/milestones{/number}","notifications_url":"https://api.github.com/repos/bvaughn/react-flame-graph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bvaughn/react-flame-graph/labels{/name}","releases_url":"https://api.github.com/repos/bvaughn/react-flame-graph/releases{/id}","deployments_url":"https://api.github.com/repos/bvaughn/react-flame-graph/deployments","created_at":"2018-07-14T18:45:58Z","updated_at":"2018-09-07T09:57:49Z","pushed_at":"2018-09-06T05:51:17Z","git_url":"git://github.com/bvaughn/react-flame-graph.git","ssh_url":"git@github.com:bvaughn/react-flame-graph.git","clone_url":"https://github.com/bvaughn/react-flame-graph.git","svn_url":"https://github.com/bvaughn/react-flame-graph","homepage":"https://react-flame-graph.now.sh/","size":292,"stargazers_count":235,"watchers_count":235,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":7,"license":null,"forks":9,"open_issues":7,"watchers":235,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bvaughn/react-flame-graph/pulls/17"},"html":{"href":"https://github.com/bvaughn/react-flame-graph/pull/17"},"issue":{"href":"https://api.github.com/repos/bvaughn/react-flame-graph/issues/17"},"comments":{"href":"https://api.github.com/repos/bvaughn/react-flame-graph/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/bvaughn/react-flame-graph/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/bvaughn/react-flame-graph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bvaughn/react-flame-graph/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/bvaughn/react-flame-graph/statuses/7d93f4caa3fd46ae2a0fa68eb147e05f228796cd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bvaughn"}}