|
|
@ -60,7 +60,6 @@ nv.render = function render(step) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
nv.render.queue = [];
|
|
|
|
nv.render.queue = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nv.addGraph = function(obj) {
|
|
|
|
nv.addGraph = function(obj) {
|
|
|
|
if (typeof arguments[0] === 'function')
|
|
|
|
if (typeof arguments[0] === 'function')
|
|
|
|
obj = {generate: arguments[0], callback: arguments[1]};
|
|
|
|
obj = {generate: arguments[0], callback: arguments[1]};
|
|
|
@ -70,17 +69,13 @@ nv.addGraph = function(obj) {
|
|
|
|
if (!nv.render.active) nv.render();
|
|
|
|
if (!nv.render.active) nv.render();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nv.identity = function(d) { return d };
|
|
|
|
nv.identity = function(d) { return d };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nv.strip = function(s) { return s.replace(/(\s|&)/g,''); };
|
|
|
|
nv.strip = function(s) {
|
|
|
|
|
|
|
|
return s.replace(/(\s|&)/g,'');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function daysInMonth(month,year) {
|
|
|
|
function daysInMonth(month,year) {
|
|
|
|
return (new Date(year, month+1, 0)).getDate();
|
|
|
|
return (new Date(year, month+1, 0)).getDate();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function d3_time_range(floor, step, number) {
|
|
|
|
function d3_time_range(floor, step, number) {
|
|
|
|
return function(t0, t1, dt) {
|
|
|
|
return function(t0, t1, dt) {
|
|
|
@ -97,19 +92,16 @@ function d3_time_range(floor, step, number) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return times;
|
|
|
|
return times;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
d3.time.monthEnd = function(date) {
|
|
|
|
d3.time.monthEnd = function(date) {
|
|
|
|
return new Date(date.getFullYear(), date.getMonth(), 0);
|
|
|
|
return new Date(date.getFullYear(), date.getMonth(), 0);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
d3.time.monthEnds = d3_time_range(d3.time.monthEnd, function(date) {
|
|
|
|
d3.time.monthEnds = d3_time_range(d3.time.monthEnd, function(date) {
|
|
|
|
date.setUTCDate(date.getUTCDate() + 1);
|
|
|
|
date.setUTCDate(date.getUTCDate() + 1);
|
|
|
|
date.setDate(daysInMonth(date.getMonth() + 1, date.getFullYear()));
|
|
|
|
date.setDate(daysInMonth(date.getMonth() + 1, date.getFullYear()));
|
|
|
|
}, function(date) {
|
|
|
|
}, function(date) {
|
|
|
|
return date.getMonth();
|
|
|
|
return date.getMonth();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|