Skip to content

Commit a6db253

Browse files
authored
Merge pull request #1766 from plotly/gl2d-better-ticks
gl2d better ticks
2 parents 51a479b + f3478b7 commit a6db253

23 files changed

+8
-15
lines changed

src/plots/gl2d/scene2d.js

-7
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,6 @@ proto.computeTickMarks = function() {
259259
this.xaxis.setScale();
260260
this.yaxis.setScale();
261261

262-
// override _length from backward compatibility
263-
// even though setScale 'should' give the correct result
264-
this.xaxis._length =
265-
this.glplot.viewBox[2] - this.glplot.viewBox[0];
266-
this.yaxis._length =
267-
this.glplot.viewBox[3] - this.glplot.viewBox[1];
268-
269262
var nextTicks = [
270263
Axes.calcTicks(this.xaxis),
271264
Axes.calcTicks(this.yaxis)

test/image/baselines/gl2d_10.png

-71 Bytes
Loading

test/image/baselines/gl2d_12.png

-2.13 KB
Loading

test/image/baselines/gl2d_14.png

-5.57 KB
Loading

test/image/baselines/gl2d_17.png

-913 Bytes
Loading
-228 Bytes
Loading
-1.24 KB
Loading
-902 Bytes
Loading
-2.18 KB
Loading
-5.9 KB
Loading
-1.03 KB
Loading
-613 Bytes
Loading
-1.87 KB
Loading
-264 Bytes
Loading
-404 Bytes
Loading
Loading
Loading
-878 Bytes
Loading
-1.44 KB
Loading
Loading
6 Bytes
Loading

test/jasmine/tests/gl2d_click_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ describe('Test hover and click interactions', function() {
224224
bordercolor: _mock.data[0].x.map(function(_, i) { return i % 2 ? 'red' : 'green'; })
225225
};
226226

227-
var run = makeRunner([655, 317], {
227+
var run = makeRunner([634, 321], {
228228
x: 15.772,
229229
y: 0.387,
230230
label: ['0.387'],
@@ -249,7 +249,7 @@ describe('Test hover and click interactions', function() {
249249
var _mock = Lib.extendDeep({}, mock1);
250250
_mock.data[0].hoverinfo = 'none';
251251

252-
var run = makeRunner([655, 317], {
252+
var run = makeRunner([634, 321], {
253253
x: 15.772,
254254
y: 0.387,
255255
curveNumber: 0,

test/jasmine/tests/gl_plot_interact_test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -826,10 +826,10 @@ describe('Test gl2d plots', function() {
826826
var _mock = Lib.extendDeep({}, mock);
827827
var relayoutCallback = jasmine.createSpy('relayoutCallback');
828828

829-
var originalX = [-0.022068095838587643, 5.022068095838588];
830-
var originalY = [-0.21331533513634046, 5.851205650049042];
831-
var newX = [-0.23224043715846995, 4.811895754518705];
832-
var newY = [-1.2962655110623016, 4.768255474123081];
829+
var originalX = [-0.3037383177570093, 5.303738317757009];
830+
var originalY = [-0.5532219548705213, 6.191112269783224];
831+
var newX = [-0.5373831775700935, 5.070093457943925];
832+
var newY = [-1.7575673521301187, 4.986766872523626];
833833
var precision = 5;
834834

835835
Plotly.plot(gd, _mock)
@@ -1326,10 +1326,10 @@ describe('Test gl2d interactions', function() {
13261326
dragmode: 'pan'
13271327
})
13281328
.then(function() {
1329-
assertAnnotation([327, 325]);
1329+
assertAnnotation([327, 315]);
13301330

13311331
drag([250, 200], [200, 150]);
1332-
assertAnnotation([277, 275]);
1332+
assertAnnotation([277, 265]);
13331333

13341334
return Plotly.relayout(gd, {
13351335
'xaxis.range': [1.5, 2.5],

0 commit comments

Comments
 (0)