[explore] improve bubble viz (#2927)

* [explore] improve bubble viz

* allow for custom axis formatters
* reorg the control panels

* Addressing comments
This commit is contained in:
Maxime Beauchemin
2017-06-19 22:09:09 -07:00
committed by GitHub
parent 591e512327
commit 3e51c61dbf
7 changed files with 116 additions and 67 deletions

View File

@@ -2,7 +2,7 @@ import moment from 'moment';
const d3 = require('d3');
function UTC(dttm) {
export function UTC(dttm) {
return new Date(
dttm.getUTCFullYear(),
dttm.getUTCMonth(),
@@ -67,13 +67,6 @@ export const formatDate = function (dttm) {
// d = new Date(d.getTime() - 1 * 60 * 60 * 1000);
return tickMultiFormat(d);
};
export const timeFormatFactory = function (d3timeFormat) {
const f = d3.time.format(d3timeFormat);
return function (dttm) {
const d = UTC(new Date(dttm));
return f(d);
};
};
export const fDuration = function (t1, t2, f = 'HH:mm:ss.SS') {
const diffSec = t2 - t1;
const duration = moment(new Date(diffSec));