8000 Revert "detect polar with hasPolar" · garyfeng/plotly.js@dff3830 · GitHub
[go: up one dir, main page]

Skip to content

Commit dff3830

Browse files
committed
Revert "detect polar with hasPolar"
This reverts commit c009426.
1 parent c009426 commit dff3830

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

src/plot_api/plot_api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Plotly.plot = function(gd, data, layout, config) {
121121
Plots.supplyDefaults(gd);
122122

123123
// Polar plots
124-
if(gd._fullLayout._hasPolar) return plotPolar(gd, data, layout);
124+
if(data && data[0] && data[0].r) return plotPolar(gd, data, layout);
125125

126126
// so we don't try to re-call Plotly.plot from inside
127127
// legend and colorbar, if margins changed

src/plots/plots.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,6 @@ plots.getSubplotData = function getSubplotData(data, type, subplotId) {
258258
// the text is at first, so it needs to draw it,
259259
// then wait a little, then draw it again
260260
plots.redrawText = function(gd) {
261-
262-
// do not work for polar plots
263-
if(gd._fullLayout._hasPolar) return;
264-
265261
return new Promise(function(resolve) {
266262
setTimeout(function() {
267263
Plotly.Annotations.drawAll(gd);
@@ -476,7 +472,7 @@ plots.supplyDefaults = function(gd) {
476472
newFullData.push(fullTrace);
477473

478474
// detect polar
479-
if('r' in newData[i]) newFullLayout._hasPolar = true;
475+
if('r' in fullTrace) newFullLayout._hasPolar = true;
480476

481477
_module = fullTrace._module;
482478
if(!_module) continue;
@@ -486,8 +482,6 @@ plots.supplyDefaults = function(gd) {
486482
Lib.fillUnique(basePlotModules, fullTrace._module.basePlotModule);
487483
}
488484

489-
console.log(newFullLayout._hasPolar)
490-
491485
// attach helper method
492486
oldFullLayout._has = hasPlotType.bind(oldFullLayout);
493487
newFullLayout._has = hasPlotType.bind(newFullLayout);

src/snapshot/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ function getDelay(fullLayout) {
1515
}
1616

1717
function getRedrawFunc(gd) {
18-
19-
// do not work for polar plots
20-
if(gd._fullLayout._hasPolar) return;
21-
2218
return function() {
2319
(gd.calcdata || []).forEach(function(d) {
2420
if(d[0] && d[0].t && d[0].t.cb) d[0].t.cb();

0 commit comments

Comments
 (0)
0