flot-rails 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/lib/flot/rails/version.rb +2 -2
- data/vendor/assets/javascripts/excanvas.js +1428 -1427
- data/vendor/assets/javascripts/excanvas.min.js +1 -1
- data/vendor/assets/javascripts/jquery.colorhelpers.js +179 -179
- data/vendor/assets/javascripts/jquery.colorhelpers.min.js +21 -1
- data/vendor/assets/javascripts/jquery.flot.canvas.js +317 -0
- data/vendor/assets/javascripts/jquery.flot.canvas.min.js +28 -0
- data/vendor/assets/javascripts/jquery.flot.categories.js +190 -0
- data/vendor/assets/javascripts/jquery.flot.categories.min.js +44 -0
- data/vendor/assets/javascripts/jquery.flot.crosshair.js +176 -167
- data/vendor/assets/javascripts/jquery.flot.crosshair.min.js +59 -1
- data/vendor/assets/javascripts/jquery.flot.errorbars.js +353 -0
- data/vendor/assets/javascripts/jquery.flot.errorbars.min.js +63 -0
- data/vendor/assets/javascripts/jquery.flot.fillbetween.js +226 -183
- data/vendor/assets/javascripts/jquery.flot.fillbetween.min.js +30 -1
- data/vendor/assets/javascripts/jquery.flot.image.js +241 -238
- data/vendor/assets/javascripts/jquery.flot.image.min.js +53 -1
- data/vendor/assets/javascripts/jquery.flot.js +2980 -2599
- data/vendor/assets/javascripts/jquery.flot.min.js +26 -4
- data/vendor/assets/javascripts/jquery.flot.navigate.js +345 -336
- data/vendor/assets/javascripts/jquery.flot.navigate.min.js +96 -1
- data/vendor/assets/javascripts/jquery.flot.pie.js +561 -499
- data/vendor/assets/javascripts/jquery.flot.pie.min.js +56 -1
- data/vendor/assets/javascripts/jquery.flot.resize.js +60 -60
- data/vendor/assets/javascripts/jquery.flot.resize.min.js +21 -1
- data/vendor/assets/javascripts/jquery.flot.selection.js +360 -344
- data/vendor/assets/javascripts/jquery.flot.selection.min.js +79 -1
- data/vendor/assets/javascripts/jquery.flot.stack.js +188 -184
- data/vendor/assets/javascripts/jquery.flot.stack.min.js +36 -1
- data/vendor/assets/javascripts/jquery.flot.symbol.js +71 -70
- data/vendor/assets/javascripts/jquery.flot.symbol.min.js +14 -1
- data/vendor/assets/javascripts/jquery.flot.threshold.js +142 -103
- data/vendor/assets/javascripts/jquery.flot.threshold.min.js +43 -1
- data/vendor/assets/javascripts/jquery.flot.time.js +424 -0
- data/vendor/assets/javascripts/jquery.flot.time.min.js +9 -0
- metadata +25 -7
@@ -0,0 +1,424 @@
|
|
1
|
+
/* Pretty handling of time axes.
|
2
|
+
|
3
|
+
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
4
|
+
Licensed under the MIT license.
|
5
|
+
|
6
|
+
Set axis.mode to "time" to enable. See the section "Time series data" in
|
7
|
+
API.txt for details.
|
8
|
+
|
9
|
+
*/
|
10
|
+
|
11
|
+
(function($) {
|
12
|
+
|
13
|
+
var options = {
|
14
|
+
xaxis: {
|
15
|
+
timezone: null, // "browser" for local to the client or timezone for timezone-js
|
16
|
+
timeformat: null, // format string to use
|
17
|
+
twelveHourClock: false, // 12 or 24 time in time mode
|
18
|
+
monthNames: null // list of names of months
|
19
|
+
}
|
20
|
+
};
|
21
|
+
|
22
|
+
// round to nearby lower multiple of base
|
23
|
+
|
24
|
+
function floorInBase(n, base) {
|
25
|
+
return base * Math.floor(n / base);
|
26
|
+
}
|
27
|
+
|
28
|
+
// Returns a string with the date d formatted according to fmt.
|
29
|
+
// A subset of the Open Group's strftime format is supported.
|
30
|
+
|
31
|
+
function formatDate(d, fmt, monthNames, dayNames) {
|
32
|
+
|
33
|
+
if (typeof d.strftime == "function") {
|
34
|
+
return d.strftime(fmt);
|
35
|
+
}
|
36
|
+
|
37
|
+
var leftPad = function(n, pad) {
|
38
|
+
n = "" + n;
|
39
|
+
pad = "" + (pad == null ? "0" : pad);
|
40
|
+
return n.length == 1 ? pad + n : n;
|
41
|
+
};
|
42
|
+
|
43
|
+
var r = [];
|
44
|
+
var escape = false;
|
45
|
+
var hours = d.getHours();
|
46
|
+
var isAM = hours < 12;
|
47
|
+
|
48
|
+
if (monthNames == null) {
|
49
|
+
monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
50
|
+
}
|
51
|
+
|
52
|
+
if (dayNames == null) {
|
53
|
+
dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
54
|
+
}
|
55
|
+
|
56
|
+
var hours12;
|
57
|
+
|
58
|
+
if (hours > 12) {
|
59
|
+
hours12 = hours - 12;
|
60
|
+
} else if (hours == 0) {
|
61
|
+
hours12 = 12;
|
62
|
+
} else {
|
63
|
+
hours12 = hours;
|
64
|
+
}
|
65
|
+
|
66
|
+
for (var i = 0; i < fmt.length; ++i) {
|
67
|
+
|
68
|
+
var c = fmt.charAt(i);
|
69
|
+
|
70
|
+
if (escape) {
|
71
|
+
switch (c) {
|
72
|
+
case 'a': c = "" + dayNames[d.getDay()]; break;
|
73
|
+
case 'b': c = "" + monthNames[d.getMonth()]; break;
|
74
|
+
case 'd': c = leftPad(d.getDate()); break;
|
75
|
+
case 'e': c = leftPad(d.getDate(), " "); break;
|
76
|
+
case 'H': c = leftPad(hours); break;
|
77
|
+
case 'I': c = leftPad(hours12); break;
|
78
|
+
case 'l': c = leftPad(hours12, " "); break;
|
79
|
+
case 'm': c = leftPad(d.getMonth() + 1); break;
|
80
|
+
case 'M': c = leftPad(d.getMinutes()); break;
|
81
|
+
// quarters not in Open Group's strftime specification
|
82
|
+
case 'q':
|
83
|
+
c = "" + (Math.floor(d.getMonth() / 3) + 1); break;
|
84
|
+
case 'S': c = leftPad(d.getSeconds()); break;
|
85
|
+
case 'y': c = leftPad(d.getFullYear() % 100); break;
|
86
|
+
case 'Y': c = "" + d.getFullYear(); break;
|
87
|
+
case 'p': c = (isAM) ? ("" + "am") : ("" + "pm"); break;
|
88
|
+
case 'P': c = (isAM) ? ("" + "AM") : ("" + "PM"); break;
|
89
|
+
case 'w': c = "" + d.getDay(); break;
|
90
|
+
}
|
91
|
+
r.push(c);
|
92
|
+
escape = false;
|
93
|
+
} else {
|
94
|
+
if (c == "%") {
|
95
|
+
escape = true;
|
96
|
+
} else {
|
97
|
+
r.push(c);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
return r.join("");
|
103
|
+
}
|
104
|
+
|
105
|
+
// To have a consistent view of time-based data independent of which time
|
106
|
+
// zone the client happens to be in we need a date-like object independent
|
107
|
+
// of time zones. This is done through a wrapper that only calls the UTC
|
108
|
+
// versions of the accessor methods.
|
109
|
+
|
110
|
+
function makeUtcWrapper(d) {
|
111
|
+
|
112
|
+
function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {
|
113
|
+
sourceObj[sourceMethod] = function() {
|
114
|
+
return targetObj[targetMethod].apply(targetObj, arguments);
|
115
|
+
};
|
116
|
+
};
|
117
|
+
|
118
|
+
var utc = {
|
119
|
+
date: d
|
120
|
+
};
|
121
|
+
|
122
|
+
// support strftime, if found
|
123
|
+
|
124
|
+
if (d.strftime != undefined) {
|
125
|
+
addProxyMethod(utc, "strftime", d, "strftime");
|
126
|
+
}
|
127
|
+
|
128
|
+
addProxyMethod(utc, "getTime", d, "getTime");
|
129
|
+
addProxyMethod(utc, "setTime", d, "setTime");
|
130
|
+
|
131
|
+
var props = ["Date", "Day", "FullYear", "Hours", "Milliseconds", "Minutes", "Month", "Seconds"];
|
132
|
+
|
133
|
+
for (var p = 0; p < props.length; p++) {
|
134
|
+
addProxyMethod(utc, "get" + props[p], d, "getUTC" + props[p]);
|
135
|
+
addProxyMethod(utc, "set" + props[p], d, "setUTC" + props[p]);
|
136
|
+
}
|
137
|
+
|
138
|
+
return utc;
|
139
|
+
};
|
140
|
+
|
141
|
+
// select time zone strategy. This returns a date-like object tied to the
|
142
|
+
// desired timezone
|
143
|
+
|
144
|
+
function dateGenerator(ts, opts) {
|
145
|
+
if (opts.timezone == "browser") {
|
146
|
+
return new Date(ts);
|
147
|
+
} else if (!opts.timezone || opts.timezone == "utc") {
|
148
|
+
return makeUtcWrapper(new Date(ts));
|
149
|
+
} else if (typeof timezoneJS != "undefined" && typeof timezoneJS.Date != "undefined") {
|
150
|
+
var d = new timezoneJS.Date();
|
151
|
+
// timezone-js is fickle, so be sure to set the time zone before
|
152
|
+
// setting the time.
|
153
|
+
d.setTimezone(opts.timezone);
|
154
|
+
d.setTime(ts);
|
155
|
+
return d;
|
156
|
+
} else {
|
157
|
+
return makeUtcWrapper(new Date(ts));
|
158
|
+
}
|
159
|
+
}
|
160
|
+
|
161
|
+
// map of app. size of time units in milliseconds
|
162
|
+
|
163
|
+
var timeUnitSize = {
|
164
|
+
"second": 1000,
|
165
|
+
"minute": 60 * 1000,
|
166
|
+
"hour": 60 * 60 * 1000,
|
167
|
+
"day": 24 * 60 * 60 * 1000,
|
168
|
+
"month": 30 * 24 * 60 * 60 * 1000,
|
169
|
+
"quarter": 3 * 30 * 24 * 60 * 60 * 1000,
|
170
|
+
"year": 365.2425 * 24 * 60 * 60 * 1000
|
171
|
+
};
|
172
|
+
|
173
|
+
// the allowed tick sizes, after 1 year we use
|
174
|
+
// an integer algorithm
|
175
|
+
|
176
|
+
var baseSpec = [
|
177
|
+
[1, "second"], [2, "second"], [5, "second"], [10, "second"],
|
178
|
+
[30, "second"],
|
179
|
+
[1, "minute"], [2, "minute"], [5, "minute"], [10, "minute"],
|
180
|
+
[30, "minute"],
|
181
|
+
[1, "hour"], [2, "hour"], [4, "hour"],
|
182
|
+
[8, "hour"], [12, "hour"],
|
183
|
+
[1, "day"], [2, "day"], [3, "day"],
|
184
|
+
[0.25, "month"], [0.5, "month"], [1, "month"],
|
185
|
+
[2, "month"]
|
186
|
+
];
|
187
|
+
|
188
|
+
// we don't know which variant(s) we'll need yet, but generating both is
|
189
|
+
// cheap
|
190
|
+
|
191
|
+
var specMonths = baseSpec.concat([[3, "month"], [6, "month"],
|
192
|
+
[1, "year"]]);
|
193
|
+
var specQuarters = baseSpec.concat([[1, "quarter"], [2, "quarter"],
|
194
|
+
[1, "year"]]);
|
195
|
+
|
196
|
+
function init(plot) {
|
197
|
+
plot.hooks.processDatapoints.push(function (plot, series, datapoints) {
|
198
|
+
$.each(plot.getAxes(), function(axisName, axis) {
|
199
|
+
|
200
|
+
var opts = axis.options;
|
201
|
+
|
202
|
+
if (opts.mode == "time") {
|
203
|
+
axis.tickGenerator = function(axis) {
|
204
|
+
|
205
|
+
var ticks = [];
|
206
|
+
var d = dateGenerator(axis.min, opts);
|
207
|
+
var minSize = 0;
|
208
|
+
|
209
|
+
// make quarter use a possibility if quarters are
|
210
|
+
// mentioned in either of these options
|
211
|
+
|
212
|
+
var spec = (opts.tickSize && opts.tickSize[1] ===
|
213
|
+
"quarter") ||
|
214
|
+
(opts.minTickSize && opts.minTickSize[1] ===
|
215
|
+
"quarter") ? specQuarters : specMonths;
|
216
|
+
|
217
|
+
if (opts.minTickSize != null) {
|
218
|
+
if (typeof opts.tickSize == "number") {
|
219
|
+
minSize = opts.tickSize;
|
220
|
+
} else {
|
221
|
+
minSize = opts.minTickSize[0] * timeUnitSize[opts.minTickSize[1]];
|
222
|
+
}
|
223
|
+
}
|
224
|
+
|
225
|
+
for (var i = 0; i < spec.length - 1; ++i) {
|
226
|
+
if (axis.delta < (spec[i][0] * timeUnitSize[spec[i][1]]
|
227
|
+
+ spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2
|
228
|
+
&& spec[i][0] * timeUnitSize[spec[i][1]] >= minSize) {
|
229
|
+
break;
|
230
|
+
}
|
231
|
+
}
|
232
|
+
|
233
|
+
var size = spec[i][0];
|
234
|
+
var unit = spec[i][1];
|
235
|
+
|
236
|
+
// special-case the possibility of several years
|
237
|
+
|
238
|
+
if (unit == "year") {
|
239
|
+
|
240
|
+
// if given a minTickSize in years, just use it,
|
241
|
+
// ensuring that it's an integer
|
242
|
+
|
243
|
+
if (opts.minTickSize != null && opts.minTickSize[1] == "year") {
|
244
|
+
size = Math.floor(opts.minTickSize[0]);
|
245
|
+
} else {
|
246
|
+
|
247
|
+
var magn = Math.pow(10, Math.floor(Math.log(axis.delta / timeUnitSize.year) / Math.LN10));
|
248
|
+
var norm = (axis.delta / timeUnitSize.year) / magn;
|
249
|
+
|
250
|
+
if (norm < 1.5) {
|
251
|
+
size = 1;
|
252
|
+
} else if (norm < 3) {
|
253
|
+
size = 2;
|
254
|
+
} else if (norm < 7.5) {
|
255
|
+
size = 5;
|
256
|
+
} else {
|
257
|
+
size = 10;
|
258
|
+
}
|
259
|
+
|
260
|
+
size *= magn;
|
261
|
+
}
|
262
|
+
|
263
|
+
// minimum size for years is 1
|
264
|
+
|
265
|
+
if (size < 1) {
|
266
|
+
size = 1;
|
267
|
+
}
|
268
|
+
}
|
269
|
+
|
270
|
+
axis.tickSize = opts.tickSize || [size, unit];
|
271
|
+
var tickSize = axis.tickSize[0];
|
272
|
+
unit = axis.tickSize[1];
|
273
|
+
|
274
|
+
var step = tickSize * timeUnitSize[unit];
|
275
|
+
|
276
|
+
if (unit == "second") {
|
277
|
+
d.setSeconds(floorInBase(d.getSeconds(), tickSize));
|
278
|
+
} else if (unit == "minute") {
|
279
|
+
d.setMinutes(floorInBase(d.getMinutes(), tickSize));
|
280
|
+
} else if (unit == "hour") {
|
281
|
+
d.setHours(floorInBase(d.getHours(), tickSize));
|
282
|
+
} else if (unit == "month") {
|
283
|
+
d.setMonth(floorInBase(d.getMonth(), tickSize));
|
284
|
+
} else if (unit == "quarter") {
|
285
|
+
d.setMonth(3 * floorInBase(d.getMonth() / 3,
|
286
|
+
tickSize));
|
287
|
+
} else if (unit == "year") {
|
288
|
+
d.setFullYear(floorInBase(d.getFullYear(), tickSize));
|
289
|
+
}
|
290
|
+
|
291
|
+
// reset smaller components
|
292
|
+
|
293
|
+
d.setMilliseconds(0);
|
294
|
+
|
295
|
+
if (step >= timeUnitSize.minute) {
|
296
|
+
d.setSeconds(0);
|
297
|
+
} else if (step >= timeUnitSize.hour) {
|
298
|
+
d.setMinutes(0);
|
299
|
+
} else if (step >= timeUnitSize.day) {
|
300
|
+
d.setHours(0);
|
301
|
+
} else if (step >= timeUnitSize.day * 4) {
|
302
|
+
d.setDate(1);
|
303
|
+
} else if (step >= timeUnitSize.month * 2) {
|
304
|
+
d.setMonth(floorInBase(d.getMonth(), 3));
|
305
|
+
} else if (step >= timeUnitSize.quarter * 2) {
|
306
|
+
d.setMonth(floorInBase(d.getMonth(), 6));
|
307
|
+
} else if (step >= timeUnitSize.year) {
|
308
|
+
d.setMonth(0);
|
309
|
+
}
|
310
|
+
|
311
|
+
var carry = 0;
|
312
|
+
var v = Number.NaN;
|
313
|
+
var prev;
|
314
|
+
|
315
|
+
do {
|
316
|
+
|
317
|
+
prev = v;
|
318
|
+
v = d.getTime();
|
319
|
+
ticks.push(v);
|
320
|
+
|
321
|
+
if (unit == "month" || unit == "quarter") {
|
322
|
+
if (tickSize < 1) {
|
323
|
+
|
324
|
+
// a bit complicated - we'll divide the
|
325
|
+
// month/quarter up but we need to take
|
326
|
+
// care of fractions so we don't end up in
|
327
|
+
// the middle of a day
|
328
|
+
|
329
|
+
d.setDate(1);
|
330
|
+
var start = d.getTime();
|
331
|
+
d.setMonth(d.getMonth() +
|
332
|
+
(unit == "quarter" ? 3 : 1));
|
333
|
+
var end = d.getTime();
|
334
|
+
d.setTime(v + carry * timeUnitSize.hour + (end - start) * tickSize);
|
335
|
+
carry = d.getHours();
|
336
|
+
d.setHours(0);
|
337
|
+
} else {
|
338
|
+
d.setMonth(d.getMonth() +
|
339
|
+
tickSize * (unit == "quarter" ? 3 : 1));
|
340
|
+
}
|
341
|
+
} else if (unit == "year") {
|
342
|
+
d.setFullYear(d.getFullYear() + tickSize);
|
343
|
+
} else {
|
344
|
+
d.setTime(v + step);
|
345
|
+
}
|
346
|
+
} while (v < axis.max && v != prev);
|
347
|
+
|
348
|
+
return ticks;
|
349
|
+
};
|
350
|
+
|
351
|
+
axis.tickFormatter = function (v, axis) {
|
352
|
+
|
353
|
+
var d = dateGenerator(v, axis.options);
|
354
|
+
|
355
|
+
// first check global format
|
356
|
+
|
357
|
+
if (opts.timeformat != null) {
|
358
|
+
return formatDate(d, opts.timeformat, opts.monthNames, opts.dayNames);
|
359
|
+
}
|
360
|
+
|
361
|
+
// possibly use quarters if quarters are mentioned in
|
362
|
+
// any of these places
|
363
|
+
|
364
|
+
var useQuarters = (axis.options.tickSize &&
|
365
|
+
axis.options.tickSize[1] == "quarter") ||
|
366
|
+
(axis.options.minTickSize &&
|
367
|
+
axis.options.minTickSize[1] == "quarter");
|
368
|
+
|
369
|
+
var t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]];
|
370
|
+
var span = axis.max - axis.min;
|
371
|
+
var suffix = (opts.twelveHourClock) ? " %p" : "";
|
372
|
+
var hourCode = (opts.twelveHourClock) ? "%I" : "%H";
|
373
|
+
var fmt;
|
374
|
+
|
375
|
+
if (t < timeUnitSize.minute) {
|
376
|
+
fmt = hourCode + ":%M:%S" + suffix;
|
377
|
+
} else if (t < timeUnitSize.day) {
|
378
|
+
if (span < 2 * timeUnitSize.day) {
|
379
|
+
fmt = hourCode + ":%M" + suffix;
|
380
|
+
} else {
|
381
|
+
fmt = "%b %d " + hourCode + ":%M" + suffix;
|
382
|
+
}
|
383
|
+
} else if (t < timeUnitSize.month) {
|
384
|
+
fmt = "%b %d";
|
385
|
+
} else if ((useQuarters && t < timeUnitSize.quarter) ||
|
386
|
+
(!useQuarters && t < timeUnitSize.year)) {
|
387
|
+
if (span < timeUnitSize.year) {
|
388
|
+
fmt = "%b";
|
389
|
+
} else {
|
390
|
+
fmt = "%b %Y";
|
391
|
+
}
|
392
|
+
} else if (useQuarters && t < timeUnitSize.year) {
|
393
|
+
if (span < timeUnitSize.year) {
|
394
|
+
fmt = "Q%q";
|
395
|
+
} else {
|
396
|
+
fmt = "Q%q %Y";
|
397
|
+
}
|
398
|
+
} else {
|
399
|
+
fmt = "%Y";
|
400
|
+
}
|
401
|
+
|
402
|
+
var rt = formatDate(d, fmt, opts.monthNames, opts.dayNames);
|
403
|
+
|
404
|
+
return rt;
|
405
|
+
};
|
406
|
+
}
|
407
|
+
});
|
408
|
+
});
|
409
|
+
}
|
410
|
+
|
411
|
+
$.plot.plugins.push({
|
412
|
+
init: init,
|
413
|
+
options: options,
|
414
|
+
name: 'time',
|
415
|
+
version: '1.0'
|
416
|
+
});
|
417
|
+
|
418
|
+
// Time-axis support used to be in Flot core, which exposed the
|
419
|
+
// formatDate function on the plot object. Various plugins depend
|
420
|
+
// on the function, so we need to re-expose it here.
|
421
|
+
|
422
|
+
$.plot.formatDate = formatDate;
|
423
|
+
|
424
|
+
})(jQuery);
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/* Pretty handling of time axes.
|
2
|
+
|
3
|
+
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
4
|
+
Licensed under the MIT license.
|
5
|
+
|
6
|
+
Set axis.mode to "time" to enable. See the section "Time series data" in
|
7
|
+
API.txt for details.
|
8
|
+
|
9
|
+
*/(function(e){function n(e,t){return t*Math.floor(e/t)}function r(e,t,n,r){if(typeof e.strftime=="function")return e.strftime(t);var i=function(e,t){return e=""+e,t=""+(t==null?"0":t),e.length==1?t+e:e},s=[],o=!1,u=e.getHours(),a=u<12;n==null&&(n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),r==null&&(r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);var f;u>12?f=u-12:u==0?f=12:f=u;for(var l=0;l<t.length;++l){var c=t.charAt(l);if(o){switch(c){case"a":c=""+r[e.getDay()];break;case"b":c=""+n[e.getMonth()];break;case"d":c=i(e.getDate());break;case"e":c=i(e.getDate()," ");break;case"H":c=i(u);break;case"I":c=i(f);break;case"l":c=i(f," ");break;case"m":c=i(e.getMonth()+1);break;case"M":c=i(e.getMinutes());break;case"q":c=""+(Math.floor(e.getMonth()/3)+1);break;case"S":c=i(e.getSeconds());break;case"y":c=i(e.getFullYear()%100);break;case"Y":c=""+e.getFullYear();break;case"p":c=a?"am":"pm";break;case"P":c=a?"AM":"PM";break;case"w":c=""+e.getDay()}s.push(c),o=!1}else c=="%"?o=!0:s.push(c)}return s.join("")}function i(e){function t(e,t,n,r){e[t]=function(){return n[r].apply(n,arguments)}}var n={date:e};e.strftime!=undefined&&t(n,"strftime",e,"strftime"),t(n,"getTime",e,"getTime"),t(n,"setTime",e,"setTime");var r=["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds"];for(var i=0;i<r.length;i++)t(n,"get"+r[i],e,"getUTC"+r[i]),t(n,"set"+r[i],e,"setUTC"+r[i]);return n}function s(e,t){if(t.timezone=="browser")return new Date(e);if(!t.timezone||t.timezone=="utc")return i(new Date(e));if(typeof timezoneJS!="undefined"&&typeof timezoneJS.Date!="undefined"){var n=new timezoneJS.Date;return n.setTimezone(t.timezone),n.setTime(e),n}return i(new Date(e))}function l(t){t.hooks.processDatapoints.push(function(t,i,u){e.each(t.getAxes(),function(e,t){var i=t.options;i.mode=="time"&&(t.tickGenerator=function(e){var t=[],r=s(e.min,i),u=0,l=i.tickSize&&i.tickSize[1]==="quarter"||i.minTickSize&&i.minTickSize[1]==="quarter"?f:a;i.minTickSize!=null&&(typeof i.tickSize=="number"?u=i.tickSize:u=i.minTickSize[0]*o[i.minTickSize[1]]);for(var c=0;c<l.length-1;++c)if(e.delta<(l[c][0]*o[l[c][1]]+l[c+1][0]*o[l[c+1][1]])/2&&l[c][0]*o[l[c][1]]>=u)break;var h=l[c][0],p=l[c][1];if(p=="year"){if(i.minTickSize!=null&&i.minTickSize[1]=="year")h=Math.floor(i.minTickSize[0]);else{var d=Math.pow(10,Math.floor(Math.log(e.delta/o.year)/Math.LN10)),v=e.delta/o.year/d;v<1.5?h=1:v<3?h=2:v<7.5?h=5:h=10,h*=d}h<1&&(h=1)}e.tickSize=i.tickSize||[h,p];var m=e.tickSize[0];p=e.tickSize[1];var g=m*o[p];p=="second"?r.setSeconds(n(r.getSeconds(),m)):p=="minute"?r.setMinutes(n(r.getMinutes(),m)):p=="hour"?r.setHours(n(r.getHours(),m)):p=="month"?r.setMonth(n(r.getMonth(),m)):p=="quarter"?r.setMonth(3*n(r.getMonth()/3,m)):p=="year"&&r.setFullYear(n(r.getFullYear(),m)),r.setMilliseconds(0),g>=o.minute?r.setSeconds(0):g>=o.hour?r.setMinutes(0):g>=o.day?r.setHours(0):g>=o.day*4?r.setDate(1):g>=o.month*2?r.setMonth(n(r.getMonth(),3)):g>=o.quarter*2?r.setMonth(n(r.getMonth(),6)):g>=o.year&&r.setMonth(0);var y=0,b=Number.NaN,w;do{w=b,b=r.getTime(),t.push(b);if(p=="month"||p=="quarter")if(m<1){r.setDate(1);var E=r.getTime();r.setMonth(r.getMonth()+(p=="quarter"?3:1));var S=r.getTime();r.setTime(b+y*o.hour+(S-E)*m),y=r.getHours(),r.setHours(0)}else r.setMonth(r.getMonth()+m*(p=="quarter"?3:1));else p=="year"?r.setFullYear(r.getFullYear()+m):r.setTime(b+g)}while(b<e.max&&b!=w);return t},t.tickFormatter=function(e,t){var n=s(e,t.options);if(i.timeformat!=null)return r(n,i.timeformat,i.monthNames,i.dayNames);var u=t.options.tickSize&&t.options.tickSize[1]=="quarter"||t.options.minTickSize&&t.options.minTickSize[1]=="quarter",a=t.tickSize[0]*o[t.tickSize[1]],f=t.max-t.min,l=i.twelveHourClock?" %p":"",c=i.twelveHourClock?"%I":"%H",h;a<o.minute?h=c+":%M:%S"+l:a<o.day?f<2*o.day?h=c+":%M"+l:h="%b %d "+c+":%M"+l:a<o.month?h="%b %d":u&&a<o.quarter||!u&&a<o.year?f<o.year?h="%b":h="%b %Y":u&&a<o.year?f<o.year?h="Q%q":h="Q%q %Y":h="%Y";var p=r(n,h,i.monthNames,i.dayNames);return p})})})}var t={xaxis:{timezone:null,timeformat:null,twelveHourClock:!1,monthNames:null}},o={second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,quarter:7776e6,year:525949.2*60*1e3},u=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"]],a=u.concat([[3,"month"],[6,"month"],[1,"year"]]),f=u.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);e.plot.plugins.push({init:l,options:t,name:"time",version:"1.0"}),e.plot.formatDate=r})(jQuery);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flot-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-04-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jquery-rails
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: rails
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ~>
|
@@ -32,7 +37,12 @@ dependencies:
|
|
32
37
|
version: '3.1'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '3.1'
|
36
46
|
description: Provides easy installation and usage of jQuery-flot javascript library
|
37
47
|
for your Rails 3.1+ application.
|
38
48
|
email:
|
@@ -54,8 +64,14 @@ files:
|
|
54
64
|
- vendor/assets/javascripts/excanvas.min.js
|
55
65
|
- vendor/assets/javascripts/jquery.colorhelpers.js
|
56
66
|
- vendor/assets/javascripts/jquery.colorhelpers.min.js
|
67
|
+
- vendor/assets/javascripts/jquery.flot.canvas.js
|
68
|
+
- vendor/assets/javascripts/jquery.flot.canvas.min.js
|
69
|
+
- vendor/assets/javascripts/jquery.flot.categories.js
|
70
|
+
- vendor/assets/javascripts/jquery.flot.categories.min.js
|
57
71
|
- vendor/assets/javascripts/jquery.flot.crosshair.js
|
58
72
|
- vendor/assets/javascripts/jquery.flot.crosshair.min.js
|
73
|
+
- vendor/assets/javascripts/jquery.flot.errorbars.js
|
74
|
+
- vendor/assets/javascripts/jquery.flot.errorbars.min.js
|
59
75
|
- vendor/assets/javascripts/jquery.flot.fillbetween.js
|
60
76
|
- vendor/assets/javascripts/jquery.flot.fillbetween.min.js
|
61
77
|
- vendor/assets/javascripts/jquery.flot.image.js
|
@@ -76,6 +92,8 @@ files:
|
|
76
92
|
- vendor/assets/javascripts/jquery.flot.symbol.min.js
|
77
93
|
- vendor/assets/javascripts/jquery.flot.threshold.js
|
78
94
|
- vendor/assets/javascripts/jquery.flot.threshold.min.js
|
95
|
+
- vendor/assets/javascripts/jquery.flot.time.js
|
96
|
+
- vendor/assets/javascripts/jquery.flot.time.min.js
|
79
97
|
homepage: http://rubygems.org/gems/flot-rails
|
80
98
|
licenses: []
|
81
99
|
post_install_message:
|
@@ -96,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
114
|
version: 1.3.6
|
97
115
|
requirements: []
|
98
116
|
rubyforge_project:
|
99
|
-
rubygems_version: 1.8.
|
117
|
+
rubygems_version: 1.8.24
|
100
118
|
signing_key:
|
101
119
|
specification_version: 3
|
102
120
|
summary: jQuery Flot for Rails Asset pipeline
|