{"action":"created","comment":{"url":"https://api.github.com/repos/zakandrewking/escher/pulls/comments/149560535","pull_request_review_id":74974065,"id":149560535,"diff_hunk":"@@ -20,53 +23,81 @@ TooltipContainer.prototype = {\n   show: show,\n   hide: hide,\n   delay_hide: delay_hide,\n-  cancel_hide_tooltip: cancel_hide_tooltip,\n+  cancelHideTooltip: cancelHideTooltip\n }\n module.exports = TooltipContainer\n \n // definitions\n-function init (selection, tooltip_component, zoom_container) {\n+function init (selection, TooltipComponent, zoomContainer) {\n   this.div = selection.append('div').attr('id', 'tooltip-container')\n-  this.div.on('mouseover', this.cancel_hide_tooltip.bind(this))\n-  this.div.on('mouseleave', this.hide.bind(this))\n+  this.TooltipComponent = TooltipComponent\n+  this.tooltipRef = null\n+\n+  this.zoomContainer = zoomContainer\n+  this.setup_zoom_callbacks(zoomContainer)\n+\n+  // Create callback manager\n+  this.callback_manager = CallbackManager()\n \n-  this.setup_zoom_callbacks(zoom_container)\n+  this.div.on('mouseover', this.cancelHideTooltip.bind(this))\n+  this.div.on('mouseleave', this.hide.bind(this))\n \n-  // keep a reference to tinier tooltip\n-  this.tooltip_component = tooltip_component\n-  // if they pass in a function, then use that\n-  this.tooltip_function = (_.isFunction(tooltip_component) ?\n-                           function (state) { tooltip_component({ state: state, el: this.div.node() })} :\n-                           null)\n-  // if they pass in a tinier component, use that\n-  this.tinier_tooltip = (tinier.checkType(tinier.COMPONENT, tooltip_component) ?\n-                         tinier.run(tooltip_component, this.div.node()) :\n-                         null)\n+  // Attach a function to get size of tooltip\n+  this.getTooltipSize = null\n+  this.callback_manager.set('attachGetSize', getSizeFn => {\n+    this.getTooltipSize = getSizeFn\n+  })\n \n+  this.map = null\n   this.delay_hide_timeout = null\n+  this.currentTooltip = null\n+\n+  // keep a reference to preact tooltip\n+  preact.render(\n+    <TooltipComponentContainer\n+      callbackManager={this.callback_manager}\n+      TooltipComponent={this.TooltipComponent}\n+      tooltipRef={instance => { this.tooltipRef = instance }}\n+      />,\n+     this.div.node()\n+  )\n }\n \n function setup_map_callbacks (map) {\n-  this.placed_div = PlacedDiv(this.div, map)\n+  this.map = map\n+  this.placed_div = PlacedDiv(this.div, map, undefined, false)\n \n   map.callback_manager.set('show_tooltip.tooltip_container', function (type, d) {\n     if (map.settings.get_option('enable_tooltips')) {\n       this.show(type, d)\n     }\n   }.bind(this))\n-  map.callback_manager.set('hide_tooltip.tooltip_container',\n-                           this.hide.bind(this))\n-  map.callback_manager.set('delay_hide_tooltip.tooltip_container',\n-                           this.delay_hide.bind(this))\n+  map.callback_manager.set('hide_tooltip.tooltip_container', this.hide.bind(this))\n+  map.sel.selectAll('#canvas').on('touchend', this.hide.bind(this))\n+  map.callback_manager.set('delay_hide_tooltip.tooltip_container', this.delay_hide.bind(this))\n+  map.callback_manager.set('update_tooltip.tooltip_container', function (type, sel) {\n+    if (this.currentTooltip !== null) {\n+      let d = null\n+      sel.each(data => {\n+        if (data[type.replace('_label', '_id')] === this.currentTooltip.id) {\n+          d = data\n+        }\n+      })\n+      if (d === null) {\n+        throw Error(`Could not find tooltip data for ${this.currentTooltip}`)","path":"js/src/TooltipContainer.js","position":null,"original_position":109,"commit_id":"e826f8589288e81e6127d856995b9c1dfc2b4db2","original_commit_id":"9300e028e1fb34c32cabb1ee4d134454fea2593b","user":{"login":"spaghettikinase","id":27992139,"avatar_url":"https://avatars3.githubusercontent.com/u/27992139?v=4","gravatar_id":"","url":"https://api.github.com/users/spaghettikinase","html_url":"https://github.com/spaghettikinase","followers_url":"https://api.github.com/users/spaghettikinase/followers","following_url":"https://api.github.com/users/spaghettikinase/following{/other_user}","gists_url":"https://api.github.com/users/spaghettikinase/gists{/gist_id}","starred_url":"https://api.github.com/users/spaghettikinase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spaghettikinase/subscriptions","organizations_url":"https://api.github.com/users/spaghettikinase/orgs","repos_url":"https://api.github.com/users/spaghettikinase/repos","events_url":"https://api.github.com/users/spaghettikinase/events{/privacy}","received_events_url":"https://api.github.com/users/spaghettikinase/received_events","type":"User","site_admin":false},"body":"Yeah it's in there now.","created_at":"2017-11-08T02:22:20Z","updated_at":"2017-11-08T02:22:20Z","html_url":"https://github.com/zakandrewking/escher/pull/195#discussion_r149560535","pull_request_url":"https://api.github.com/repos/zakandrewking/escher/pulls/195","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/zakandrewking/escher/pulls/comments/149560535"},"html":{"href":"https://github.com/zakandrewking/escher/pull/195#discussion_r149560535"},"pull_request":{"href":"https://api.github.com/repos/zakandrewking/escher/pulls/195"}},"in_reply_to_id":144411062},"pull_request":{"url":"https://api.github.com/repos/zakandrewking/escher/pulls/195","id":137287321,"html_url":"https://github.com/zakandrewking/escher/pull/195","diff_url":"https://github.com/zakandrewking/escher/pull/195.diff","patch_url":"https://github.com/zakandrewking/escher/pull/195.patch","issue_url":"https://api.github.com/repos/zakandrewking/escher/issues/195","number":195,"state":"open","locked":false,"title":"Preact tooltips","user":{"login":"zakandrewking","id":1250400,"avatar_url":"https://avatars2.githubusercontent.com/u/1250400?v=4","gravatar_id":"","url":"https://api.github.com/users/zakandrewking","html_url":"https://github.com/zakandrewking","followers_url":"https://api.github.com/users/zakandrewking/followers","following_url":"https://api.github.com/users/zakandrewking/following{/other_user}","gists_url":"https://api.github.com/users/zakandrewking/gists{/gist_id}","starred_url":"https://api.github.com/users/zakandrewking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zakandrewking/subscriptions","organizations_url":"https://api.github.com/users/zakandrewking/orgs","repos_url":"https://api.github.com/users/zakandrewking/repos","events_url":"https://api.github.com/users/zakandrewking/events{/privacy}","received_events_url":"https://api.github.com/users/zakandrewking/received_events","type":"User","site_admin":false},"body":"Work in progress","created_at":"2017-08-23T18:31:41Z","updated_at":"2017-11-08T02:22:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7591d358626358d43f63d417ad457465e2092501","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/zakandrewking/escher/milestones/7","html_url":"https://github.com/zakandrewking/escher/milestone/7","labels_url":"https://api.github.com/repos/zakandrewking/escher/milestones/7/labels","id":2686249,"number":7,"title":"1.7","description":null,"creator":{"login":"zakandrewking","id":1250400,"avatar_url":"https://avatars2.githubusercontent.com/u/1250400?v=4","gravatar_id":"","url":"https://api.github.com/users/zakandrewking","html_url":"https://github.com/zakandrewking","followers_url":"https://api.github.com/users/zakandrewking/followers","following_url":"https://api.github.com/users/zakandrewking/following{/other_user}","gists_url":"https://api.github.com/users/zakandrewking/gists{/gist_id}","starred_url":"https://api.github.com/users/zakandrewking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zakandrewking/subscriptions","organizations_url":"https://api.github.com/users/zakandrewking/orgs","repos_url":"https://api.github.com/users/zakandrewking/repos","events_url":"https://api.github.com/users/zakandrewking/events{/privacy}","received_events_url":"https://api.github.com/users/zakandrewking/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":3,"state":"open","created_at":"2017-08-07T18:27:40Z","updated_at":"2017-11-06T20:52:41Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/zakandrewking/escher/pulls/195/commits","review_comments_url":"https://api.github.com/repos/zakandrewking/escher/pulls/195/comments","review_comment_url":"https://api.github.com/repos/zakandrewking/escher/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zakandrewking/escher/issues/195/comments","statuses_url":"https://api.github.com/repos/zakandrewking/escher/statuses/e826f8589288e81e6127d856995b9c1dfc2b4db2","head":{"label":"spaghettikinase:master","ref":"master","sha":"e826f8589288e81e6127d856995b9c1dfc2b4db2","user":{"login":"spaghettikinase","id":27992139,"avatar_url":"https://avatars3.githubusercontent.com/u/27992139?v=4","gravatar_id":"","url":"https://api.github.com/users/spaghettikinase","html_url":"https://github.com/spaghettikinase","followers_url":"https://api.github.com/users/spaghettikinase/followers","following_url":"https://api.github.com/users/spaghettikinase/following{/other_user}","gists_url":"https://api.github.com/users/spaghettikinase/gists{/gist_id}","starred_url":"https://api.github.com/users/spaghettikinase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spaghettikinase/subscriptions","organizations_url":"https://api.github.com/users/spaghettikinase/orgs","repos_url":"https://api.github.com/users/spaghettikinase/repos","events_url":"https://api.github.com/users/spaghettikinase/events{/privacy}","received_events_url":"https://api.github.com/users/spaghettikinase/received_events","type":"User","site_admin":false},"repo":{"id":99837650,"name":"escher","full_name":"spaghettikinase/escher","owner":{"login":"spaghettikinase","id":27992139,"avatar_url":"https://avatars3.githubusercontent.com/u/27992139?v=4","gravatar_id":"","url":"https://api.github.com/users/spaghettikinase","html_url":"https://github.com/spaghettikinase","followers_url":"https://api.github.com/users/spaghettikinase/followers","following_url":"https://api.github.com/users/spaghettikinase/following{/other_user}","gists_url":"https://api.github.com/users/spaghettikinase/gists{/gist_id}","starred_url":"https://api.github.com/users/spaghettikinase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spaghettikinase/subscriptions","organizations_url":"https://api.github.com/users/spaghettikinase/orgs","repos_url":"https://api.github.com/users/spaghettikinase/repos","events_url":"https://api.github.com/users/spaghettikinase/events{/privacy}","received_events_url":"https://api.github.com/users/spaghettikinase/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spaghettikinase/escher","description":"Build, view, share, and embed pathway maps.","fork":true,"url":"https://api.github.com/repos/spaghettikinase/escher","forks_url":"https://api.github.com/repos/spaghettikinase/escher/forks","keys_url":"https://api.github.com/repos/spaghettikinase/escher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spaghettikinase/escher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spaghettikinase/escher/teams","hooks_url":"https://api.github.com/repos/spaghettikinase/escher/hooks","issue_events_url":"https://api.github.com/repos/spaghettikinase/escher/issues/events{/number}","events_url":"https://api.github.com/repos/spaghettikinase/escher/events","assignees_url":"https://api.github.com/repos/spaghettikinase/escher/assignees{/user}","branches_url":"https://api.github.com/repos/spaghettikinase/escher/branches{/branch}","tags_url":"https://api.github.com/repos/spaghettikinase/escher/tags","blobs_url":"https://api.github.com/repos/spaghettikinase/escher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spaghettikinase/escher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spaghettikinase/escher/git/refs{/sha}","trees_url":"https://api.github.com/repos/spaghettikinase/escher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spaghettikinase/escher/statuses/{sha}","languages_url":"https://api.github.com/repos/spaghettikinase/escher/languages","stargazers_url":"https://api.github.com/repos/spaghettikinase/escher/stargazers","contributors_url":"https://api.github.com/repos/spaghettikinase/escher/contributors","subscribers_url":"https://api.github.com/repos/spaghettikinase/escher/subscribers","subscription_url":"https://api.github.com/repos/spaghettikinase/escher/subscription","commits_url":"https://api.github.com/repos/spaghettikinase/escher/commits{/sha}","git_commits_url":"https://api.github.com/repos/spaghettikinase/escher/git/commits{/sha}","comments_url":"https://api.github.com/repos/spaghettikinase/escher/comments{/number}","issue_comment_url":"https://api.github.com/repos/spaghettikinase/escher/issues/comments{/number}","contents_url":"https://api.github.com/repos/spaghettikinase/escher/contents/{+path}","compare_url":"https://api.github.com/repos/spaghettikinase/escher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spaghettikinase/escher/merges","archive_url":"https://api.github.com/repos/spaghettikinase/escher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spaghettikinase/escher/downloads","issues_url":"https://api.github.com/repos/spaghettikinase/escher/issues{/number}","pulls_url":"https://api.github.com/repos/spaghettikinase/escher/pulls{/number}","milestones_url":"https://api.github.com/repos/spaghettikinase/escher/milestones{/number}","notifications_url":"https://api.github.com/repos/spaghettikinase/escher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spaghettikinase/escher/labels{/name}","releases_url":"https://api.github.com/repos/spaghettikinase/escher/releases{/id}","deployments_url":"https://api.github.com/repos/spaghettikinase/escher/deployments","created_at":"2017-08-09T17:56:00Z","updated_at":"2017-08-09T17:56:02Z","pushed_at":"2017-11-07T02:34:41Z","git_url":"git://github.com/spaghettikinase/escher.git","ssh_url":"git@github.com:spaghettikinase/escher.git","clone_url":"https://github.com/spaghettikinase/escher.git","svn_url":"https://github.com/spaghettikinase/escher","homepage":"https://escher.github.io","size":34317,"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,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zakandrewking:master","ref":"master","sha":"b0e393ca7344cee4da883958326620d52b9fdf3e","user":{"login":"zakandrewking","id":1250400,"avatar_url":"https://avatars2.githubusercontent.com/u/1250400?v=4","gravatar_id":"","url":"https://api.github.com/users/zakandrewking","html_url":"https://github.com/zakandrewking","followers_url":"https://api.github.com/users/zakandrewking/followers","following_url":"https://api.github.com/users/zakandrewking/following{/other_user}","gists_url":"https://api.github.com/users/zakandrewking/gists{/gist_id}","starred_url":"https://api.github.com/users/zakandrewking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zakandrewking/subscriptions","organizations_url":"https://api.github.com/users/zakandrewking/orgs","repos_url":"https://api.github.com/users/zakandrewking/repos","events_url":"https://api.github.com/users/zakandrewking/events{/privacy}","received_events_url":"https://api.github.com/users/zakandrewking/received_events","type":"User","site_admin":false},"repo":{"id":7650667,"name":"escher","full_name":"zakandrewking/escher","owner":{"login":"zakandrewking","id":1250400,"avatar_url":"https://avatars2.githubusercontent.com/u/1250400?v=4","gravatar_id":"","url":"https://api.github.com/users/zakandrewking","html_url":"https://github.com/zakandrewking","followers_url":"https://api.github.com/users/zakandrewking/followers","following_url":"https://api.github.com/users/zakandrewking/following{/other_user}","gists_url":"https://api.github.com/users/zakandrewking/gists{/gist_id}","starred_url":"https://api.github.com/users/zakandrewking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zakandrewking/subscriptions","organizations_url":"https://api.github.com/users/zakandrewking/orgs","repos_url":"https://api.github.com/users/zakandrewking/repos","events_url":"https://api.github.com/users/zakandrewking/events{/privacy}","received_events_url":"https://api.github.com/users/zakandrewking/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zakandrewking/escher","description":"Build, view, share, and embed pathway maps.","fork":false,"url":"https://api.github.com/repos/zakandrewking/escher","forks_url":"https://api.github.com/repos/zakandrewking/escher/forks","keys_url":"https://api.github.com/repos/zakandrewking/escher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zakandrewking/escher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zakandrewking/escher/teams","hooks_url":"https://api.github.com/repos/zakandrewking/escher/hooks","issue_events_url":"https://api.github.com/repos/zakandrewking/escher/issues/events{/number}","events_url":"https://api.github.com/repos/zakandrewking/escher/events","assignees_url":"https://api.github.com/repos/zakandrewking/escher/assignees{/user}","branches_url":"https://api.github.com/repos/zakandrewking/escher/branches{/branch}","tags_url":"https://api.github.com/repos/zakandrewking/escher/tags","blobs_url":"https://api.github.com/repos/zakandrewking/escher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zakandrewking/escher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zakandrewking/escher/git/refs{/sha}","trees_url":"https://api.github.com/repos/zakandrewking/escher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zakandrewking/escher/statuses/{sha}","languages_url":"https://api.github.com/repos/zakandrewking/escher/languages","stargazers_url":"https://api.github.com/repos/zakandrewking/escher/stargazers","contributors_url":"https://api.github.com/repos/zakandrewking/escher/contributors","subscribers_url":"https://api.github.com/repos/zakandrewking/escher/subscribers","subscription_url":"https://api.github.com/repos/zakandrewking/escher/subscription","commits_url":"https://api.github.com/repos/zakandrewking/escher/commits{/sha}","git_commits_url":"https://api.github.com/repos/zakandrewking/escher/git/commits{/sha}","comments_url":"https://api.github.com/repos/zakandrewking/escher/comments{/number}","issue_comment_url":"https://api.github.com/repos/zakandrewking/escher/issues/comments{/number}","contents_url":"https://api.github.com/repos/zakandrewking/escher/contents/{+path}","compare_url":"https://api.github.com/repos/zakandrewking/escher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zakandrewking/escher/merges","archive_url":"https://api.github.com/repos/zakandrewking/escher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zakandrewking/escher/downloads","issues_url":"https://api.github.com/repos/zakandrewking/escher/issues{/number}","pulls_url":"https://api.github.com/repos/zakandrewking/escher/pulls{/number}","milestones_url":"https://api.github.com/repos/zakandrewking/escher/milestones{/number}","notifications_url":"https://api.github.com/repos/zakandrewking/escher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zakandrewking/escher/labels{/name}","releases_url":"https://api.github.com/repos/zakandrewking/escher/releases{/id}","deployments_url":"https://api.github.com/repos/zakandrewking/escher/deployments","created_at":"2013-01-16T17:48:18Z","updated_at":"2017-11-06T16:56:25Z","pushed_at":"2017-11-07T02:34:42Z","git_url":"git://github.com/zakandrewking/escher.git","ssh_url":"git@github.com:zakandrewking/escher.git","clone_url":"https://github.com/zakandrewking/escher.git","svn_url":"https://github.com/zakandrewking/escher","homepage":"https://escher.github.io","size":34080,"stargazers_count":69,"watchers_count":69,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":34,"mirror_url":null,"archived":false,"open_issues_count":47,"forks":34,"open_issues":47,"watchers":69,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zakandrewking/escher/pulls/195"},"html":{"href":"https://github.com/zakandrewking/escher/pull/195"},"issue":{"href":"https://api.github.com/repos/zakandrewking/escher/issues/195"},"comments":{"href":"https://api.github.com/repos/zakandrewking/escher/issues/195/comments"},"review_comments":{"href":"https://api.github.com/repos/zakandrewking/escher/pulls/195/comments"},"review_comment":{"href":"https://api.github.com/repos/zakandrewking/escher/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zakandrewking/escher/pulls/195/commits"},"statuses":{"href":"https://api.github.com/repos/zakandrewking/escher/statuses/e826f8589288e81e6127d856995b9c1dfc2b4db2"}},"author_association":"OWNER"}}
{"actor":{"display_login":"spaghettikinase"}}