Skip to content

Commit

Permalink
fixups (from AJ's review)
Browse files Browse the repository at this point in the history
  • Loading branch information
etpinard committed Jul 27, 2018
1 parent 66df51e commit d0699c0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
30 changes: 7 additions & 23 deletions src/components/annotations/calc_autorange.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,21 @@ function annAutorange(gd) {
}

function calcAxisExpansion(ann, ax) {
var headSize = 3 * ann.arrowsize * ann.arrowwidth || 0;
var startHeadSize = 3 * ann.startarrowsize * ann.arrowwidth || 0;

var axId = ax._id;
var letter = axId.charAt(0);
var pos = ann[letter];
var apos = ann['a' + letter];
var ref = ann[letter + 'ref'];
var aref = ann['a' + letter + 'ref'];
var shift = ann[letter + 'shift'];
var padplus = ann['_' + letter + 'padplus'];
var padminus = ann['_' + letter + 'padminus'];

var headPlus, headMinus;
var startHeadPlus, startHeadMinus;

switch(letter) {
case 'x':
headPlus = headSize + shift;
headMinus = headSize - shift;
startHeadPlus = startHeadSize + shift;
startHeadMinus = startHeadSize - shift;
break;
case 'y':
headPlus = headSize - shift;
headMinus = headSize + shift;
startHeadPlus = startHeadSize - shift;
startHeadMinus = startHeadSize + shift;
break;
}

var shift = {x: 1, y: -1}[letter] * ann[letter + 'shift'];
var headSize = 3 * ann.arrowsize * ann.arrowwidth || 0;
var headPlus = headSize + shift;
var headMinus = headSize - shift;
var startHeadSize = 3 * ann.startarrowsize * ann.arrowwidth || 0;
var startHeadPlus = startHeadSize + shift;
var startHeadMinus = startHeadSize - shift;
var extremes;

if(aref === ref) {
Expand Down
1 change: 0 additions & 1 deletion src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ axes.getFromId = axisIds.getFromId;
axes.getFromTrace = axisIds.getFromTrace;

var autorange = require('./autorange');
axes.expand = autorange.expand;
axes.getAutoRange = autorange.getAutoRange;
axes.findExtremes = autorange.findExtremes;

Expand Down
1 change: 0 additions & 1 deletion src/plots/plots.js
Original file line number Diff line number Diff line change
Expand Up @@ -2458,7 +2458,6 @@ plots.doCalcdata = function(gd, traces) {
for(i = 0; i < fullData.length; i++) {
trace = fullData[i];

// find array attributes in trace
trace._arrayAttrs = PlotSchema.findArrayAttributes(trace);

// keep track of trace extremes (for autorange) in here
Expand Down

0 comments on commit d0699c0

Please sign in to comment.