Skip to content

Commit 91064ca

Browse files
committed
add 📚 about axes in polar subplots
1 parent 87a3920 commit 91064ca

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Diff for: src/plots/polar/polar.js

+26
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,32 @@ proto.updateLayers = function(fullLayout, polarLayout) {
156156
join.order();
157157
};
158158

159+
/* Polar subplots juggle with 6 'axis objects' (!), these are:
160+
*
161+
* - polarLayout.radialaxis (aka radialLayout in this file):
162+
* - polarLayout.angularaxis (aka angularLayout in this file):
163+
* used for data -> calcdata conversions (aka d2c) during the calc step
164+
*
165+
* - this.radialAxis
166+
* extends polarLayout.radialaxis, adds mocked 'domain' and
167+
* few other keys in order to reuse Cartesian doAutoRange and doTicksSingle,
168+
* used for calcdata -> geometric conversions (aka c2g) during the plot step
169+
* + setGeometry setups ax.c2g for given ax.range
170+
* + setScale setups ax._m,ax._b for given ax.range
171+
*
172+
* - this.angularAxis
173+
* extends polarLayout.angularaxis, adds mocked 'range' and 'domain' and
174+
* a few other keys in order to reuse Cartesian doTicksSingle,
175+
* used for calcdata -> geometric conversions (aka c2g) during the plot step
176+
* + setGeometry setups ax.c2g given ax.rotation, ax.direction & ax._categories,
177+
* and mocks ax.range
178+
* + setScale setups ax._m,ax._b with that mocked ax.range
179+
*
180+
* - this.xaxis
181+
* - this.yaxis
182+
* setup so that polar traces can reuse plot methods of Cartesian traces
183+
* which mostly rely on 2pixel methods (e.g ax.c2p)
184+
*/
159185
proto.updateLayout = function(fullLayout, polarLayout) {
160186
var _this = this;
161187
var layers = _this.layers;

0 commit comments

Comments
 (0)