Skip to content

Fix range slider svg / eps / pdf exports #1306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions src/components/rangeslider/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ function drawRangePlot(rangeSlider, gd, axisOpts, opts) {

Cartesian.rangePlot(gd, plotinfo, filterRangePlotCalcData(calcData, id));

if(isMainPlot) plotinfo.bg.call(Color.fill, opts.bgcolor);
// no need for the bg layer,
// drawBg handles coloring the background
if(isMainPlot) plotinfo.bg.remove();
});
}

Expand All @@ -404,10 +406,9 @@ function drawMasks(rangeSlider, gd, axisOpts, opts) {
.classed(constants.maskMinClassName, true)
.attr({ x: 0, y: 0 });

maskMin.attr({
height: opts._height,
fill: constants.maskColor
});
maskMin
.attr('height', opts._height)
.call(Color.fill, constants.maskColor);

var maskMax = rangeSlider.selectAll('rect.' + constants.maskMaxClassName)
.data([0]);
Expand All @@ -416,13 +417,14 @@ function drawMasks(rangeSlider, gd, axisOpts, opts) {
.classed(constants.maskMaxClassName, true)
.attr('y', 0);

maskMax.attr({
height: opts._height,
fill: constants.maskColor
});
maskMax
.attr('height', opts._height)
.call(Color.fill, constants.maskColor);
}

function drawSlideBox(rangeSlider, gd, axisOpts, opts) {
if(gd._context.staticPlot) return;

var slideBox = rangeSlider.selectAll('rect.' + constants.slideBoxClassName)
.data([0]);

Expand Down Expand Up @@ -483,6 +485,8 @@ function drawGrabbers(rangeSlider, gd, axisOpts, opts) {

// <g grabarea />

if(gd._context.staticPlot) return;

var grabAreaFixAttrs = {
width: constants.grabAreaWidth,
y: 0,
Expand Down
3 changes: 2 additions & 1 deletion test/image/export_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ var FORMATS = ['svg', 'pdf', 'eps'];

// non-exhaustive list of mocks to test
var DEFAULT_LIST = [
'0', 'geo_first', 'gl3d_z-range', 'text_export', 'layout_image', 'gl2d_12'
'0', 'geo_first', 'gl3d_z-range', 'text_export', 'layout_image', 'gl2d_12',
'range_slider_initial_valid'
];

// return dimensions [in px]
Expand Down