<commit_before>'use strict';

var fs = require('fs');
var template = fs.readFileSync(__dirname + '/dashboard.html', 'utf8');
var series = require('camunda-commons-ui/node_modules/camunda-bpm-sdk-js').utils.series;

function prioritySort(a, b) {
  return a.priority > b.priority ? 1 : (a.priority < b.priority ? -1 : 0);
}

function valuesSort(a, b) {
  return a.value > b.value ? 1 : (a.value < b.value ? -1 : 0);
}

function replaceAll(str, obj) {
  Object.keys(obj).forEach(function(searched) {
    var replaced = obj[searched];
    str = str.split('{{' + searched + '}}').join(replaced);
  });
  return str;
}

function color(i, t) {
  return 'hsl(' + ((360 / t) * i) + ', 70%, 41%)';
}

function valuesTreshold(l, t) {
  return l > 12 ? (Math.floor(t / l) * 0.5) : 0;
}<commit_msg>improve(cockpit-dashboard): start with blue in donut charts<commit_after>'use strict';

var fs = require('fs');
var template = fs.readFileSync(__dirname + '/dashboard.html', 'utf8');
var series = require('camunda-commons-ui/node_modules/camunda-bpm-sdk-js').utils.series;

function prioritySort(a, b) {
  return a.priority > b.priority ? 1 : (a.priority < b.priority ? -1 : 0);
}

function valuesSort(a, b) {
  return a.value > b.value ? 1 : (a.value < b.value ? -1 : 0);
}

function replaceAll(str, obj) {
  Object.keys(obj).forEach(function(searched) {
    var replaced = obj[searched];
    str = str.split('{{' + searched + '}}').join(replaced);
  });
  return str;
}

function color(i, t) {
  var hue = (360 / t) * i;
  hue += 230;
  hue = hue > 360 ? hue-360 : hue;
  return 'hsl(' + hue + ', 70%, 41%)';
}

function valuesTreshold(l, t) {
  return l > 12 ? (Math.floor(t / l) * 0.5) : 0;
}
{'fraction_non_alphanumeric': 0.19583333333333333, 'fraction_numerical': 0.027976190476190477, 'mean_word_length': 3.6054794520547944, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, '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': '2136937', 'n_tokens_mistral': 677, 'n_tokens_neox': 633, 'n_words': 152}