Skip to content

Commit c94423b

Browse files
committed
adapt polar to clean-subplots improvements
- use new get-subplot-data tools - adapt for new offset and selections in Axes.doTicks - 2018 header
1 parent 0146c2f commit c94423b

File tree

19 files changed

+40
-29
lines changed

19 files changed

+40
-29
lines changed

lib/scatterpolar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017, Plotly, Inc.
2+
* Copyright 2012-2018, Plotly, Inc.
33
* All rights reserved.
44
*
55
* This source code is licensed under the MIT license found in the

src/lib/angles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017, Plotly, Inc.
2+
* Copyright 2012-2018, Plotly, Inc.
33
* All rights reserved.
44
*
55
* This source code is licensed under the MIT license found in the

src/plots/cartesian/line_grid_defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017, Plotly, Inc.
2+
* Copyright 2012-2018, Plotly, Inc.
33
* All rights reserved.
44
*
55
* This source code is licensed under the MIT license found in the

src/plots/domain_attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017, Plotly, Inc.
2+
* Copyright 2012-2018, Plotly, Inc.
33
* All rights reserved.
44
*
55
* This source code is licensed under the MIT license found in the

src/plots/plots.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,9 +2322,8 @@ plots.doCalcdata = function(gd, traces) {
23222322
trace._arrayAttrs = PlotSchema.findArrayAttributes(trace);
23232323
}
23242324

2325-
// TODO maybe move this to Axes.list ??
2326-
// or better yet, make a more general Axes.list
2327-
var polarIds = plots.getSubplotIds(fullLayout, 'polar');
2325+
// add polar axes to axis list
2326+
var polarIds = fullLayout._subplots.polar || [];
23282327
for(i = 0; i < polarIds.length; i++) {
23292328
axList.push(
23302329
fullLayout[polarIds[i]].radialaxis,

src/plots/polar/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017, Plotly, Inc.
2+
* Copyright 2012-2018, Plotly, Inc.
33
* All rights reserved.
44
*
55
* This source code is licensed under the MIT license found in the

src/plots/polar/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017, Plotly, Inc.
2+
* Copyright 2012-2018, Plotly, Inc.
33
* All rights reserved.
44
*
55
* This source code is licensed under the MIT license found in the

src/plots/polar/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
'use strict';
1010

11-
var Plots = require('../../plots/plots');
11+
var getSubplotCalcData = require('../get_data').getSubplotCalcData;
1212
var counterRegex = require('../../lib').counterRegex;
1313

1414
var createPolar = require('./polar');
@@ -35,11 +35,11 @@ attributes[attr] = {
3535
function plot(gd) {
3636
var fullLayout = gd._fullLayout;
3737
var calcData = gd.calcdata;
38-
var subplotIds = Plots.getSubplotIds(fullLayout, name);
38+
var subplotIds = fullLayout._subplots[name];
3939

4040
for(var i = 0; i < subplotIds.length; i++) {
4141
var id = subplotIds[i];
42-
var subplotCalcData = Plots.getSubplotCalcData(calcData, name, id);
42+
var subplotCalcData = getSubplotCalcData(calcData, name, id);
4343
var subplot = fullLayout[id]._subplot;
4444

4545
if(!subplot) {
@@ -52,7 +52,7 @@ function plot(gd) {
5252
}
5353

5454
function clean(newFullData, newFullLayout, oldFullData, oldFullLayout) {
55-
var oldIds = Plots.getSubplotIds(oldFullLayout, name);
55+
var oldIds = oldFullLayout._subplots[name] || [];
5656

5757
for(var i = 0; i < oldIds.length; i++) {
5858
var id = oldIds[i];

src/plots/polar/layout_attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017, Plotly, Inc.
2+
* Copyright 2012-2018, Plotly, Inc.
33
* All rights reserved.
44
*
55
* This source code is licensed under the MIT license found in the

src/plots/polar/layout_defaults.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017, Plotly, Inc.
2+
* Copyright 2012-2018, Plotly, Inc.
33
* All rights reserved.
44
*
55
* This source code is licensed under the MIT license found in the
@@ -10,9 +10,9 @@
1010

1111
var Lib = require('../../lib');
1212
var Color = require('../../components/color');
13-
var Plots = require('../plots');
1413
var Registry = require('../../registry');
1514
var handleSubplotDefaults = require('../subplot_defaults');
15+
var getSubplotData = require('../get_data').getSubplotData;
1616

1717
var handleTickValueDefaults = require('../cartesian/tick_value_defaults');
1818
var handleTickMarkDefaults = require('../cartesian/tick_mark_defaults');
@@ -35,7 +35,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
3535
var sector = coerce('sector');
3636

3737
// could optimize, subplotData is not always needed!
38-
var subplotData = Plots.getSubplotData(opts.fullData, constants.name, opts.id);
38+
var subplotData = getSubplotData(opts.fullData, constants.name, opts.id);
3939
var layoutOut = opts.layoutOut;
4040
var axName;
4141

0 commit comments

Comments
 (0)