Merge pull request #507 from danvk/markdown-readme
[dygraphs.git] / experimental / palette / options.js
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
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 */
39 var opts = {
40 // These two exist, but are not used by the palette at all.
41 series : { type : null, scope : [] },
42 axes : { type : null, scope : [] },
43
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 axis : {
63 type : "string",
64 scope : [ "series" ]
65 },
66 axisLabelColor : {
67 type : "string",
68 scope : [ "global", "x", "y", "y2" ]
69 },
70 axisLabelFontSize : {
71 type : "int",
72 scope : [ "global", "x", "y", "y2" ]
73 },
74 axisLabelFormatter : {
75 type : "function(numberOrDate, granularity, opts, dygraph)",
76 scope : [ "x", "y", "y2" ]
77 },
78 axisLabelWidth : {
79 type : "int",
80 // scope : [ "global", "x", "y", "y2" ]
81 },
82 axisLineColor : {
83 type : "string",
84 scope : [ "global", "x", "y", "y2" ]
85 },
86 axisLineWidth : {
87 type : "int",
88 scope : [ "global", "x", "y", "y2" ]
89 },
90 axisTickSize : {
91 type : "int",
92 // scope : [ "global", "x", "y", "y2" ]
93 },
94 clickCallback : {
95 type : "function(e, x, points)"
96 },
97 colorSaturation : {
98 type : "float"
99 },
100 colors : {
101 type : "array<string>"
102 },
103 colorValue : {
104 type : "float"
105 },
106 connectSeparatedPoints : {
107 type : "boolean"
108 },
109 customBars : {
110 type : "boolean"
111 },
112 dateWindow : {
113 type : "array<Date>"
114 },
115 delimiter : {
116 type : "string"
117 },
118 digitsAfterDecimal : {
119 type : "int"
120 },
121 displayAnnotations : {
122 type : "boolean"
123 },
124 drawAxesAtZero : {
125 type : "boolean"
126 },
127 drawCallback : {
128 type : "function(dygraph, is_initial)"
129 },
130 drawGapEdgePoints : {
131 type : "boolean"
132 },
133 drawHighlightPointCallback : {
134 type : "function(g, seriesName, canvasContext, cx, cy, color, pointSize)",
135 scope : [ "global", "series", "y", "y2" ]
136 },
137 drawPoints : {
138 type : "boolean",
139 scope : [ "global", "series", "y", "y2" ]
140 },
141 drawPointCallback : {
142 type : "function(g, seriesName, canvasContext, cx, cy, color, pointSize)",
143 scope : [ "global", "series", "y", "y2" ]
144 },
145 drawXAxis : {
146 type : "boolean"
147 },
148 drawXGrid : {
149 type : "boolean"
150 },
151 drawYAxis : {
152 type : "boolean"
153 },
154 drawYGrid : {
155 type : "boolean"
156 },
157 errorBars : {
158 type : "boolean"
159 },
160 fillAlpha : {
161 type : "float"
162 },
163 fillGraph : {
164 type : "boolean"
165 },
166 fractions : {
167 type : "boolean"
168 },
169 gridLineColor : {
170 type : "string"
171 },
172 gridLineWidth : {
173 type : "int"
174 },
175 height : {
176 type : "int"
177 },
178 hideOverlayOnMouseOut : {
179 type : "boolean"
180 },
181 highlightCallback : {
182 type : "function(event, x, points,row)"
183 },
184 highlightCircleSize : {
185 type : "int",
186 scope : [ "global", "series", "y", "y2" ]
187 },
188 includeZero : {
189 type : "boolean"
190 },
191 isZoomedIgnoreProgrammaticZoom : {
192 type : "boolean"
193 },
194 labelsDivWidth : {
195 type : "integer"
196 },
197 labels : {
198 type : "array<string>"
199 },
200 labelsKMB : {
201 type : "boolean"
202 },
203 labelsKMG2 : {
204 type : "boolean"
205 },
206 labelsSeparateLines : {
207 type : "boolean"
208 },
209 labelsShowZeroValues : {
210 type : "boolean"
211 },
212 legend : {
213 type : "string"
214 },
215 logscale : {
216 type : "boolean"
217 },
218 maxNumberWidth : {
219 type : "int"
220 },
221 panEdgeFraction : {
222 type : "float"
223 },
224 pixelsPerLabel : {
225 type : "int"
226 },
227 pixelsPerXLabel : {
228 type : "int"
229 },
230 pixelsPerYLabel : {
231 type : "int"
232 },
233 pointClickCallback : {
234 type : "function(e, point)"
235 },
236 pointSize : {
237 type : "integer",
238 scope : [ "global", "series", "y", "y2" ]
239 },
240 rangeSelectorHeight : {
241 type : "int"
242 },
243 rangeSelectorPlotFillColor : {
244 type : "int"
245 },
246 rangeSelectorPlotStrokeColor : {
247 type : "int"
248 },
249 rightGap : {
250 type : "boolean"
251 },
252 rollPeriod : {
253 type : "int"
254 },
255 showLabelsOnHighlight : {
256 type : "boolean"
257 },
258 showRangeSelector : {
259 type : "boolean"
260 },
261 showRoller : {
262 type : "boolean"
263 },
264 sigFigs : {
265 type : "int"
266 },
267 sigma : {
268 type : "float"
269 },
270 stackedGraph : {
271 type : "boolean"
272 },
273 stepPlot : {
274 type : "boolean"
275 },
276 strokeBorderColor : {
277 type : "string",
278 scope : [ "global", "series", "y", "y2" ]
279 },
280 strokeBorderWidth : {
281 type : "float",
282 scope : [ "global", "series", "y", "y2" ]
283 },
284 strokePattern : {
285 type : "array<int>",
286 scope : [ "global", "series", "y", "y2" ]
287 },
288 strokeWidth : {
289 type : "float",
290 scope : [ "global", "series", "y", "y2" ]
291 },
292 timingName : {
293 type : "string"
294 },
295 title : {
296 type : "string"
297 },
298 titleHeight : {
299 type : "integer"
300 },
301 underlayCallback : {
302 type : "function(canvas, area, dygraph)"
303 },
304 unhighlightCallback : {
305 type : "function(event)"
306 },
307 valueRange : {
308 type : "array<float>"
309 },
310 visibility : {
311 type : "array<boolean>"
312 },
313 width : {
314 type : "int"
315 },
316 wilsonInterval : {
317 type : "boolean"
318 },
319 xAxisHeight : {
320 type : "int"
321 },
322 xAxisLabelWidth : {
323 type : "int"
324 },
325 xLabelHeight : {
326 type : "int"
327 },
328 xlabel : {
329 type : "string"
330 },
331 xValueParser : {
332 type : "function(str)"
333 },
334 yAxisLabelWidth : {
335 type : "int"
336 },
337 yLabelWidth : {
338 type : "int"
339 },
340 ylabel : {
341 type : "string"
342 },
343 zoomCallback : {
344 type : "function(minDate, maxDate, yRanges)"
345 }
346 };
347