|
10 | 10 |
|
11 | 11 | var Lib = require('../../lib'); |
12 | 12 | var Color = require('../../components/color'); |
13 | | -var Registry = require('../../registry'); |
14 | 13 | var handleSubplotDefaults = require('../subplot_defaults'); |
15 | 14 | var getSubplotData = require('../get_data').getSubplotData; |
16 | 15 |
|
@@ -62,11 +61,6 @@ function handleDefaults(contIn, contOut, coerce, opts) { |
62 | 61 | orderedCategories(dataAttr, axOut.categoryorder, axOut.categoryarray, subplotData) : |
63 | 62 | []; |
64 | 63 |
|
65 | | - if(axType === 'date') { |
66 | | - var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleDefaults'); |
67 | | - handleCalendarDefaults(axIn, axOut, 'calendar', layoutOut.calendar); |
68 | | - } |
69 | | - |
70 | 64 | var visible = coerceAxis('visible'); |
71 | 65 | setConvert(axOut, layoutOut); |
72 | 66 |
|
@@ -113,6 +107,26 @@ function handleDefaults(contIn, contOut, coerce, opts) { |
113 | 107 | break; |
114 | 108 |
|
115 | 109 | case 'angularaxis': |
| 110 | + // We do not support 'true' date angular axes yet, |
| 111 | + // users can still plot dates on angular axes by setting |
| 112 | + // `angularaxis.type: 'category'`. |
| 113 | + // |
| 114 | + // Here, if a date angular axes is detected, we make |
| 115 | + // all its corresponding traces invisible, so that |
| 116 | + // when we do add support for data angular axes, the new |
| 117 | + // behavior won't conflict with existing behavior |
| 118 | + if(axType === 'date') { |
| 119 | + Lib.log('Polar plots do not support date angular axes yet.'); |
| 120 | + |
| 121 | + for(var j = 0; j < subplotData.length; j++) { |
| 122 | + subplotData[j].visible = false; |
| 123 | + } |
| 124 | + |
| 125 | + // turn this into a 'dummy' linear axis so that |
| 126 | + // the subplot still renders ok |
| 127 | + axType = axIn.type = axOut.type = 'linear'; |
| 128 | + } |
| 129 | + |
116 | 130 | if(axType === 'linear') { |
117 | 131 | coerceAxis('thetaunit'); |
118 | 132 | } else { |
@@ -179,7 +193,6 @@ function handleAxisTypeDefaults(axIn, axOut, coerce, subplotData, dataAttr) { |
179 | 193 | } |
180 | 194 | } |
181 | 195 |
|
182 | | - // TODO add trace input calendar support |
183 | 196 | if(trace) { |
184 | 197 | axOut.type = autoType(trace[dataAttr], 'gregorian'); |
185 | 198 | } |
|
0 commit comments