Skip to content

Commit 04bf7b5

Browse files
committed
Plot Area: Fix plot clip path rect sizing on update
The d3 selection was only being created. This has added an update "join" on the selection.
1 parent 1f406e5 commit 04bf7b5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/plot_api/plot_api.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2887,23 +2887,28 @@ function lsInner(gd) {
28872887
.call(Color.fill, fullLayout.plot_bgcolor);
28882888
}
28892889

2890+
28902891
// Clip so that data only shows up on the plot area.
28912892
var clips = fullLayout._defs.selectAll('g.clips'),
28922893
clipId = 'clip' + fullLayout._uid + subplot + 'plot';
28932894

2894-
clips.selectAll('#' + clipId)
2895-
.data([0])
2896-
.enter().append('clipPath')
2895+
var plotClip = clips.selectAll('#' + clipId)
2896+
.data([0]);
2897+
2898+
plotClip.enter().append('clipPath')
28972899
.attr({
28982900
'class': 'plotclip',
28992901
'id': clipId
29002902
})
2901-
.append('rect')
2903+
.append('rect');
2904+
2905+
plotClip.selectAll('rect')
29022906
.attr({
29032907
'width': xa._length,
29042908
'height': ya._length
29052909
});
29062910

2911+
29072912
plotinfo.plot.attr({
29082913
'transform': 'translate(' + xa._offset + ', ' + ya._offset + ')',
29092914
'clip-path': 'url(#' + clipId + ')'

0 commit comments

Comments
 (0)