Skip to content

Commit 9495dee

Browse files
committed
nest scattercontour lines inside a contourlines group
same as contour - it's *probably* ok without this but I'm a little worried about some restyle call changing element order unexpectedly.
1 parent bbb9574 commit 9495dee

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/traces/contourcarpet/plot.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ var mapPathinfo = require('./map_pathinfo');
2323
var lookupCarpet = require('../carpet/lookup_carpetid');
2424
var closeBoundaries = require('./close_boundaries');
2525

26-
function makeg(el, type, klass) {
27-
var join = el.selectAll(type + '.' + klass).data([0]);
28-
join.enter().append(type).classed(klass, true);
29-
return join;
30-
}
31-
3226
module.exports = function plot(gd, plotinfo, cdcontours) {
3327
for(var i = 0; i < cdcontours.length; i++) {
3428
plotOne(gd, plotinfo, cdcontours[i]);
@@ -129,13 +123,19 @@ function plotOne(gd, plotinfo, cd) {
129123
}
130124

131125
function makeLines(plotgroup, pathinfo, contours) {
132-
contourPlot.createLines(plotgroup,
126+
var lineContainer = plotgroup.selectAll('g.contourlines').data([0]);
127+
128+
lineContainer.enter().append('g')
129+
.classed('contourlines', true);
130+
131+
contourPlot.createLines(lineContainer,
133132
contours.showlines !== false, pathinfo);
134133
}
135134

136135
function makeBackground(plotgroup, clipsegments, xaxis, yaxis, isConstraint, coloring) {
137136
var seg, xp, yp, i;
138-
var bggroup = makeg(plotgroup, 'g', 'contourbg');
137+
var bggroup = plotgroup.selectAll('g.contourbg').data([0]);
138+
bggroup.enter().append('g').classed('contourbg', true);
139139

140140
var bgfill = bggroup.selectAll('path')
141141
.data((coloring === 'fill' && !isConstraint) ? [0] : []);

0 commit comments

Comments
 (0)