8000 rename *circle keys · plotly/plotly.js@0ad5b62 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0ad5b62

Browse files
committed
rename *circle keys
... in preparation fo polygon grids to avoid confusion
1 parent 1a050e8 commit 0ad5b62

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

src/plots/polar/polar.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ function Polar(gd, id) {
5151
var fullLayout = gd._fullLayout;
5252
var clipIdBase = 'clip' + fullLayout._uid + id;
5353

54-
this.clipIds.circle = clipIdBase + '-circle';
55-
this.clipPaths.circle = fullLayout._clips.append('clipPath')
56-
.attr('id', this.clipIds.circle);
57-
this.clipPaths.circle.append('path');
54+
this.clipIds.forTraces = clipIdBase + '-for-traces';
55+
this.clipPaths.forTraces = fullLayout._clips.append('clipPath')
56+
.attr('id', this.clipIds.forTraces);
57+
this.clipPaths.forTraces.append('path');
5858

5959
this.framework = fullLayout._polarlayer.append('g')
6060
.attr('class', id);
@@ -130,7 +130,7 @@ proto.updateLayers = function(fullLayout, polarLayout) {
130130
sel.append('g').classed('maplayer', true);
131131
break;
132132
case 'plotbg':
133-
layers.bgcircle = sel.append('path');
133+
layers.bg = sel.append('path');
134134
break;
135135
case 'radial-grid':
136136
sel.style('fill', 'none');
@@ -235,19 +235,18 @@ proto.updateLayout = function(fullLayout, polarLayout) {
235235
xaxis.isPtWithinRange = function(d) { return _this.isPtWithinSector(d); };
236236
yaxis.isPtWithinRange = function() { return true; };
237237

238+
_this.clipPaths.forTraces.select('path')
239+
.attr('d', pathSectorClosed(radius, sector))
240+
.attr('transform', strTranslate(cxx, cyy));
241+
238242
layers.frontplot
239243
.attr('transform', strTranslate(xOffset2, yOffset2))
240-
.call(Drawing.setClipUrl, _this._hasClipOnAxisFalse ? null : _this.clipIds.circle);
244+
.call(Drawing.setClipUrl, _this._hasClipOnAxisFalse ? null : _this.clipIds.forTraces);
241245

242-
layers.bgcircle.attr({
243-
d: pathSectorClosed(radius, sector),
244-
transform: strTranslate(cx, cy)
245-
})
246-
.call(Color.fill, polarLayout.bgcolor);
247-
248-
_this.clipPaths.circle.select('path')
246+
layers.bg
249247
.attr('d', pathSectorClosed(radius, sector))
250-
.attr('transform', strTranslate(cxx, cyy));
248+
.attr('transform', strTranslate(cx, cy))
249+
.call(Color.fill, polarLayout.bgcolor);
251250

252251
// remove crispEdges - all the off-square angles in polar plots
253252
// make these counterproductive.

src/traces/scatterpolar/plot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = function plot(gd, subplot, moduleCalcData) {
1818
xaxis: subplot.xaxis,
1919
yaxis: subplot.yaxis,
2020
plot: subplot.framework,
21-
layerClipId: subplot._hasClipOnAxisFalse ? subplot.clipIds.circle : null
21+
layerClipId: subplot._hasClipOnAxisFalse ? subplot.clipIds.forTraces : null
2222
};
2323

2424
var radialAxis = subplot.radialAxis;

test/jasmine/tests/polar_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ describe('Test relayout on polar subplots:', function() {
522522

523523
var clipCnt = 0;
524524
d3.selectAll('clipPath').each(function() {
525-
if(/polar-circle$/.test(this.id)) clipCnt++;
525+
if(/polar-for-traces/.test(this.id)) clipCnt++;
526526
});
527527
expect(clipCnt).toBe(exp.clip, '# clip paths');
528528
}

0 commit comments

Comments
 (0)
0