Skip to content

Commit 2b05978

Browse files
committed
replace plotinfo.x() -> plotinfo.x()
1 parent b00d716 commit 2b05978

File tree

16 files changed

+57
-62
lines changed

16 files changed

+57
-62
lines changed

src/components/errorbars/plot.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ var subTypes = require('../../traces/scatter/subtypes');
1616

1717
module.exports = function plot(traces, plotinfo, transitionOpts) {
1818
var isNew;
19-
var xa = plotinfo.x(),
20-
ya = plotinfo.y();
19+
20+
var xa = plotinfo.xaxis,
21+
ya = plotinfo.yaxis;
2122

2223
var hasAnimation = transitionOpts && transitionOpts.duration > 0;
2324

src/plots/cartesian/axes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,8 +1373,8 @@ axes.doTicks = function(gd, axid, skipTitle) {
13731373
if(axid === 'redraw') {
13741374
fullLayout._paper.selectAll('g.subplot').each(function(subplot) {
13751375
var plotinfo = fullLayout._plots[subplot],
1376-
xa = plotinfo.x(),
1377-
ya = plotinfo.y();
1376+
xa = plotinfo.xaxis,
1377+
ya = plotinfo.yaxis;
13781378

13791379
plotinfo.xaxislayer
13801380
.selectAll('.' + xa._id + 'tick').remove();
@@ -1837,7 +1837,7 @@ axes.doTicks = function(gd, axid, skipTitle) {
18371837

18381838
// [bottom or left, top or right, free, main]
18391839
linepositions = ax._linepositions[subplot] || [],
1840-
counteraxis = plotinfo[counterLetter](),
1840+
counteraxis = plotinfo[counterLetter + 'axis'],
18411841
mainSubplot = counteraxis._id === ax.anchor,
18421842
ticksides = [false, false, false],
18431843
tickpath = '';

src/plots/cartesian/dragbox.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
4848
var fullLayout = gd._fullLayout,
4949
// if we're dragging two axes at once, also drag overlays
5050
subplots = [plotinfo].concat((ns && ew) ? plotinfo.overlays : []),
51-
xa = [plotinfo.x()],
52-
ya = [plotinfo.y()],
51+
xa = [plotinfo.xaxis],
52+
ya = [plotinfo.yaxis],
5353
pw = xa[0]._length,
5454
ph = ya[0]._length,
5555
MINDRAG = constants.MINDRAG,
5656
MINZOOM = constants.MINZOOM,
5757
isMainDrag = (ns + ew === 'nsew');
5858

5959
for(var i = 1; i < subplots.length; i++) {
60-
var subplotXa = subplots[i].x(),
61-
subplotYa = subplots[i].y();
60+
var subplotXa = subplots[i].xaxis,
61+
subplotYa = subplots[i].yaxis;
6262
if(xa.indexOf(subplotXa) === -1) xa.push(subplotXa);
6363
if(ya.indexOf(subplotYa) === -1) ya.push(subplotYa);
6464
}
@@ -146,8 +146,8 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
146146
dragElement.init(dragOptions);
147147

148148
var zoomlayer = gd._fullLayout._zoomlayer,
149-
xs = plotinfo.x()._offset,
150-
ys = plotinfo.y()._offset,
149+
xs = plotinfo.xaxis._offset,
150+
ys = plotinfo.yaxis._offset,
151151
x0,
152152
y0,
153153
box,
@@ -159,23 +159,23 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
159159
corners;
160160

161161
function recomputeAxisLists() {
162-
xa = [plotinfo.x()];
163-
ya = [plotinfo.y()];
162+
xa = [plotinfo.xaxis];
163+
ya = [plotinfo.yaxis];
164164
pw = xa[0]._length;
165165
ph = ya[0]._length;
166166

167167
for(var i = 1; i < subplots.length; i++) {
168-
var subplotXa = subplots[i].x(),
169-
subplotYa = subplots[i].y();
168+
var subplotXa = subplots[i].xaxis,
169+
subplotYa = subplots[i].yaxis;
170170
if(xa.indexOf(subplotXa) === -1) xa.push(subplotXa);
171171
if(ya.indexOf(subplotYa) === -1) ya.push(subplotYa);
172172
}
173173
allaxes = xa.concat(ya);
174174
xActive = isDirectionActive(xa, ew);
175175
yActive = isDirectionActive(ya, ns);
176176
cursor = getDragCursor(yActive + xActive, fullLayout.dragmode);
177-
xs = plotinfo.x()._offset;
178-
ys = plotinfo.y()._offset;
177+
xs = plotinfo.xaxis._offset;
178+
ys = plotinfo.yaxis._offset;
179179
dragOptions.xa = xa;
180180
dragOptions.ya = ya;
181181
}
@@ -656,8 +656,8 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
656656
for(var i = 0; i < subplots.length; i++) {
657657

658658
var subplot = plotinfos[subplots[i]],
659-
xa2 = subplot.x(),
660-
ya2 = subplot.y(),
659+
xa2 = subplot.xaxis,
660+
ya2 = subplot.yaxis,
661661
editX = ew && !xa2.fixedrange,
662662
editY = ns && !ya2.fixedrange;
663663

src/plots/cartesian/graph_interact.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ fx.init = function(gd) {
109109

110110
if(!fullLayout._has('cartesian')) return;
111111

112-
var xa = plotinfo.x(),
113-
ya = plotinfo.y(),
112+
var xa = plotinfo.xaxis,
113+
ya = plotinfo.yaxis,
114114

115115
// the y position of the main x axis line
116116
y0 = (xa._linepositions[subplot] || [])[3],

src/plots/cartesian/select.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ function getAxId(ax) { return ax._id; }
2424
module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
2525
var plot = dragOptions.gd._fullLayout._zoomlayer,
2626
dragBBox = dragOptions.element.getBoundingClientRect(),
27-
xs = dragOptions.plotinfo.x()._offset,
28-
ys = dragOptions.plotinfo.y()._offset,
27+
xs = dragOptions.plotinfo.xaxis._offset,
28+
ys = dragOptions.plotinfo.yaxis._offset,
2929
x0 = startX - dragBBox.left,
3030
y0 = startY - dragBBox.top,
3131
x1 = x0,

src/plots/cartesian/transition_axes.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ module.exports = function transitionAxes(gd, newLayout, transitionOpts, makeOnCo
134134
}
135135

136136
function unsetSubplotTransform(subplot) {
137-
var xa2 = subplot.x();
138-
var ya2 = subplot.y();
137+
var xa2 = subplot.xaxis;
138+
var ya2 = subplot.yaxis;
139139

140140
fullLayout._defs.selectAll('#' + subplot.clipId)
141141
.call(Lib.setTranslate, 0, 0)
@@ -194,11 +194,11 @@ module.exports = function transitionAxes(gd, newLayout, transitionOpts, makeOnCo
194194
viewBox[3] = subplot.yaxis._length;
195195
}
196196

197-
ticksAndAnnotations(subplot.x(), subplot.y());
197+
ticksAndAnnotations(subplot.xaxis, subplot.yaxis);
198198

199199

200-
var xa2 = subplot.x();
201-
var ya2 = subplot.y();
200+
var xa2 = subplot.xaxis;
201+
var ya2 = subplot.yaxis;
202202

203203
var editX = !!xUpdate;
204204
var editY = !!yUpdate;

src/plots/plots.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,6 @@ plots.linkSubplots = function(newFullData, newFullLayout, oldFullData, oldFullLa
573573

574574
var ids = Plotly.Axes.getSubplots(mockGd);
575575

576-
function getAxisFunc(subplot, axLetter) {
577-
return function() { return Plotly.Axes.getFromId(mockGd, subplot, axLetter); };
578-
}
579-
580576
for(var i = 0; i < ids.length; i++) {
581577
var id = ids[i],
582578
oldSubplot = oldSubplots[id],
@@ -590,10 +586,8 @@ plots.linkSubplots = function(newFullData, newFullLayout, oldFullData, oldFullLa
590586
plotinfo.id = id;
591587
}
592588

593-
plotinfo.x = getAxisFunc(id, 'x');
594-
plotinfo.y = getAxisFunc(id, 'y');
595-
plotinfo.xaxis = plotinfo.x();
596-
plotinfo.yaxis = plotinfo.y();
589+
plotinfo.xaxis = Plotly.Axes.getFromId(mockGd, id, 'x');
590+
plotinfo.yaxis = Plotly.Axes.getFromId(mockGd, id, 'y');
597591
}
598592
};
599593

src/traces/bar/plot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ var arraysToCalcdata = require('./arrays_to_calcdata');
2020

2121

2222
module.exports = function plot(gd, plotinfo, cdbar) {
23-
var xa = plotinfo.x(),
24-
ya = plotinfo.y(),
23+
var xa = plotinfo.xaxis,
24+
ya = plotinfo.yaxis,
2525
fullLayout = gd._fullLayout;
2626

2727
var bartraces = plotinfo.plot.select('.barlayer')

src/traces/bar/set_positions.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ var Lib = require('../../lib');
2424

2525
module.exports = function setPositions(gd, plotinfo) {
2626
var fullLayout = gd._fullLayout,
27-
xa = plotinfo.x(),
28-
ya = plotinfo.y(),
27+
xa = plotinfo.xaxis,
28+
ya = plotinfo.yaxis,
2929
i, j;
3030

3131
['v', 'h'].forEach(function(dir) {
3232
var bl = [],
3333
pLetter = {v: 'x', h: 'y'}[dir],
3434
sLetter = {v: 'y', h: 'x'}[dir],
35-
pa = plotinfo[pLetter](),
36-
sa = plotinfo[sLetter]();
35+
pa = plotinfo[pLetter + 'axis'],
36+
sa = plotinfo[sLetter + 'axis'];
3737

3838
gd._fullData.forEach(function(trace, i) {
3939
if(trace.visible === true &&

src/traces/box/plot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ var JITTERCOUNT = 5, // points either side of this to include
3737

3838
module.exports = function plot(gd, plotinfo, cdbox) {
3939
var fullLayout = gd._fullLayout,
40-
xa = plotinfo.x(),
41-
ya = plotinfo.y(),
40+
xa = plotinfo.xaxis,
41+
ya = plotinfo.yaxis,
4242
posAxis, valAxis;
4343

4444
var boxtraces = plotinfo.plot.select('.boxlayer')

0 commit comments

Comments
 (0)