Commit | Line | Data |
---|---|---|
20590000 RK |
1 | // Copyright (c) 2011 Google, Inc. |
2 | // | |
3 | // Permission is hereby granted, free of charge, to any person obtaining a copy | |
4 | // of this software and associated documentation files (the "Software"), to deal | |
5 | // in the Software without restriction, including without limitation the rights | |
6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
7 | // copies of the Software, and to permit persons to whom the Software is | |
8 | // furnished to do so, subject to the following conditions: | |
9 | // | |
10 | // The above copyright notice and this permission notice shall be included in | |
11 | // all copies or substantial portions of the Software. | |
12 | // | |
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
19 | // THE SOFTWARE. | |
20 | ||
21 | /** | |
22 | * @fileoverview List of options and their types, used for the palette. | |
23 | * | |
24 | * @author konigsberg@google.com (Robert Konigsberg) | |
25 | */ | |
26 | ||
27 | "use strict"; | |
28 | ||
58a18b02 RK |
29 | /** |
30 | * Options availabile to the palette. | |
31 | * | |
32 | * Each entry is the name of the option, followed by: | |
33 | * type: describes the type of option, which can be: | |
34 | * boolean|string|float|int|array<boolean>|array<int>|array<float>|array<Date> | |
35 | * or function(parameter list) | |
36 | * scope: if empty, then available in global scope only. Otherwise, | |
37 | * it's an array with possible values global|series|x|y|y2|highlight. | |
38 | */ | |
20590000 | 39 | var opts = { |
f4463776 RK |
40 | // These two exist, but are not used by the palette at all. |
41 | series : { type : null, scope : [] }, | |
42 | axes : { type : null, scope : [] }, | |
43 | ||
dd371798 RK |
44 | animatedZooms : { |
45 | type : "boolean" | |
46 | }, | |
47 | annotationClickHandler : { | |
48 | type : "function(annotation, point, dygraph, event)" | |
49 | }, | |
50 | annotationDblClickHandler : { | |
51 | type : "function(annotation, point, dygraph, event)" | |
52 | }, | |
53 | annotationMouseOutHandler : { | |
54 | type : "function(annotation, point, dygraph, event)" | |
55 | }, | |
56 | annotationMouseOverHandler : { | |
57 | type : "function(annotation, point, dygraph, event)" | |
58 | }, | |
59 | avoidMinZero : { | |
60 | type : "boolean" | |
61 | }, | |
62 | axisLabelColor : { | |
58a18b02 RK |
63 | type : "string", |
64 | // scope : [ "x", "y", "y2" ] | |
dd371798 RK |
65 | }, |
66 | axisLabelFontSize : { | |
58a18b02 RK |
67 | type : "int", |
68 | // scope : [ "x", "y", "y2" ] | |
69 | }, | |
70 | axisLabelFormatter : { | |
71 | type : "function(numberOrDate, granularity, opts, dygraph)", | |
72 | scope : [ "x", "y", "y2" ] | |
dd371798 RK |
73 | }, |
74 | axisLabelWidth : { | |
58a18b02 RK |
75 | type : "int", |
76 | // scope : [ "x", "y", "y2" ] | |
dd371798 RK |
77 | }, |
78 | axisLineColor : { | |
58a18b02 RK |
79 | type : "string", |
80 | // scope : [ "x", "y", "y2" ] | |
dd371798 RK |
81 | }, |
82 | axisLineWidth : { | |
58a18b02 RK |
83 | type : "int", |
84 | // scope : [ "x", "y", "y2" ] | |
dd371798 RK |
85 | }, |
86 | axisTickSize : { | |
58a18b02 RK |
87 | type : "int", |
88 | // scope : [ "x", "y", "y2" ] | |
dd371798 RK |
89 | }, |
90 | clickCallback : { | |
91 | type : "function(e, x, points)" | |
92 | }, | |
93 | colorSaturation : { | |
94 | type : "float" | |
95 | }, | |
96 | colors : { | |
97 | type : "array<string>" | |
98 | }, | |
99 | colorValue : { | |
100 | type : "float" | |
101 | }, | |
102 | connectSeparatedPoints : { | |
103 | type : "boolean" | |
104 | }, | |
105 | customBars : { | |
106 | type : "boolean" | |
107 | }, | |
108 | dateWindow : { | |
109 | type : "array<Date>" | |
110 | }, | |
111 | delimiter : { | |
112 | type : "string" | |
113 | }, | |
114 | digitsAfterDecimal : { | |
115 | type : "int" | |
116 | }, | |
117 | displayAnnotations : { | |
118 | type : "boolean" | |
119 | }, | |
120 | drawAxesAtZero : { | |
121 | type : "boolean" | |
122 | }, | |
123 | drawCallback : { | |
124 | type : "function(dygraph, is_initial)" | |
125 | }, | |
126 | drawGapEdgePoints : { | |
127 | type : "boolean" | |
128 | }, | |
129 | drawHighlightPointCallback : { | |
58a18b02 RK |
130 | type : "function(g, seriesName, canvasContext, cx, cy, color, pointSize)", |
131 | scope : [ "global", "series", "y", "y2" ] | |
dd371798 RK |
132 | }, |
133 | drawPoints : { | |
58a18b02 RK |
134 | type : "boolean", |
135 | scope : [ "global", "series", "y", "y2" ] | |
dd371798 RK |
136 | }, |
137 | drawPointCallback : { | |
58a18b02 RK |
138 | type : "function(g, seriesName, canvasContext, cx, cy, color, pointSize)", |
139 | scope : [ "global", "series", "y", "y2" ] | |
dd371798 RK |
140 | }, |
141 | drawXAxis : { | |
142 | type : "boolean" | |
143 | }, | |
144 | drawXGrid : { | |
145 | type : "boolean" | |
146 | }, | |
147 | drawYAxis : { | |
148 | type : "boolean" | |
149 | }, | |
150 | drawYGrid : { | |
151 | type : "boolean" | |
152 | }, | |
153 | errorBars : { | |
154 | type : "boolean" | |
155 | }, | |
156 | fillAlpha : { | |
157 | type : "float" | |
158 | }, | |
159 | fillGraph : { | |
160 | type : "boolean" | |
161 | }, | |
162 | fractions : { | |
163 | type : "boolean" | |
164 | }, | |
165 | gridLineColor : { | |
166 | type : "string" | |
167 | }, | |
168 | gridLineWidth : { | |
169 | type : "int" | |
170 | }, | |
171 | height : { | |
172 | type : "int" | |
173 | }, | |
174 | hideOverlayOnMouseOut : { | |
175 | type : "boolean" | |
176 | }, | |
177 | highlightCallback : { | |
178 | type : "function(event, x, points,row)" | |
179 | }, | |
180 | highlightCircleSize : { | |
f4463776 RK |
181 | type : "int", |
182 | scope : [ "global", "series", "y", "y2" ] | |
dd371798 RK |
183 | }, |
184 | includeZero : { | |
185 | type : "boolean" | |
186 | }, | |
187 | isZoomedIgnoreProgrammaticZoom : { | |
188 | type : "boolean" | |
189 | }, | |
190 | labelsDivWidth : { | |
191 | type : "integer" | |
192 | }, | |
193 | labels : { | |
194 | type : "array<string>" | |
195 | }, | |
196 | labelsKMB : { | |
197 | type : "boolean" | |
198 | }, | |
199 | labelsKMG2 : { | |
200 | type : "boolean" | |
201 | }, | |
202 | labelsSeparateLines : { | |
203 | type : "boolean" | |
204 | }, | |
205 | labelsShowZeroValues : { | |
206 | type : "boolean" | |
207 | }, | |
208 | legend : { | |
209 | type : "string" | |
210 | }, | |
211 | logscale : { | |
212 | type : "boolean" | |
213 | }, | |
214 | maxNumberWidth : { | |
215 | type : "int" | |
216 | }, | |
217 | panEdgeFraction : { | |
218 | type : "float" | |
219 | }, | |
220 | pixelsPerLabel : { | |
221 | type : "int" | |
222 | }, | |
223 | pixelsPerXLabel : { | |
224 | type : "int" | |
225 | }, | |
226 | pixelsPerYLabel : { | |
227 | type : "int" | |
228 | }, | |
229 | pointClickCallback : { | |
230 | type : "function(e, point)" | |
231 | }, | |
232 | pointSize : { | |
58a18b02 RK |
233 | type : "integer", |
234 | scope : [ "global", "series", "y", "y2" ] | |
dd371798 RK |
235 | }, |
236 | rangeSelectorHeight : { | |
237 | type : "int" | |
238 | }, | |
239 | rangeSelectorPlotFillColor : { | |
240 | type : "int" | |
241 | }, | |
242 | rangeSelectorPlotStrokeColor : { | |
243 | type : "int" | |
244 | }, | |
245 | rightGap : { | |
246 | type : "boolean" | |
247 | }, | |
248 | rollPeriod : { | |
249 | type : "int" | |
250 | }, | |
251 | showLabelsOnHighlight : { | |
252 | type : "boolean" | |
253 | }, | |
254 | showRangeSelector : { | |
255 | type : "boolean" | |
256 | }, | |
257 | showRoller : { | |
258 | type : "boolean" | |
259 | }, | |
260 | sigFigs : { | |
261 | type : "int" | |
262 | }, | |
263 | sigma : { | |
264 | type : "float" | |
265 | }, | |
266 | stackedGraph : { | |
267 | type : "boolean" | |
268 | }, | |
269 | stepPlot : { | |
270 | type : "boolean" | |
271 | }, | |
272 | strokeBorderColor : { | |
f4463776 RK |
273 | type : "string", |
274 | scope : [ "global", "series", "y", "y2" ] | |
dd371798 RK |
275 | }, |
276 | strokeBorderWidth : { | |
f4463776 RK |
277 | type : "float", |
278 | scope : [ "global", "series", "y", "y2" ] | |
dd371798 RK |
279 | }, |
280 | strokePattern : { | |
9ccb0d6e | 281 | type : "array<int>", |
f4463776 | 282 | scope : [ "global", "series", "y", "y2" ] |
dd371798 RK |
283 | }, |
284 | strokeWidth : { | |
9ccb0d6e | 285 | type : "float", |
f4463776 | 286 | scope : [ "global", "series", "y", "y2" ] |
dd371798 RK |
287 | }, |
288 | timingName : { | |
289 | type : "string" | |
290 | }, | |
291 | title : { | |
292 | type : "string" | |
293 | }, | |
294 | titleHeight : { | |
295 | type : "integer" | |
296 | }, | |
297 | underlayCallback : { | |
298 | type : "function(canvas, area, dygraph)" | |
299 | }, | |
300 | unhighlightCallback : { | |
301 | type : "function(event)" | |
302 | }, | |
303 | valueRange : { | |
304 | type : "array<float>" | |
305 | }, | |
306 | visibility : { | |
307 | type : "array<boolean>" | |
308 | }, | |
309 | width : { | |
310 | type : "int" | |
311 | }, | |
312 | wilsonInterval : { | |
313 | type : "boolean" | |
314 | }, | |
315 | xAxisHeight : { | |
316 | type : "int" | |
317 | }, | |
318 | xAxisLabelWidth : { | |
319 | type : "int" | |
320 | }, | |
321 | xLabelHeight : { | |
322 | type : "int" | |
323 | }, | |
324 | xlabel : { | |
325 | type : "string" | |
326 | }, | |
327 | xValueParser : { | |
328 | type : "function(str)" | |
329 | }, | |
330 | yAxisLabelWidth : { | |
331 | type : "int" | |
332 | }, | |
333 | yLabelWidth : { | |
334 | type : "int" | |
335 | }, | |
336 | ylabel : { | |
337 | type : "string" | |
338 | }, | |
339 | zoomCallback : { | |
340 | type : "function(minDate, maxDate, yRanges)" | |
f4463776 | 341 | } |
dd371798 RK |
342 | }; |
343 |