From 62ab845e7f97359220ef9ce9a1f57e3cbbb4a794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Etienne=20T=C3=A9treault-Pinard?= Date: Tue, 11 Jul 2017 10:14:39 -0400 Subject: [PATCH] remove obsolete code from old d.{xp|yp} optimization attempt --- src/components/drawing/index.js | 5 ++--- src/traces/scatter/plot.js | 7 ++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/components/drawing/index.js b/src/components/drawing/index.js index bc46de2c0b6..344cfeebe75 100644 --- a/src/components/drawing/index.js +++ b/src/components/drawing/index.js @@ -68,9 +68,8 @@ drawing.setRect = function(s, x, y, w, h) { * false if selection could not get translated */ drawing.translatePoint = function(d, sel, xa, ya) { - // put xp and yp into d if pixel scaling is already done - var x = d.xp = xa.c2p(d.x); - var y = d.yp = ya.c2p(d.y); + var x = xa.c2p(d.x); + var y = ya.c2p(d.y); if(isNumeric(x) && isNumeric(y) && sel.node()) { // for multiline text this works better diff --git a/src/traces/scatter/plot.js b/src/traces/scatter/plot.js index cdcd47cf2fe..4010df2d35c 100644 --- a/src/traces/scatter/plot.js +++ b/src/traces/scatter/plot.js @@ -501,13 +501,10 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition join.selectAll('text') .call(Drawing.textPointStyle, trace, gd) .each(function(d) { - // This just *has* to be totally custom becuase of SVG text positioning :( // It's obviously copied from translatePoint; we just can't use that - // - // put xp and yp into d if pixel scaling is already done - var x = d.xp || xa.c2p(d.x), - y = d.yp || ya.c2p(d.y); + var x = xa.c2p(d.x); + var y = ya.c2p(d.y); d3.select(this).selectAll('tspan.line').each(function() { transition(d3.select(this)).attr({x: x, y: y});