Skip to content

Commit

Permalink
remove obsolete code from old d.{xp|yp} optimization attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
etpinard committed Jul 11, 2017
1 parent 9becb7c commit 62ab845
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/components/drawing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions src/traces/scatter/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down

0 comments on commit 62ab845

Please sign in to comment.