all files / src/components/ ScatterMatrix.js

84.85% Statements 28/33
100% Branches 14/14
66.67% Functions 6/9
50% Lines 3/6
4 statements, 1 function, 6 branches Ignored     
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                                              
import vcharts from '../external/vcharts/src';
 
export default class ScatterMatrix {
  static get options () {
    return [
      {name: 'data', type: 'table'},
      {name: 'fields', type: 'string_list'},
      {name: 'color', type: 'string'}
    ];
  }
 
  constructor (el, options) {
    let chart = vcharts.chart('xymatrix', {
      el: el,
      values: options.data,
      fields: options.fields,
      color: {
        field: options.color
      }
    });
    window.onresize = () => chart.update();
  }
}