# all files / candela/components/Bullet/ index.js

90.2% Statements 46/51
100% Branches 31/31
72.73% Functions 8/11
54.55% Lines 6/11
8 statements, 2 functions, 13 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
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    471×
    1×
    1×

    1×

    1×

     import VisComponent from '../../VisComponent';
    import vega from '../../util/vega';
    import spec from './spec.json';

    export default class Bullet extends VisComponent {
      static get options () {
        return [
          {
            name: 'value',
            type: 'number',
            format: 'number'
          },
          {
            name: 'title',
            type: 'string',
            format: 'text'
          },
          {
            name: 'subtitle',
            type: 'string',
            format: 'text'
          },
          {
            name: 'markers',
            type: 'number_list',
            format: 'number_list'
          },
          {
            name: 'ranges',
            type: 'table',
            format: 'objectlist'
          }
        ];
      }

      constructor (el, options) {
        super(el);
        this.options = options;
        this.render();
      }

      render () {
        vega.parseChart(spec, this.el, this.options);
      }
    }