Skip to content

Commit 58b3654

Browse files
committed
rm useless PR diffs
1 parent d76d64d commit 58b3654

File tree

12 files changed

+34
-67
lines changed

12 files changed

+34
-67
lines changed

src/components/dragelement/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,6 @@ dragElement.init = function init(options) {
6262

6363
if(!gd._mouseDownTime) gd._mouseDownTime = 0;
6464

65-
// enable call to options.setCursor(evt)
66-
initialOnMouseMove = options.element.onmousemove;
67-
if(options.setCursor) options.element.onmousemove = options.setCursor;
68-
69-
options.element.onmousedown = onStart;
70-
options.element.style.pointerEvents = 'all';
71-
7265
function onStart(e) {
7366
// disable call to options.setCursor(evt)
7467
options.element.onmousemove = initialOnMouseMove;
@@ -172,6 +165,13 @@ dragElement.init = function init(options) {
172165

173166
return Lib.pauseEvent(e);
174167
}
168+
169+
// enable call to options.setCursor(evt)
170+
initialOnMouseMove = options.element.onmousemove;
171+
if(options.setCursor) options.element.onmousemove = options.setCursor;
172+
173+
options.element.onmousedown = onStart;
174+
options.element.style.pointerEvents = 'all';
175175
};
176176

177177
function coverSlip() {

src/components/modebar/buttons.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ function handleCartesian(gd, ev) {
249249
}
250250

251251
aobj[astr] = val;
252-
253252
}
254253

255254
Plotly.relayout(gd, aobj);

src/components/modebar/manage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ module.exports = function manageModeBar(gd) {
7272
function getButtonGroups(gd, buttonsToRemove, buttonsToAdd) {
7373
var fullLayout = gd._fullLayout,
7474
fullData = gd._fullData;
75+
7576
var hasCartesian = fullLayout._has('cartesian'),
7677
hasGL3D = fullLayout._has('gl3d'),
7778
hasGeo = fullLayout._has('geo'),

src/plot_api/plot_api.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ Plotly.plot = function(gd, data, layout, config) {
187187
basePlotModules[i].drawFramework(gd);
188188
}
189189
}
190+
190191
return Lib.syncOrAsync([
191192
subroutines.layoutStyles,
192193
drawAxes,
@@ -1789,9 +1790,7 @@ Plotly.relayout = function relayout(gd, astr, val) {
17891790
flags = specs.flags;
17901791

17911792
// clear calcdata if required
1792-
if(flags.docalc) {
1793-
gd.calcdata = undefined;
1794-
}
1793+
if(flags.docalc) gd.calcdata = undefined;
17951794

17961795
// fill in redraw sequence
17971796

src/plots/cartesian/dragbox.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
170170
}
171171
}
172172
};
173+
173174
dragElement.init(dragOptions);
174175

175176
var x0,
@@ -386,9 +387,7 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
386387
var axRange = Lib.simpleMap(ax.range, ax.r2l),
387388
v0 = axRange[0] + (axRange[1] - axRange[0]) * centerFraction;
388389
function doZoom(v) { return ax.l2r(v0 + (v - v0) * zoom); }
389-
390390
ax.range = axRange.map(doZoom);
391-
392391
}
393392

394393
if(ew || isSubplotConstrained) {
@@ -444,6 +443,7 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
444443
}
445444

446445
recomputeAxisLists();
446+
447447
if(xActive === 'ew' || yActive === 'ns') {
448448
if(xActive) dragAxList(xa, dx);
449449
if(yActive) dragAxList(ya, dy);
@@ -504,7 +504,6 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
504504
// scale the other axis the same about its middle
505505
for(i = 0; i < xa.length; i++) {
506506
xa[i].range = xa[i]._r.slice();
507-
508507
scaleZoom(xa[i], 1 - dy / ph);
509508
}
510509
dx = dy * pw / ph;
@@ -513,7 +512,6 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
513512
if(!yActive && xActive.length === 1) {
514513
for(i = 0; i < ya.length; i++) {
515514
ya[i].range = ya[i]._r.slice();
516-
517515
scaleZoom(ya[i], 1 - dx / pw);
518516
}
519517
dy = dx * ph / pw;
@@ -633,6 +631,7 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
633631
}
634632
}
635633
}
634+
636635
gd.emit('plotly_doubleclick', null);
637636
Plotly.relayout(gd, attrs);
638637
}
@@ -655,7 +654,6 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
655654
if(axi._r[1] !== axi.range[1]) attrs[axi._name + '.range[1]'] = axi.range[1];
656655

657656
axi.range = axi._input.range = axi._r.slice();
658-
659657
}
660658

661659
updateSubplots([0, 0, pw, ph]);
@@ -815,12 +813,10 @@ function zoomAxRanges(axList, r0Fraction, r1Fraction, linkedAxes) {
815813

816814
axRangeLinear0 = axi._rl[0];
817815
axRangeLinearSpan = axi._rl[1] - axRangeLinear0;
818-
819816
axi.range = [
820817
axi.l2r(axRangeLinear0 + axRangeLinearSpan * r0Fraction),
821818
axi.l2r(axRangeLinear0 + axRangeLinearSpan * r1Fraction)
822819
];
823-
824820
}
825821

826822
// zoom linked axes about their centers
@@ -835,7 +831,6 @@ function dragAxList(axList, pix) {
835831
for(var i = 0; i < axList.length; i++) {
836832
var axi = axList[i];
837833
if(!axi.fixedrange) {
838-
839834
axi.range = [
840835
axi.l2r(axi._rl[0] - pix / axi._m),
841836
axi.l2r(axi._rl[1] - pix / axi._m)

src/plots/cartesian/graph_interact.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ module.exports = function initInteractions(gd) {
3838
subplots.forEach(function(subplot) {
3939
var plotinfo = fullLayout._plots[subplot];
4040

41-
// if(!fullLayout._has('cartesian')) return;
42-
4341
var xa = plotinfo.xaxis,
4442
ya = plotinfo.yaxis,
4543

src/plots/cartesian/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ function makeSubplotData(gd) {
286286
subplotData.push(subplot);
287287
}
288288
}
289+
289290
// main subplots before overlays
290291
subplotData = subplotData.concat(overlays);
291292

src/plots/cartesian/scale_zoom.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = function scaleZoom(ax, factor, centerFraction) {
1515
var rangeLinear = [ax.r2l(ax.range[0]), ax.r2l(ax.range[1])];
1616
var center = rangeLinear[0] + (rangeLinear[1] - rangeLinear[0]) * centerFraction;
1717
var newHalfSpan = (center - rangeLinear[0]) * factor;
18+
1819
ax.range = ax._input.range = [
1920
ax.l2r(center - newHalfSpan),
2021
ax.l2r(center + newHalfSpan)

src/plots/gl2d/camera.js

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ function createCamera(scene) {
6565
var MINDRAG = cartesianConstants.MINDRAG * plot.pixelRatio;
6666
var MINZOOM = cartesianConstants.MINZOOM * plot.pixelRatio;
6767

68-
var mode = scene.fullLayout.dragmode;
69-
7068
var dx, dy;
7169

7270
x *= plot.pixelRatio;
@@ -91,10 +89,8 @@ function createCamera(scene) {
9189
}
9290
}
9391

94-
switch(mode) {
92+
switch(scene.fullLayout.dragmode) {
9593
case 'zoom':
96-
case 'select':
97-
case 'lasso':
9894
if(buttons) {
9995
var dataX = x /
10096
(viewBox[2] - viewBox[0]) * (dataBox[2] - dataBox[0]) +
@@ -123,16 +119,6 @@ function createCamera(scene) {
123119
result.boxStart[1] !== result.boxEnd[1])
124120
) {
125121
result.boxEnabled = true;
126-
if(mode === 'select' || mode === 'lasso') {
127-
// prepSelect(e, x, y, {
128-
// element: dragger, //+
129-
// gd: this.element, //+
130-
// plotinfo: null, //+
131-
// xaxes: null, //+
132-
// yaxes: null, //+
133-
// subplot: null //+?
134-
// }, mode);
135-
}
136122
}
137123

138124
// constrain aspect ratio if the axes require it
@@ -186,22 +172,16 @@ function createCamera(scene) {
186172
else if(result.boxEnabled) {
187173
dx = result.boxStart[0] !== result.boxEnd[0];
188174
dy = result.boxStart[1] !== result.boxEnd[1];
189-
190175
if(dx || dy) {
191-
if(mode === 'select' || mode === 'lasso') {
192-
// console.log('end');
176+
if(dx) {
177+
updateRange(0, result.boxStart[0], result.boxEnd[0]);
178+
scene.xaxis.autorange = false;
193179
}
194-
else {
195-
if(dx) {
196-
updateRange(0, result.boxStart[0], result.boxEnd[0]);
197-
scene.xaxis.autorange = false;
198-
}
199-
if(dy) {
200-
updateRange(1, result.boxStart[1], result.boxEnd[1]);
201-
scene.yaxis.autorange = false;
202-
}
203-
scene.relayoutCallback();
180+
if(dy) {
181+
updateRange(1, result.boxStart[1], result.boxEnd[1]);
182+
scene.yaxis.autorange = false;
204183
}
184+
scene.relayoutCallback();
205185
}
206186
else {
207187
scene.glplot.setDirty();
@@ -264,9 +244,7 @@ function createCamera(scene) {
264244
var lastX = result.lastPos[0],
265245
lastY = result.lastPos[1];
266246

267-
var mode = scene.fullLayout.dragmode;
268-
269-
switch(mode) {
247+
switch(scene.fullLayout.dragmode) {
270248
case 'zoom':
271249
break;
272250

src/plots/gl2d/scene2d.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ proto.cameraChanged = function() {
325325

326326
var nextTicks = this.computeTickMarks();
327327
var curTicks = this.glplotOptions.ticks;
328+
328329
if(compareTicks(nextTicks, curTicks)) {
329330
this.glplotOptions.ticks = nextTicks;
330331
this.glplotOptions.dataBox = camera.dataBox;
@@ -424,6 +425,7 @@ proto.plot = function(fullData, calcData, fullLayout) {
424425

425426
ax = this[AXES[i]];
426427
ax._length = options.viewBox[i + 2] - options.viewBox[i];
428+
427429
Axes.doAutoRange(ax);
428430
ax.setScale();
429431
}
@@ -440,7 +442,6 @@ proto.plot = function(fullData, calcData, fullLayout) {
440442
options.dataBox = this.calcDataBox();
441443

442444
options.merge(fullLayout);
443-
444445
glplot.update(options);
445446

446447
// force redraw so that promise is returned when rendering is completed

0 commit comments

Comments
 (0)