@@ -29,7 +29,6 @@ var costConstants = constants.LABELOPTIMIZER;
29
29
exports . plot = function plot ( gd , plotinfo , cdcontours , contourLayer ) {
30
30
var xa = plotinfo . xaxis ;
31
31
var ya = plotinfo . yaxis ;
32
- var fullLayout = gd . _fullLayout ;
33
32
34
33
Lib . makeTraceGroups ( contourLayer , cdcontours , 'contour' ) . each ( function ( cd ) {
35
34
var plotGroup = d3 . select ( this ) ;
@@ -78,7 +77,7 @@ exports.plot = function plot(gd, plotinfo, cdcontours, contourLayer) {
78
77
makeBackground ( plotGroup , perimeter , contours ) ;
79
78
makeFills ( plotGroup , fillPathinfo , perimeter , contours ) ;
80
79
makeLinesAndLabels ( plotGroup , pathinfo , gd , cd0 , contours , perimeter ) ;
81
- clipGaps ( plotGroup , plotinfo , fullLayout . _clips , cd0 , perimeter ) ;
80
+ clipGaps ( plotGroup , plotinfo , gd , cd0 , perimeter ) ;
82
81
} ) ;
83
82
} ;
84
83
@@ -230,8 +229,7 @@ function makeLinesAndLabels(plotgroup, pathinfo, gd, cd0, contours, perimeter) {
230
229
// In this case we'll remove the lines after making the labels.
231
230
var linegroup = exports . createLines ( lineContainer , showLines || showLabels , pathinfo ) ;
232
231
233
- var lineClip = exports . createLineClip ( lineContainer , clipLinesForLabels ,
234
- gd . _fullLayout . _clips , cd0 . trace . uid ) ;
232
+ var lineClip = exports . createLineClip ( lineContainer , clipLinesForLabels , gd , cd0 . trace . uid ) ;
235
233
236
234
var labelGroup = plotgroup . selectAll ( 'g.contourlabels' )
237
235
. data ( showLabels ? [ 0 ] : [ ] ) ;
@@ -373,7 +371,8 @@ exports.createLines = function(lineContainer, makeLines, pathinfo) {
373
371
return linegroup ;
374
372
} ;
375
373
376
- exports . createLineClip = function ( lineContainer , clipLinesForLabels , clips , uid ) {
374
+ exports . createLineClip = function ( lineContainer , clipLinesForLabels , gd , uid ) {
375
+ var clips = gd . _fullLayout . _clips ;
377
376
var clipId = clipLinesForLabels ? ( 'clipline' + uid ) : null ;
378
377
379
378
var lineClip = clips . selectAll ( '#' + clipId )
@@ -384,7 +383,7 @@ exports.createLineClip = function(lineContainer, clipLinesForLabels, clips, uid)
384
383
. classed ( 'contourlineclip' , true )
385
384
. attr ( 'id' , clipId ) ;
386
385
387
- Drawing . setClipUrl ( lineContainer , clipId ) ;
386
+ Drawing . setClipUrl ( lineContainer , clipId , gd ) ;
388
387
389
388
return lineClip ;
390
389
} ;
@@ -615,7 +614,8 @@ exports.drawLabels = function(labelGroup, labelData, gd, lineClip, labelClipPath
615
614
}
616
615
} ;
617
616
618
- function clipGaps ( plotGroup , plotinfo , clips , cd0 , perimeter ) {
617
+ function clipGaps ( plotGroup , plotinfo , gd , cd0 , perimeter ) {
618
+ var clips = gd . _fullLayout . _clips ;
619
619
var clipId = 'clip' + cd0 . trace . uid ;
620
620
621
621
var clipPath = clips . selectAll ( '#' + clipId )
@@ -654,7 +654,7 @@ function clipGaps(plotGroup, plotinfo, clips, cd0, perimeter) {
654
654
}
655
655
else clipId = null ;
656
656
657
- plotGroup . call ( Drawing . setClipUrl , clipId ) ;
657
+ Drawing . setClipUrl ( plotGroup , clipId , gd ) ;
658
658
}
659
659
660
660
function makeClipMask ( cd0 ) {
0 commit comments