Skip to content

Commit e609955

Browse files
committed
update hover constant require statements
1 parent 1d4930c commit e609955

File tree

8 files changed

+17
-19
lines changed

8 files changed

+17
-19
lines changed

src/components/annotations/annotation_defaults.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
var Lib = require('../../lib');
1313
var Color = require('../color');
14+
var Fx = require('../fx');
1415
var Axes = require('../../plots/cartesian/axes');
15-
var constants = require('../../plots/cartesian/constants');
1616

1717
var attributes = require('./attributes');
1818

@@ -118,8 +118,8 @@ module.exports = function handleAnnotationDefaults(annIn, annOut, fullLayout, op
118118
Color.opacity(bgColor) ? Color.rgb(bgColor) : Color.defaultLine);
119119
var hoverBorder = coerce('hoverlabel.bordercolor', Color.contrast(hoverBG));
120120
Lib.coerceFont(coerce, 'hoverlabel.font', {
121-
family: constants.HOVERFONT,
122-
size: constants.HOVERFONTSIZE,
121+
family: Fx.constants.HOVERFONT,
122+
size: Fx.constants.HOVERFONTSIZE,
123123
color: hoverBorder
124124
});
125125
}

src/plots/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
'use strict';
1010

11-
var constants = require('./cartesian/constants');
11+
var constants = require('../components/fx/constants');
1212
var fontAttrs = require('./font_attributes');
1313
var extendFlat = require('../lib/extend').extendFlat;
1414

src/traces/heatmap/hover.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
var Fx = require('../../components/fx');
1313
var Lib = require('../../lib');
1414

15-
var MAXDIST = require('../../plots/cartesian/constants').MAXDIST;
16-
15+
var MAXDIST = Fx.constants.MAXDIST;
1716

1817
module.exports = function hoverPoints(pointData, xval, yval, hovermode, contour) {
1918
// never let a heatmap override another type as closest point

src/traces/scatter/hover.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111

1212
var Lib = require('../../lib');
1313
var Fx = require('../../components/fx');
14-
var constants = require('../../plots/cartesian/constants');
1514
var ErrorBars = require('../../components/errorbars');
1615
var getTraceColor = require('./get_trace_color');
1716
var Color = require('../../components/color');
1817

18+
var MAXDIST = Fx.constants.MAXDIST;
1919

2020
module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
2121
var cd = pointData.cd,
@@ -148,7 +148,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
148148

149149
Lib.extendFlat(pointData, {
150150
// never let a 2D override 1D type as closest point
151-
distance: constants.MAXDIST + 10,
151+
distance: MAXDIST + 10,
152152
x0: xmin,
153153
x1: xmax,
154154
y0: yAvg,

test/jasmine/tests/annotations_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var Plots = require('@src/plots/plots');
55
var Lib = require('@src/lib');
66
var Loggers = require('@src/lib/loggers');
77
var Axes = require('@src/plots/cartesian/axes');
8-
var HOVERMINTIME = require('@src/plots/cartesian/constants').HOVERMINTIME;
8+
var HOVERMINTIME = require('@src/components/fx').constants.HOVERMINTIME;
99
var DBLCLICKDELAY = require('@src/constants/interactions').DBLCLICKDELAY;
1010

1111
var d3 = require('d3');

test/jasmine/tests/geo_test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ var mouseEvent = require('../assets/mouse_event');
1717
var click = require('../assets/click');
1818

1919
var DBLCLICKDELAY = require('@src/constants/interactions').DBLCLICKDELAY;
20-
var HOVERMINTIME = require('@src/plots/cartesian/constants').HOVERMINTIME;
21-
20+
var HOVERMINTIME = require('@src/components/fx').constants.HOVERMINTIME;
2221

2322
function move(fromX, fromY, toX, toY, delay) {
2423
return new Promise(function(resolve) {

test/jasmine/tests/hover_label_test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ var d3 = require('d3');
22

33
var Plotly = require('@lib/index');
44
var Fx = require('@src/components/fx');
5-
var constants = require('@src/plots/cartesian/constants');
65
var Lib = require('@src/lib');
6+
var HOVERMINTIME = require('@src/components/fx').constants.HOVERMINTIME;
77

88
var createGraphDiv = require('../assets/create_graph_div');
99
var destroyGraphDiv = require('../assets/destroy_graph_div');
@@ -554,7 +554,7 @@ describe('hover info', function() {
554554
Promise.resolve().then(function() {
555555
Fx.hover(gd, event, 'xy');
556556
})
557-
.then(delay(constants.HOVERMINTIME * 1.1))
557+
.then(delay(HOVERMINTIME * 1.1))
558558
.then(function() {
559559
Fx.unhover(gd);
560560
})
@@ -719,7 +719,7 @@ describe('hover after resizing', function() {
719719

720720
setTimeout(function() {
721721
resolve();
722-
}, constants.HOVERMINTIME);
722+
}, HOVERMINTIME);
723723
});
724724
}
725725

@@ -732,7 +732,7 @@ describe('hover after resizing', function() {
732732
expect(hoverText.size()).toEqual(cnt, msg);
733733

734734
resolve();
735-
}, constants.HOVERMINTIME);
735+
}, HOVERMINTIME);
736736
});
737737
}
738738

@@ -799,7 +799,7 @@ describe('hover on fill', function() {
799799
expect(+transformCoords[1]).toBeCloseTo(labelPos[1], -1.2, labelText + ':y');
800800

801801
resolve();
802-
}, constants.HOVERMINTIME);
802+
}, HOVERMINTIME);
803803
});
804804
}
805805

@@ -879,7 +879,7 @@ describe('hover updates', function() {
879879
}
880880

881881
resolve();
882-
}, constants.HOVERMINTIME);
882+
}, HOVERMINTIME);
883883
});
884884
}
885885

@@ -935,7 +935,7 @@ describe('hover updates', function() {
935935
mouseEvent('mousemove', 394, 285);
936936
setTimeout(function() {
937937
resolve();
938-
}, constants.HOVERMINTIME);
938+
}, HOVERMINTIME);
939939
});
940940
}
941941

test/jasmine/tests/scattermapbox_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var customMatchers = require('../assets/custom_matchers');
1111

1212
var mouseEvent = require('../assets/mouse_event');
1313
var click = require('../assets/click');
14-
var HOVERMINTIME = require('@src/plots/cartesian/constants').HOVERMINTIME;
14+
var HOVERMINTIME = require('@src/components/fx').constants.HOVERMINTIME;
1515

1616
function move(fromX, fromY, toX, toY, delay) {
1717
return new Promise(function(resolve) {

0 commit comments

Comments
 (0)