<commit_before>(function (window, document) { // eslint-disable-line no-unused-vars
  'use strict';

  var lima = window.lima;
  var _ = lima._;

  /* simple formulas
   *
   *
   *    ####  # #    # #####  #      ######    ######  ####  #####  #    # #    # #        ##    ####
   *   #      # ##  ## #    # #      #         #      #    # #    # ##  ## #    # #       #  #  #
   *    ####  # # ## # #    # #      #####     #####  #    # #    # # ## # #    # #      #    #  ####
   *        # # #    # #####  #      #         #      #    # #####  #    # #    # #      ######      #
   *   #    # # #    # #      #      #         #      #    # #   #  #    # #    # #      #    # #    #
   *    ####  # #    # #      ###### ######    #       ####  #    # #    #  ####  ###### #    #  ####
   *
   *
   */

  lima.listFormulas = function listFormulas() {
    // at some point, the server api might want to host a list of formulas with their definitions
    return [
      {
        id: 'logOddsRatio',
        label: 'Log Odds Ratio',
        func: logOddsRatio,
        parameters: [ 'group 1 (e.g. experimental)', 'group 2 (e.g. control)' ]
      },
      {
        id: 'weight',
        label: 'Weight',
        func: weight,
        parameters: [ 'group 1 outcome', 'group 1 N', 'group 2 outcome', 'group 2 N' ]
      },
      {
        id: 'lowerConfidenceLimit',
        label: 'Lower Confidence Limit',
        func: lowerConfidenceLimit,
        parameters: [ 'group 1 outcome', 'group 1 N', 'group 2 outcome', 'group 2 N' ]
      },
      {
        id: 'upperConfidenceLimit',
        label: 'Upper Confidence Limit',
        func: upperConfidenceLimit,
        parameters: [ 'group 1 outcome', 'group 1 N', 'group 2 outcome', 'group 2 N' ]
      },
      {
        id: 'logOddsRatioPercent',
        label: 'Log Odds Ratio (percentages)',
        func: logOddsRatioPercent,
        parameters: [ 'group 1 (e.g. experimental %)', 'group 2 (e.g. control %)' ]
      },
      {
        id: 'weightPercent',
        label: 'Weight (percentages)',
        func: weightPercent,
        parameters: [ 'group 1 outcome (%)', 'group 1 N', 'group 2 outcome (%)', 'group 2 N' ]
      },
      {
        id: 'lowerConfidenceLimitPercent',
        label: 'Lower Confidence Limit (percentages)',
        func: lowerConfidenceLimitPercent,
        parameters: [ 'group 1 outcome (%)', 'group 1 N', 'group 2 outcome (%)', 'group 2 N' ]
      },
      {
        id: 'upperConfidenceLimitPercent',
        label: 'Upper Confidence Limit (percentages)',
        func: upperConfidenceLimitPercent,
        parameters: [ 'group 1 outcome (%)', 'group 1 N', 'group 2 outcome (%)', 'group 2 N' ]
      },
      {
        id: 'logOddsRatioNumber',
        label: 'Log Odds Ratio (numbers affected)',
        func: logOddsRatioNumber,
        parameters: [ 'group 1 (e.g. experimental affected)', 'group 1 N', 'group 2 (e.g. control affected)', 'group 2 N' ]
      },
      {
        id: 'weightNumber',
        label: 'Weight (numbers affected)',
        func: weightNumber,
        parameters: [ 'group 1 outcome (affected)', 'group 1 N', 'group 2 outcome (affected)', 'group 2 N' ]
      },
      {
        id: 'lowerConfidenceLimitNumber',
        label: 'Lower Confidence Limit (numbers affected)',
        func: lowerConfidenceLimitNumber,
        parameters: [ 'group 1 outcome (affected)', 'group 1 N', 'group 2 outcome (affected)', 'group 2 N' ]
      },
      {
        id: 'upperConfidenceLimitNumber',
        label: 'Upper Confidence Limit (numbers affected)',
        func: upperConfidenceLimitNumber,
        parameters: [ 'group 1 outcome (affected)', 'group 1 N', 'group 2 outcome (affected)', 'group 2 N' ]
      },
    ];
  }

  lima.getFormulaById = function getFormulaById(id) {
    var formulas = lima.listFormulas();
    for (var i=0; i<formulas.length; i++) {
      if (formulas[i].id === id) return formulas[i];
    }
    return null;
  }

  lima.getFormulaOrAggregateLabelById = function getFormulaOrAggregateLabelById(id) {
    var formula = lima.getFormulaById(id) || lima.getAggregateFormulaById(id);
    return (formula ? formula.label : 'no formula selected');
  }<commit_msg>plotting: clarify function names<commit_after>(function (window, document) { // eslint-disable-line no-unused-vars
  'use strict';

  var lima = window.lima;
  var _ = lima._;

  /* simple formulas
   *
   *
   *    ####  # #    # #####  #      ######    ######  ####  #####  #    # #    # #        ##    ####
   *   #      # ##  ## #    # #      #         #      #    # #    # ##  ## #    # #       #  #  #
   *    ####  # # ## # #    # #      #####     #####  #    # #    # # ## # #    # #      #    #  ####
   *        # # #    # #####  #      #         #      #    # #####  #    # #    # #      ######      #
   *   #    # # #    # #      #      #         #      #    # #   #  #    # #    # #      #    # #    #
   *    ####  # #    # #      ###### ######    #       ####  #    # #    #  ####  ###### #    #  ####
   *
   *
   */

  lima.listFormulas = function listFormulas() {
    // at some point, the server api might want to host a list of formulas with their definitions
    return [
      {
        id: 'logOddsRatio',
        label: 'Log Odds Ratio',
        func: logOddsRatio,
        parameters: [ 'group 1 (e.g. experimental)', 'group 2 (e.g. control)' ]
      },
      {
        id: 'weight',
        label: 'Weight',
        func: weight,
        parameters: [ 'group 1 outcome', 'group 1 N', 'group 2 outcome', 'group 2 N' ]
      },
      {
        id: 'lowerConfidenceLimit',
        label: 'Lower Log Confidence Limit',
        func: lowerConfidenceLimit,
        parameters: [ 'group 1 outcome', 'group 1 N', 'group 2 outcome', 'group 2 N' ]
      },
      {
        id: 'upperConfidenceLimit',
        label: 'Upper Log Confidence Limit',
        func: upperConfidenceLimit,
        parameters: [ 'group 1 outcome', 'group 1 N', 'group 2 outcome', 'group 2 N' ]
      },
      {
        id: 'logOddsRatioPercent',
        label: 'Log Odds Ratio (percentages)',
        func: logOddsRatioPercent,
        parameters: [ 'group 1 (e.g. experimental %)', 'group 2 (e.g. control %)' ]
      },
      {
        id: 'weightPercent',
        label: 'Weight (percentages)',
        func: weightPercent,
        parameters: [ 'group 1 outcome (%)', 'group 1 N', 'group 2 outcome (%)', 'group 2 N' ]
      },
      {
        id: 'lowerConfidenceLimitPercent',
        label: 'Lower Log Confidence Limit (percentages)',
        func: lowerConfidenceLimitPercent,
        parameters: [ 'group 1 outcome (%)', 'group 1 N', 'group 2 outcome (%)', 'group 2 N' ]
      },
      {
        id: 'upperConfidenceLimitPercent',
        label: 'Upper Log Confidence Limit (percentages)',
        func: upperConfidenceLimitPercent,
        parameters: [ 'group 1 outcome (%)', 'group 1 N', 'group 2 outcome (%)', 'group 2 N' ]
      },
      {
        id: 'logOddsRatioNumber',
        label: 'Log Odds Ratio (numbers affected)',
        func: logOddsRatioNumber,
        parameters: [ 'group 1 (e.g. experimental affected)', 'group 1 N', 'group 2 (e.g. control affected)', 'group 2 N' ]
      },
      {
        id: 'weightNumber',
        label: 'Weight (numbers affected)',
        func: weightNumber,
        parameters: [ 'group 1 outcome (affected)', 'group 1 N', 'group 2 outcome (affected)', 'group 2 N' ]
      },
      {
        id: 'lowerConfidenceLimitNumber',
        label: 'Lower Log Confidence Limit (numbers affected)',
        func: lowerConfidenceLimitNumber,
        parameters: [ 'group 1 outcome (affected)', 'group 1 N', 'group 2 outcome (affected)', 'group 2 N' ]
      },
      {
        id: 'upperConfidenceLimitNumber',
        label: 'Upper Log Confidence Limit (numbers affected)',
        func: upperConfidenceLimitNumber,
        parameters: [ 'group 1 outcome (affected)', 'group 1 N', 'group 2 outcome (affected)', 'group 2 N' ]
      },
    ];
  }

  lima.getFormulaById = function getFormulaById(id) {
    var formulas = lima.listFormulas();
    for (var i=0; i<formulas.length; i++) {
      if (formulas[i].id === id) return formulas[i];
    }
    return null;
  }

  lima.getFormulaOrAggregateLabelById = function getFormulaOrAggregateLabelById(id) {
    var formula = lima.getFormulaById(id) || lima.getAggregateFormulaById(id);
    return (formula ? formula.label : 'no formula selected');
  }
{'fraction_non_alphanumeric': 0.16589478684241776, 'fraction_numerical': 0.010687566797292483, 'mean_word_length': 1.8901853122855181, 'pattern_counts': {'":': 0, '<': 5, '<?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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1646640', 'n_tokens_mistral': 2729, 'n_tokens_neox': 2554, 'n_words': 661}