Allowing to define a default format string per-metric (#750)

This commit is contained in:
Maxime Beauchemin
2016-07-13 23:45:05 -04:00
committed by GitHub
parent 8312f1c2aa
commit f034f2701e
7 changed files with 63 additions and 6 deletions

View File

@@ -2,6 +2,7 @@ var $ = require('jquery');
var jQuery = $;
var d3 = require('d3');
var Mustache = require('mustache');
var utils = require('./utils');
// vis sources
var sourceMap = {
@@ -240,6 +241,12 @@ var px = (function () {
endpoint += "&force=" + this.force;
return endpoint;
},
d3format: function (col, number) {
// uses the utils memoized d3format function and formats based on
// column level defined preferences
var format = this.data.column_formats[col];
return utils.d3format(format, number);
},
done: function (data) {
clearInterval(timer);
token.find("img.loading").hide();