<commit_before>import vcharts from '../../../vcharts';
import spec from './spec.json';

export default class Bar {
  static get options () {
    return [
      {name: 'data', type: 'table'},
      {name: 'x', type: 'string'},
      {name: 'y', type: 'string'},
      {name: 'color', type: 'string'},
      {name: 'hover', type: 'string'}
    ];
  }

  constructor (el, options) {
    this.chart = vcharts.chart(spec, {
      el: el,
      values: options.data,
      x: options.x,
      y: options.y,
      fill: options.color,
      hover: options.hover,
      xAxis: {
        title: options.x
      },
      yAxis: {
        title: options.y
      }
    });
  }

  render () {
    this.chart.update();
  }
}
<commit_msg>Fixup Bar options<commit_after>import vcharts from '../../../vcharts';
import spec from './spec.json';

export default class Bar {
  static get spec () {
    return {
      options: [
        {
          name: 'data',
          type: 'table',
          format: 'objectlist'
        },
        {
          name: 'x',
          type: 'string',
          format: 'text',
          domain: {
            mode: 'field',
            from: 'data',
            fieldTypes: ['string', 'date', 'number', 'integer', 'boolean']
          }
        },
        {
          name: 'y',
          type: 'string',
          format: 'text',
          domain: {
            mode: 'field',
            from: 'data',
            fieldTypes: ['number', 'integer', 'boolean']
          }
        }
      ]
    };
  }

  constructor (el, options) {
    this.chart = vcharts.chart(spec, {
      el: el,
      values: options.data,
      x: options.x,
      y: options.y,
      fill: options.color,
      hover: options.hover,
      xAxis: {
        title: options.x
      },
      yAxis: {
        title: options.y
      }
    });
  }

  render () {
    this.chart.update();
  }
}

{'fraction_non_alphanumeric': 0.16347177848775293, 'fraction_numerical': 0.0, 'mean_word_length': 1.4920424403183024, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3728819', 'n_tokens_mistral': 599, 'n_tokens_neox': 590, 'n_words': 143}