Skip to content

Commit 16f9fd2

Browse files
committed
coerce scattergeo [un]selected.marker.opacity !
1 parent 24b2912 commit 16f9fd2

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/traces/scattergeo/defaults.js

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
5252
if(traceOut.fill !== 'none') {
5353
handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);
5454
}
55+
56+
Lib.coerceSelectionMarkerOpacity(traceOut, coerce);
5557
};
5658

5759
function handleLonLatLocDefaults(traceIn, traceOut, coerce) {
57 Bytes
Loading

test/jasmine/tests/select_test.js

+14
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,18 @@ describe('@flaky Test select box and lasso per trace:', function() {
11511151
var assertRanges = makeAssertRanges('geo');
11521152
var assertLassoPoints = makeAssertLassoPoints('geo');
11531153

1154+
function assertNodeOpacity(exp) {
1155+
var traces = d3.select(gd).selectAll('.scatterlayer > .trace');
1156+
expect(traces.size()).toBe(Object.keys(exp).length, 'correct # of trace <g>');
1157+
1158+
traces.each(function(_, i) {
1159+
d3.select(this).selectAll('path.point').each(function(_, j) {
1160+
expect(Number(this.style.opacity))
1161+
.toBe(exp[i][j], 'node opacity - trace ' + i + ' pt ' + j);
1162+
});
1163+
});
1164+
}
1165+
11541166
var fig = {
11551167
data: [{
11561168
type: 'scattergeo',
@@ -1177,6 +1189,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
11771189
function() {
11781190
assertPoints([[10, 10], [20, 20], [-10, 10], [-20, 20]]);
11791191
assertSelectedPoints({0: [0, 1], 1: [0, 1]});
1192+
assertNodeOpacity({0: [1, 1, 0.2], 1: [1, 1, 0.2]});
11801193
assertRanges([[-28.13, 61.88], [28.13, -50.64]]);
11811194
},
11821195
null, BOXEVENTS, 'scattergeo select'
@@ -1191,6 +1204,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
11911204
function() {
11921205
assertPoints([[-10, 10], [-20, 20], [-30, 30]]);
11931206
assertSelectedPoints({0: [], 1: [0, 1, 2]});
1207+
assertNodeOpacity({0: [0.2, 0.2, 0.2], 1: [1, 1, 1]});
11941208
assertLassoPoints([
11951209
[-56.25, 61.88], [-56.24, 5.63], [0, 5.63], [0, 61.88], [-56.25, 61.88]
11961210
]);

0 commit comments

Comments
 (0)