Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2a7696a

Browse filesBrowse files
committed
rangeslider: inherit 'bgcolor' from 'plot_bgcolor'
1 parent b1155a3 commit 2a7696a
Copy full SHA for 2a7696a

File tree

Expand file treeCollapse file tree

2 files changed

+21
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+21
-1
lines changed

‎src/components/rangeslider/defaults.js

Copy file name to clipboardExpand all lines: src/components/rangeslider/defaults.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = function handleDefaults(layoutIn, layoutOut, axName, counterAxe
2727
return Lib.coerce(containerIn, containerOut, attributes, attr, dflt);
2828
}
2929

30-
coerce('bgcolor');
30+
coerce('bgcolor', layoutOut.plot_bgcolor);
3131
coerce('bordercolor');
3232
coerce('borderwidth');
3333
coerce('thickness');

‎test/jasmine/tests/range_slider_test.js

Copy file name to clipboardExpand all lines: test/jasmine/tests/range_slider_test.js
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,26 @@ describe('the range slider', function() {
513513

514514
expect(layoutOut).toEqual(expected);
515515
});
516+
517+
it('should default \'bgcolor\' to layout \'plot_bgcolor\'', function() {
518+
var layoutIn = {
519+
xaxis: { rangeslider: true },
520+
yaxis: {},
521+
};
522+
523+
var layoutOut = {
524+
xaxis: { range: [2, 40]},
525+
yaxis: {},
526+
plot_bgcolor: 'blue'
527+
};
528+
529+
var axName = 'xaxis',
530+
counterAxes = ['yaxis'];
531+
532+
RangeSlider.handleDefaults(layoutIn, layoutOut, axName, counterAxes);
533+
534+
expect(layoutOut.xaxis.rangeslider.bgcolor).toEqual('blue');
535+
});
516536
});
517537

518538
describe('in general', function() {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.