Code coverage report for src/compile/subfacet.js

Statements: 100% (12 / 12)      Branches: 66.67% (4 / 6)      Functions: 100% (1 / 1)      Lines: 100% (12 / 12)      Ignored: none     

All files » src/compile/ » subfacet.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    1   1   1   1 2     2 2 2     2 2   2 2      
'use strict';
 
require('../globals');
 
var groupdef = require('./group').def;
 
module.exports = subfaceting;
 
function subfaceting(group, mdef, details, stack, encoding) {
  var m = group.marks,
    g = groupdef('subfacet', {marks: m});
 
  group.marks = [g];
  g.from = mdef.from;
  delete mdef.from;
 
  //TODO test LOD -- we should support stack / line without color (LOD) field
  var trans = (g.from.transform || (g.from.transform = []));
  trans.unshift({type: 'facet', keys: details});
 
  Eif (stack && encoding.has(COLOR)) {
    trans.unshift({type: 'sort', by: encoding.field(COLOR)});
  }
}