@@ -20,6 +20,37 @@ var ONEAVGYEAR = require('../../constants/numerical').ONEAVGYEAR;
20
20
21
21
var extendFlat = require ( '../../lib/extend' ) . extendFlat ;
22
22
23
+ function axisPeriod ( axis ) {
24
+ return {
25
+ valType : 'any' ,
26
+ dflt : ONEAVGYEAR ,
27
+ role : 'info' ,
28
+ editType : 'calc' ,
29
+ description : [
30
+ 'Only relevant when the axis `type` is *date*.' ,
31
+ 'Sets the period positioning in milliseconds or *M<n>* on the ' + axis + ' axis.' ,
32
+ 'Special values in the form of *M<n>* could be used to declare' ,
33
+ 'the number of "average" months. In this case `n` must be a positive integer.'
34
+ ] . join ( ' ' )
35
+ } ;
36
+ }
37
+
38
+ function axisPeriodAlignment ( axis ) {
39
+ return {
40
+ valType : 'enumerated' ,
41
+ values : [
42
+ 'start' , 'middle' , 'end'
43
+ ] ,
44
+ dflt : 'start' ,
45
+ role : 'style' ,
46
+ editType : 'calc' ,
47
+ description : [
48
+ 'Only relevant when the axis `type` is *date*.' ,
49
+ 'Sets the alignment of data points on the ' + axis + ' axis.'
50
+ ] . join ( ' ' )
51
+ } ;
52
+ }
53
+
23
54
module . exports = {
24
55
x : {
25
56
valType : 'data_array' ,
@@ -82,59 +113,10 @@ module.exports = {
82
113
] . join ( ' ' )
83
114
} ,
84
115
85
- xperiod : {
86
- valType : 'number' ,
87
- dflt : ONEAVGYEAR ,
88
- min : 0 ,
89
- role : 'info' ,
90
- editType : 'calc' ,
91
- anim : true ,
92
- description : [
93
- 'Only relevant when the axis `type` is *date*.' ,
94
- 'Sets the period positioning in milliseconds' ,
95
- 'on the x axis.'
96
- ] . join ( ' ' )
97
- } ,
98
- xperiodalignment : {
99
- valType : 'enumerated' ,
100
- values : [
101
- 'start' , 'middle' , 'end'
102
- ] ,
103
- dflt : 'start' ,
104
- role : 'style' ,
105
- editType : 'calc' ,
106
- description : [
107
- 'Only relevant when the axis `type` is *date*.' ,
108
- 'Sets the alignment of data points' ,
109
- 'on the x axis.'
110
- ] . join ( ' ' )
111
- } ,
112
- yperiod : {
113
- valType : 'number' ,
114
- dflt : ONEAVGYEAR ,
115
- min : 0 ,
116
- role : 'info' ,
117
- editType : 'calc' ,
118
- description : [
119
- 'Only relevant when the axis `type` is *date*.' ,
120
- 'Sets the period positioning in milliseconds' ,
121
- 'on the y axis.'
122
- ] . join ( ' ' )
123
- } ,
124
- yperiodalignment : {
125
- valType : 'enumerated' ,
126
- values : [
127
- 'start' , 'middle' , 'end'
128
- ] ,
129
- dflt : 'start' ,
130
- role : 'style' ,
131
- editType : 'calc' ,
132
- description : [
133
- 'Only relevant when the axis `type` is *date*.' ,
134
- 'Sets the alignment of data points' ,
135
- 'on the y axis.'
136
- ] . join ( ' ' )
137
- } ,
116
+ xperiod : axisPeriod ( 'x' ) ,
117
+ yperiod : axisPeriod ( 'y' ) ,
118
+ xperiodalignment : axisPeriodAlignment ( 'x' ) ,
119
+ yperiodalignment : axisPeriodAlignment ( 'y' ) ,
138
120
139
121
stackgroup : {
140
122
valType : 'string' ,
0 commit comments