assertEquals('number', typeof(granularity));
assertEquals('function', typeof(opts));
assertEquals('[Dygraph graph]', dg.toString());
- return 'x' + x.strftime('%Y/%m/%d');
+ return 'x' + Dygraph.dateString_(x);
},
yAxisLabelFormatter: function(y, granularity, opts, dg) {
assertEquals('number', typeof(y));
assertEquals('function', typeof(opts));
assertEquals('string', typeof(series_name));
assertEquals('[Dygraph graph]', dg.toString());
- return 'x' + new Date(x).strftime('%Y/%m/%d');
+ return 'x' + Dygraph.dateString_(new Date(x));
},
yValueFormatter: function(y, opts, series_name, dg) {
assertEquals('number', typeof(y));
assertEquals('number', typeof(granularity));
assertEquals('function', typeof(opts));
assertEquals('[Dygraph graph]', dg.toString());
- return 'x' + x.strftime('%Y/%m/%d');
+ return 'x' + Dygraph.dateString_(x);
}
},
y : {
assertEquals('function', typeof(opts));
assertEquals('string', typeof(series_name));
assertEquals('[Dygraph graph]', dg.toString());
- return 'x' + new Date(x).strftime('%Y/%m/%d');
+ return 'x' + Dygraph.dateString_(new Date(x));
}
},
y : {
- (2645) Simplify or eliminate dygraph-interaction-model.js.
- (1983) Remove stacktrace.js from dygraph-combined.js
- (????) Switch to Closure Compiler, which is more aggressive about dead code removal.
+- (????) Unify Dygraph.prototype.log vs. Dygraph.log
+- (????) Combined findPos{X,Y}, page{X,Y}
+- (????) merge update, updateDeep, clone
+- (????) can we kill the iterator stuff?
+- (????) move kberg's polygon stuff into a plugin
+- (????) unify/simplify date processing code (dateString_, hmsString_, ...)
+
+To measure size:
+$ ./generate-combined.sh cat_minified | wc -c
+
+To test correctness:
+$ make test-combined
+
+ 135782 Initial
+ 130557 removed stacktrace.js
+ 130142 removed stacktrace logic from combined
+ 129932 remove unused Dygraph.compareArrays_
+ 125996 remove strftime-min.js
+
+
+TODO:
+- remove all references to strftime-min.js
};
/**
+ * @type {!Array.<string>}
+ * @private
+ */
+Dygraph.shortMonthNames_ = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
+
+/**
* Convert a JS date to a string appropriate to display on an axis that
* is displaying values at the stated granularity.
* @param {Date} date The date to format
*/
Dygraph.dateAxisFormatter = function(date, granularity) {
if (granularity >= Dygraph.DECADAL) {
- return date.strftime('%Y');
+ // e.g. '2013' (%Y)
+ return '' + date.getFullYear();
} else if (granularity >= Dygraph.MONTHLY) {
- return date.strftime('%b %y');
+ // e.g. 'Jan 13' (%b %y)
+ return Dygraph.shortMonthNames_[date.getMonth()] + ' ' + date.getFullYear();
} else {
var frac = date.getHours() * 3600 + date.getMinutes() * 60 + date.getSeconds() + date.getMilliseconds();
if (frac === 0 || granularity >= Dygraph.DAILY) {
- return new Date(date.getTime() + 3600*1000).strftime('%d%b');
+ // e.g. '21Jan' (%d%b)
+ var nd = new Date(date.getTime() + 3600*1000);
+ return Dygraph.zeropad(nd.getDate()) + Dygraph.shortMonthNames_[nd.getMonth()];
} else {
return Dygraph.hmsString_(date.getTime());
}
# This list needs to be kept in sync w/ the one in dygraph-dev.js
# and the one in jsTestDriver.conf. Order matters, except for the plugins.
for F in \
- strftime/strftime-min.js \
rgbcolor/rgbcolor.js \
dashed-canvas.js \
dygraph-options.js \