Skip to content

Commit 7b62b73

Browse files
committed
handle cliponaxis false/true traces coexisting on same subplot
1 parent 0496144 commit 7b62b73

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/traces/scatter/plot.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
404404
var trace = d[0].trace,
405405
s = d3.select(this),
406406
showMarkers = subTypes.hasMarkers(trace),
407-
showText = subTypes.hasText(trace),
408-
hasClipOnAxisFalse = trace.cliponaxis === false;
407+
showText = subTypes.hasText(trace);
409408

410409
var keyFunc = getKeyFunc(trace),
411410
markerFilter = hideFilter,
@@ -450,7 +449,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
450449
if(hasNode) {
451450
Drawing.singlePointStyle(d, sel, trace, markerScale, lineScale, gd);
452451

453-
if(hasClipOnAxisFalse) {
452+
if(plotinfo.layerClipId) {
454453
Drawing.hideOutsideRangePoint(d, sel, xa, ya);
455454
}
456455

@@ -486,7 +485,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
486485
hasNode = Drawing.translatePoint(d, sel, xa, ya);
487486

488487
if(hasNode) {
489-
if(hasClipOnAxisFalse) {
488+
if(plotinfo.layerClipId) {
490489
Drawing.hideOutsideRangePoint(d, g, xa, ya);
491490
}
492491
} else {
@@ -525,6 +524,13 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
525524
.each(makePoints);
526525

527526
join.exit().remove();
527+
528+
// lastly, clip points groups of `cliponaxis !== false` traces
529+
// on `plotinfo._hasClipOnAxisFalse === true` subplots
530+
join.each(function(d) {
531+
var hasClipOnAxisFalse = d[0].trace.cliponaxis === false;
532+
Drawing.setClipUrl(d3.select(this), hasClipOnAxisFalse ? null : plotinfo.layerClipId);
533+
});
528534
}
529535

530536
function selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll) {

0 commit comments

Comments
 (0)