Skip to content

Commit fa84c68

Browse files
committed
globally safe clipPath #1
1 parent 3cab51d commit fa84c68

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/traces/table/plot.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ module.exports = function plot(gd, wrappedTraceHolders) {
8282
.attr('width', function(d) {return d.width;})
8383
.attr('height', function(d) {return d.height;});
8484

85-
tableControlView.attr('clip-path', function(d) {return 'url(#scrollAreaBottomClip_' + d.key + ')';});
85+
tableControlView
86+
.each(function(d) {Drawing.setClipUrl(tableControlView, scrollAreaBottomClipKey(gd, d));});
8687

8788
var yColumn = tableControlView.selectAll('.yColumn')
8889
.data(function(vm) {return vm.columns;}, gup.keyFun);
@@ -174,7 +175,7 @@ module.exports = function plot(gd, wrappedTraceHolders) {
174175
scrollAreaClip.enter()
175176
.append('clipPath')
176177
.classed('scrollAreaClip', true)
177-
.attr('id', function(d) { return 'scrollAreaBottomClip_' + d.key;});
178+
.attr('id', function(d) {return scrollAreaBottomClipKey(gd, d);});
178179

179180
var scrollAreaClipRect = scrollAreaClip.selectAll('.scrollAreaClipRect')
180181
.data(gup.repeat, gup.keyFun);
@@ -225,6 +226,10 @@ module.exports = function plot(gd, wrappedTraceHolders) {
225226
updateBlockYPosition(null, cellsColumnBlock, tableControlView);
226227
};
227228

229+
function scrollAreaBottomClipKey(gd, d) {
230+
return 'clip' + gd._fullLayout._uid + '_scrollAreaBottomClip_' + d.key;
231+
}
232+
228233
function flatData(selection) {
229234
return [].concat.apply([], selection.map(function(g) {return g;}))
230235
.map(function(g) {return g.__data__;});

0 commit comments

Comments
 (0)