From 3f6184b46d25f3856d4baa1142cd9b7e5d4c5858 Mon Sep 17 00:00:00 2001 From: xieguigang Date: Tue, 16 Oct 2018 14:29:52 +0800 Subject: [PATCH] => arrow operator cause different result when compares with the function keyword --- d3.js/javascript/KEGG_canvas.js | 12 +++++++++--- typescript/KEGG_canvas/vis.ts | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/d3.js/javascript/KEGG_canvas.js b/d3.js/javascript/KEGG_canvas.js index ad0b073..1074886 100644 --- a/d3.js/javascript/KEGG_canvas.js +++ b/d3.js/javascript/KEGG_canvas.js @@ -304,9 +304,15 @@ var KEGG_canvas = /** @class */ (function () { } }) .style("opacity", viz.edgeOpacity) - .on("mouseover", function (d) { return viz.displayTooltip(_this, d); }) - .on("mousemove", function (d) { return viz.moveTooltip(); }) - .on("mouseout", function (d) { return viz.removeTooltip(); }) + .on("mouseover", function (d) { + viz.displayTooltip(this, d); + }) + .on("mousemove", function (d) { + viz.moveTooltip(); + }) + .on("mouseout", function (d) { + viz.removeTooltip(); + }) .attr("id", "network") .call(this.force.drag); var label = node.append("text") diff --git a/typescript/KEGG_canvas/vis.ts b/typescript/KEGG_canvas/vis.ts index 7c2d52e..8f281a5 100644 --- a/typescript/KEGG_canvas/vis.ts +++ b/typescript/KEGG_canvas/vis.ts @@ -214,9 +214,15 @@ class KEGG_canvas { } }) .style("opacity", viz.edgeOpacity) - .on("mouseover", d => viz.displayTooltip(this, d)) - .on("mousemove", d => viz.moveTooltip()) - .on("mouseout", d => viz.removeTooltip()) + .on("mouseover", function (d) { + viz.displayTooltip(this, d); + }) + .on("mousemove", function (d) { + viz.moveTooltip(); + }) + .on("mouseout", function (d) { + viz.removeTooltip(); + }) .attr("id", "network") .call(this.force.drag)