Code coverage report for src/data.js

Statements: 100% (9 / 9)      Branches: 100% (0 / 0)      Functions: 100% (2 / 2)      Lines: 100% (9 / 9)      Ignored: none     

All files » src/ » data.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30    1   1   1     1               1 32   32 280 280              
'use strict';
 
require('./globals');
 
var stats = require('datalib/src/stats');
 
var vldata = module.exports = {};
 
/** Mapping from datalib's inferred type to Vega-lite's type */
vldata.types = {
  'boolean': N,
  'number': Q,
  'integer': Q,
  'date': T,
  'string': N
};
 
vldata.stats = function(data) {
  var summary = stats.summary(data);
 
  return summary.reduce(function(s, profile) {
    s[profile.field] = profile;
    return s;
  }, {
    '*': {
      max: data.length,
      min: 0
    }
  });
};