{"action":"created","comment":{"url":"https://api.github.com/repos/devtools-html/perf.html/pulls/comments/189445451","pull_request_review_id":121630110,"id":189445451,"diff_hunk":"@@ -99,42 +105,31 @@ export default class ChartCanvas<HoveredItem> extends React.Component<\n     }\n   }\n \n-  _hoveredItemFromMouseEvent(event: SyntheticMouseEvent<>): HoveredItem | null {\n-    if (!this._canvas) {\n-      throw new Error('Canvas ref not set');\n+  _onMouseDown() {\n+    if (this.props.onMouseDown) {\n+      this.props.onMouseDown(this.state.hoveredItem);\n     }\n-\n-    const rect = this._canvas.getBoundingClientRect();\n-    const x: CssPixels = event.pageX - rect.left;\n-    const y: CssPixels = event.pageY - rect.top;\n-\n-    return this.props.hitTest(x, y);\n-  }\n-\n-  _onMouseDown(event: SyntheticMouseEvent<>) {\n-    if (!this._canvas || !this.props.onMouseDown) {\n-      return;\n-    }\n-\n-    const maybeHoveredItem =\n-      this.state.hoveredItem === null\n-        ? this._hoveredItemFromMouseEvent(event)\n-        : this.state.hoveredItem;\n-    this.props.onMouseDown(maybeHoveredItem);\n   }\n \n   _onMouseMove(event: SyntheticMouseEvent<>) {\n     if (!this._canvas) {\n       return;\n     }\n \n-    const maybeHoveredItem = this._hoveredItemFromMouseEvent(event);\n+    // These offsets seem to be identical to\n+    // `event.nativeEvent.offsetX/Y`, albeit not recognized by flow.\n+    const rect = this._canvas.getBoundingClientRect();\n+    const offsetX: CssPixels = event.pageX - rect.left;\n+    const offsetY: CssPixels = event.pageY - rect.top;\n+    const maybeHoveredItem = this.props.hitTest(offsetX, offsetY);\n \n     if (maybeHoveredItem !== null) {\n       this.setState({\n         hoveredItem: maybeHoveredItem,\n-        mouseX: event.pageX,\n-        mouseY: event.pageY,\n+        pageX: event.pageX,\n+        pageY: event.pageY,\n+        offsetX,\n+        offsetY,","path":"src/components/shared/chart/Canvas.js","position":82,"original_position":82,"commit_id":"32de13387b83d7242ea85905220a2e77ab424a62","original_commit_id":"32de13387b83d7242ea85905220a2e77ab424a62","user":{"login":"brisad","id":1911402,"avatar_url":"https://avatars3.githubusercontent.com/u/1911402?v=4","gravatar_id":"","url":"https://api.github.com/users/brisad","html_url":"https://github.com/brisad","followers_url":"https://api.github.com/users/brisad/followers","following_url":"https://api.github.com/users/brisad/following{/other_user}","gists_url":"https://api.github.com/users/brisad/gists{/gist_id}","starred_url":"https://api.github.com/users/brisad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brisad/subscriptions","organizations_url":"https://api.github.com/users/brisad/orgs","repos_url":"https://api.github.com/users/brisad/repos","events_url":"https://api.github.com/users/brisad/events{/privacy}","received_events_url":"https://api.github.com/users/brisad/received_events","type":"User","site_admin":false},"body":"Oh, I missed that; I considered the offsets to be almost the same thing as `pageX/Y` and thus just put them together in the state. But I agree with you it's better to use the the more correct way.","created_at":"2018-05-19T21:37:42Z","updated_at":"2018-05-19T21:37:42Z","html_url":"https://github.com/devtools-html/perf.html/pull/1000#discussion_r189445451","pull_request_url":"https://api.github.com/repos/devtools-html/perf.html/pulls/1000","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/devtools-html/perf.html/pulls/comments/189445451"},"html":{"href":"https://github.com/devtools-html/perf.html/pull/1000#discussion_r189445451"},"pull_request":{"href":"https://api.github.com/repos/devtools-html/perf.html/pulls/1000"}},"in_reply_to_id":188010902},"pull_request":{"url":"https://api.github.com/repos/devtools-html/perf.html/pulls/1000","id":187553535,"html_url":"https://github.com/devtools-html/perf.html/pull/1000","diff_url":"https://github.com/devtools-html/perf.html/pull/1000.diff","patch_url":"https://github.com/devtools-html/perf.html/pull/1000.patch","issue_url":"https://api.github.com/repos/devtools-html/perf.html/issues/1000","number":1000,"state":"open","locked":false,"title":"Add JS origin information to flame graph tooltips (Fixes #964)","user":{"login":"brisad","id":1911402,"avatar_url":"https://avatars3.githubusercontent.com/u/1911402?v=4","gravatar_id":"","url":"https://api.github.com/users/brisad","html_url":"https://github.com/brisad","followers_url":"https://api.github.com/users/brisad/followers","following_url":"https://api.github.com/users/brisad/following{/other_user}","gists_url":"https://api.github.com/users/brisad/gists{/gist_id}","starred_url":"https://api.github.com/users/brisad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brisad/subscriptions","organizations_url":"https://api.github.com/users/brisad/orgs","repos_url":"https://api.github.com/users/brisad/repos","events_url":"https://api.github.com/users/brisad/events{/privacy}","received_events_url":"https://api.github.com/users/brisad/received_events","type":"User","site_admin":false},"body":"This shows the favicon and URL in the tooltip, (or the lib path if it's a native stack frame).\r\n\r\nA few changes are introduced in order to make the extended tooltips work.\r\n\r\nFirst, the formatting of the data to display in the tooltip has been removed from the calculation of the flame graph timing data structure. Instead it is done when the tooltip is shown. This speeds up the flame graph considerably since the display data does no need to be unnecessarily created for every box in the flame graph. \r\n\r\nSecond, the rendering of the favicon uses the NodeIcon component originally under the calltree subdirectory, but has now been moved to the shared directory.  Along with this, the class name `treeRowIcon` is now called `nodeIcon`.\r\n\r\nThird, to stop the tooltip from disappearing when the NodeIcon component asynchronously loads an icon, the clearing of hovered items are yet again modified. Now the hovered item is only cleared when the new hovered item would be something different from the current one.","created_at":"2018-05-11T19:45:50Z","updated_at":"2018-05-19T21:37:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bcf22b8a34956e71658d1b0d034dafe138106088","assignee":null,"assignees":[],"requested_reviewers":[{"login":"gregtatum","id":1588648,"avatar_url":"https://avatars3.githubusercontent.com/u/1588648?v=4","gravatar_id":"","url":"https://api.github.com/users/gregtatum","html_url":"https://github.com/gregtatum","followers_url":"https://api.github.com/users/gregtatum/followers","following_url":"https://api.github.com/users/gregtatum/following{/other_user}","gists_url":"https://api.github.com/users/gregtatum/gists{/gist_id}","starred_url":"https://api.github.com/users/gregtatum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregtatum/subscriptions","organizations_url":"https://api.github.com/users/gregtatum/orgs","repos_url":"https://api.github.com/users/gregtatum/repos","events_url":"https://api.github.com/users/gregtatum/events{/privacy}","received_events_url":"https://api.github.com/users/gregtatum/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/devtools-html/perf.html/pulls/1000/commits","review_comments_url":"https://api.github.com/repos/devtools-html/perf.html/pulls/1000/comments","review_comment_url":"https://api.github.com/repos/devtools-html/perf.html/pulls/comments{/number}","comments_url":"https://api.github.com/repos/devtools-html/perf.html/issues/1000/comments","statuses_url":"https://api.github.com/repos/devtools-html/perf.html/statuses/32de13387b83d7242ea85905220a2e77ab424a62","head":{"label":"brisad:js-origin-tooltip","ref":"js-origin-tooltip","sha":"32de13387b83d7242ea85905220a2e77ab424a62","user":{"login":"brisad","id":1911402,"avatar_url":"https://avatars3.githubusercontent.com/u/1911402?v=4","gravatar_id":"","url":"https://api.github.com/users/brisad","html_url":"https://github.com/brisad","followers_url":"https://api.github.com/users/brisad/followers","following_url":"https://api.github.com/users/brisad/following{/other_user}","gists_url":"https://api.github.com/users/brisad/gists{/gist_id}","starred_url":"https://api.github.com/users/brisad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brisad/subscriptions","organizations_url":"https://api.github.com/users/brisad/orgs","repos_url":"https://api.github.com/users/brisad/repos","events_url":"https://api.github.com/users/brisad/events{/privacy}","received_events_url":"https://api.github.com/users/brisad/received_events","type":"User","site_admin":false},"repo":{"id":95006982,"name":"perf.html","full_name":"brisad/perf.html","owner":{"login":"brisad","id":1911402,"avatar_url":"https://avatars3.githubusercontent.com/u/1911402?v=4","gravatar_id":"","url":"https://api.github.com/users/brisad","html_url":"https://github.com/brisad","followers_url":"https://api.github.com/users/brisad/followers","following_url":"https://api.github.com/users/brisad/following{/other_user}","gists_url":"https://api.github.com/users/brisad/gists{/gist_id}","starred_url":"https://api.github.com/users/brisad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brisad/subscriptions","organizations_url":"https://api.github.com/users/brisad/orgs","repos_url":"https://api.github.com/users/brisad/repos","events_url":"https://api.github.com/users/brisad/events{/privacy}","received_events_url":"https://api.github.com/users/brisad/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brisad/perf.html","description":"Firefox Performance tools for the web, by the web 🛥","fork":true,"url":"https://api.github.com/repos/brisad/perf.html","forks_url":"https://api.github.com/repos/brisad/perf.html/forks","keys_url":"https://api.github.com/repos/brisad/perf.html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brisad/perf.html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brisad/perf.html/teams","hooks_url":"https://api.github.com/repos/brisad/perf.html/hooks","issue_events_url":"https://api.github.com/repos/brisad/perf.html/issues/events{/number}","events_url":"https://api.github.com/repos/brisad/perf.html/events","assignees_url":"https://api.github.com/repos/brisad/perf.html/assignees{/user}","branches_url":"https://api.github.com/repos/brisad/perf.html/branches{/branch}","tags_url":"https://api.github.com/repos/brisad/perf.html/tags","blobs_url":"https://api.github.com/repos/brisad/perf.html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brisad/perf.html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brisad/perf.html/git/refs{/sha}","trees_url":"https://api.github.com/repos/brisad/perf.html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brisad/perf.html/statuses/{sha}","languages_url":"https://api.github.com/repos/brisad/perf.html/languages","stargazers_url":"https://api.github.com/repos/brisad/perf.html/stargazers","contributors_url":"https://api.github.com/repos/brisad/perf.html/contributors","subscribers_url":"https://api.github.com/repos/brisad/perf.html/subscribers","subscription_url":"https://api.github.com/repos/brisad/perf.html/subscription","commits_url":"https://api.github.com/repos/brisad/perf.html/commits{/sha}","git_commits_url":"https://api.github.com/repos/brisad/perf.html/git/commits{/sha}","comments_url":"https://api.github.com/repos/brisad/perf.html/comments{/number}","issue_comment_url":"https://api.github.com/repos/brisad/perf.html/issues/comments{/number}","contents_url":"https://api.github.com/repos/brisad/perf.html/contents/{+path}","compare_url":"https://api.github.com/repos/brisad/perf.html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brisad/perf.html/merges","archive_url":"https://api.github.com/repos/brisad/perf.html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brisad/perf.html/downloads","issues_url":"https://api.github.com/repos/brisad/perf.html/issues{/number}","pulls_url":"https://api.github.com/repos/brisad/perf.html/pulls{/number}","milestones_url":"https://api.github.com/repos/brisad/perf.html/milestones{/number}","notifications_url":"https://api.github.com/repos/brisad/perf.html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brisad/perf.html/labels{/name}","releases_url":"https://api.github.com/repos/brisad/perf.html/releases{/id}","deployments_url":"https://api.github.com/repos/brisad/perf.html/deployments","created_at":"2017-06-21T13:27:36Z","updated_at":"2017-06-21T13:27:39Z","pushed_at":"2018-05-17T21:12:50Z","git_url":"git://github.com/brisad/perf.html.git","ssh_url":"git@github.com:brisad/perf.html.git","clone_url":"https://github.com/brisad/perf.html.git","svn_url":"https://github.com/brisad/perf.html","homepage":"https://perf-html.io/","size":6725,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"devtools-html:master","ref":"master","sha":"cdb62d7776a617209972d93f944a9f1141e81552","user":{"login":"devtools-html","id":19979421,"avatar_url":"https://avatars2.githubusercontent.com/u/19979421?v=4","gravatar_id":"","url":"https://api.github.com/users/devtools-html","html_url":"https://github.com/devtools-html","followers_url":"https://api.github.com/users/devtools-html/followers","following_url":"https://api.github.com/users/devtools-html/following{/other_user}","gists_url":"https://api.github.com/users/devtools-html/gists{/gist_id}","starred_url":"https://api.github.com/users/devtools-html/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devtools-html/subscriptions","organizations_url":"https://api.github.com/users/devtools-html/orgs","repos_url":"https://api.github.com/users/devtools-html/repos","events_url":"https://api.github.com/users/devtools-html/events{/privacy}","received_events_url":"https://api.github.com/users/devtools-html/received_events","type":"Organization","site_admin":false},"repo":{"id":3607308,"name":"perf.html","full_name":"devtools-html/perf.html","owner":{"login":"devtools-html","id":19979421,"avatar_url":"https://avatars2.githubusercontent.com/u/19979421?v=4","gravatar_id":"","url":"https://api.github.com/users/devtools-html","html_url":"https://github.com/devtools-html","followers_url":"https://api.github.com/users/devtools-html/followers","following_url":"https://api.github.com/users/devtools-html/following{/other_user}","gists_url":"https://api.github.com/users/devtools-html/gists{/gist_id}","starred_url":"https://api.github.com/users/devtools-html/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devtools-html/subscriptions","organizations_url":"https://api.github.com/users/devtools-html/orgs","repos_url":"https://api.github.com/users/devtools-html/repos","events_url":"https://api.github.com/users/devtools-html/events{/privacy}","received_events_url":"https://api.github.com/users/devtools-html/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/devtools-html/perf.html","description":"Firefox Performance tools for the web, by the web 🛥","fork":false,"url":"https://api.github.com/repos/devtools-html/perf.html","forks_url":"https://api.github.com/repos/devtools-html/perf.html/forks","keys_url":"https://api.github.com/repos/devtools-html/perf.html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devtools-html/perf.html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devtools-html/perf.html/teams","hooks_url":"https://api.github.com/repos/devtools-html/perf.html/hooks","issue_events_url":"https://api.github.com/repos/devtools-html/perf.html/issues/events{/number}","events_url":"https://api.github.com/repos/devtools-html/perf.html/events","assignees_url":"https://api.github.com/repos/devtools-html/perf.html/assignees{/user}","branches_url":"https://api.github.com/repos/devtools-html/perf.html/branches{/branch}","tags_url":"https://api.github.com/repos/devtools-html/perf.html/tags","blobs_url":"https://api.github.com/repos/devtools-html/perf.html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devtools-html/perf.html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devtools-html/perf.html/git/refs{/sha}","trees_url":"https://api.github.com/repos/devtools-html/perf.html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devtools-html/perf.html/statuses/{sha}","languages_url":"https://api.github.com/repos/devtools-html/perf.html/languages","stargazers_url":"https://api.github.com/repos/devtools-html/perf.html/stargazers","contributors_url":"https://api.github.com/repos/devtools-html/perf.html/contributors","subscribers_url":"https://api.github.com/repos/devtools-html/perf.html/subscribers","subscription_url":"https://api.github.com/repos/devtools-html/perf.html/subscription","commits_url":"https://api.github.com/repos/devtools-html/perf.html/commits{/sha}","git_commits_url":"https://api.github.com/repos/devtools-html/perf.html/git/commits{/sha}","comments_url":"https://api.github.com/repos/devtools-html/perf.html/comments{/number}","issue_comment_url":"https://api.github.com/repos/devtools-html/perf.html/issues/comments{/number}","contents_url":"https://api.github.com/repos/devtools-html/perf.html/contents/{+path}","compare_url":"https://api.github.com/repos/devtools-html/perf.html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devtools-html/perf.html/merges","archive_url":"https://api.github.com/repos/devtools-html/perf.html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devtools-html/perf.html/downloads","issues_url":"https://api.github.com/repos/devtools-html/perf.html/issues{/number}","pulls_url":"https://api.github.com/repos/devtools-html/perf.html/pulls{/number}","milestones_url":"https://api.github.com/repos/devtools-html/perf.html/milestones{/number}","notifications_url":"https://api.github.com/repos/devtools-html/perf.html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devtools-html/perf.html/labels{/name}","releases_url":"https://api.github.com/repos/devtools-html/perf.html/releases{/id}","deployments_url":"https://api.github.com/repos/devtools-html/perf.html/deployments","created_at":"2012-03-02T23:55:22Z","updated_at":"2018-05-18T18:04:56Z","pushed_at":"2018-05-19T19:25:32Z","git_url":"git://github.com/devtools-html/perf.html.git","ssh_url":"git@github.com:devtools-html/perf.html.git","clone_url":"https://github.com/devtools-html/perf.html.git","svn_url":"https://github.com/devtools-html/perf.html","homepage":"https://perf-html.io/","size":6659,"stargazers_count":164,"watchers_count":164,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":60,"mirror_url":null,"archived":false,"open_issues_count":254,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":60,"open_issues":254,"watchers":164,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/devtools-html/perf.html/pulls/1000"},"html":{"href":"https://github.com/devtools-html/perf.html/pull/1000"},"issue":{"href":"https://api.github.com/repos/devtools-html/perf.html/issues/1000"},"comments":{"href":"https://api.github.com/repos/devtools-html/perf.html/issues/1000/comments"},"review_comments":{"href":"https://api.github.com/repos/devtools-html/perf.html/pulls/1000/comments"},"review_comment":{"href":"https://api.github.com/repos/devtools-html/perf.html/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/devtools-html/perf.html/pulls/1000/commits"},"statuses":{"href":"https://api.github.com/repos/devtools-html/perf.html/statuses/32de13387b83d7242ea85905220a2e77ab424a62"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"brisad"}}