<commit_before>// Add some initial configuration data. Each widget's `metric` or `metrics`
// will contain data once ajax the corresponding ajax request has been made.
var data = {
  url: 'http://go.vumi.org/api/v1/go/metrics/',
  token: 'token<PASSWORD>',
  step: 10000,
  widgets: {
    all: {
    from: '-1d',
    interval: '1h',
    nulls: 'omit',
    title: 'A, B and C today',
    metrics: [{
      title: 'A',
      key: 'stores.store1.a.last',
    }, {
      title: 'B',
      key: 'stores.store1.b.last'
    }, {
      title: 'C',
      key: 'stores.store1.c.last'
    }],
  },
  a: {
    title: 'A (last 30 days)',
    key: 'stores.store1.a.last',
    from: '-30d',
    interval: '1d',
    nulls: 'omit'
  },
  b: {
    title: 'B (last 30 days)',
    key: 'stores.store1.b.last',
    from: '-30d',
    interval: '1d',
    nulls: 'omit'
  },
  c: {
    title: 'C (last 30 days)',
    key: 'stores.store1.c.last',
    from: '-30d',
    interval: '1d',
    nulls: 'omit'
  }
  }
};


// Create the widget components. Widget configuration would be done here.
var last = sapphire.widgets.last();
var lines = sapphire.widgets.lines();


// Update the dashboard on page load, then every `data.step` milliseconds.
update();
setInterval(update, data.step);


// Select each widget element by id, then draw it using the sapphire components
// we created above<commit_msg>Minor fixes for sapphire example's js<commit_after>// Add some initial configuration data. Each widget's `metric` or `metrics`
// will contain data once the corresponding ajax request has been made.
var data = {
  url: 'http://go.vumi.org/api/v1/go/metrics/',
  token: 'token<PASSWORD>',
  step: 10000,
  widgets: {
    a: {
      title: 'A (last 30 days)',
      key: 'stores.store1.a.last',
      from: '-30d',
      interval: '1d',
      nulls: 'omit'
    },
    b: {
      title: 'B (last 30 days)',
      key: 'stores.store1.b.last',
      from: '-30d',
      interval: '1d',
      nulls: 'omit'
    },
    c: {
      title: 'C (last 30 days)',
      key: 'stores.store1.c.last',
      from: '-30d',
      interval: '1d',
      nulls: 'omit'
    },
    all: {
      from: '-1d',
      interval: '1h',
      nulls: 'omit',
      title: 'A, B and C today',
      metrics: [{
        title: 'A',
        key: 'stores.store1.a.last',
      }, {
        title: 'B',
        key: 'stores.store1.b.last'
      }, {
        title: 'C',
        key: 'stores.store1.c.last'
      }],
    }
  }
};


// Create the widget components. Widget configuration would be done here.
var last = sapphire.widgets.last();
var lines = sapphire.widgets.lines();


// Update the dashboard on page load, then every `data.step` milliseconds.
update();
setInterval(update, data.step);


// Select each widget element by id, then draw it using the sapphire components
// we created above
{'fraction_non_alphanumeric': 0.1627250264737028, 'fraction_numerical': 0.020472996823155665, 'mean_word_length': 2.3380447585394584, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5367888', 'n_tokens_mistral': 1050, 'n_tokens_neox': 994, 'n_words': 293}