Skip to content

Commit 6f26baa

Browse files
committed
use Drawing.setClipUrl when creating subplots and range slider nodes:
- So that clip paths work in cases where <base> is set, for example in some version of AngularJS angular/angular.js#8934
1 parent d8e27dd commit 6f26baa

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/rangeslider/range_plot.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
'use strict';
1010

11+
var d3 = require('d3');
12+
1113
var Symbols = require('../drawing/symbol_defs');
1214
var Drawing = require('../drawing');
1315

@@ -38,7 +40,7 @@ module.exports = function rangePlot(gd, w, h) {
3840
clipDefs.appendChild(clip);
3941

4042
var rangePlot = document.createElementNS(svgNS, 'g');
41-
rangePlot.setAttribute('clip-path', 'url(#range-clip-path)');
43+
d3.select(rangePlot).call(Drawing.setClipUrl, 'range-clip-path');
4244
rangePlot.appendChild(clipDefs);
4345

4446

src/plot_api/plot_api.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -2913,10 +2913,8 @@ function lsInner(gd) {
29132913
});
29142914

29152915

2916-
plotinfo.plot.attr({
2917-
'transform': 'translate(' + xa._offset + ', ' + ya._offset + ')',
2918-
'clip-path': 'url(#' + clipId + ')'
2919-
});
2916+
plotinfo.plot.call(Lib.setTranslate, xa._offset, ya._offset);
2917+
plotinfo.plot.call(Drawing.setClipUrl, clipId);
29202918

29212919
var xlw = Drawing.crispRound(gd, xa.linewidth, 1),
29222920
ylw = Drawing.crispRound(gd, ya.linewidth, 1),

0 commit comments

Comments
 (0)