<commit_before>$(document).ready ->
  ctx = $("#weeks-performance-graph").get(0).getContext('2d')
  viewData = []
  submitData = []

  requestEventSummary()

  $(document).on 'event-summary-updated', (event) ->
    if event.eventSummary.name == "tab-view"
      viewData = event.eventSummary.data
    else if event.eventSummary.name == "tab-submit"
      submitData = event.eventSummary.data

    maxOfViews = Math.max.apply(null, viewData.y)
    maxOfSubmits = Math.max.apply(null, submitData.y)
    minimumMaxValue = 50
    maxValue = Math.max(maxOfViews, maxOfSubmits, minimumMaxValue)
    maxValueRemainder = maxValue % 10
    maxValueAdd = if maxValueRemainder > 0
      10 - maxValueRemainder
    else
      0
    ceilingValue = maxValue + maxValueAdd
    stepWidth = ceilingValue / 10

    options = {
      animation: false,
      scaleOverride: true,
      scaleSteps: 10,
      scaleStepWidth: stepWidth,
      scaleStartValue: 0
    }

    labels = $.map(viewData, (elem) -> elem.name)
    viewDataset = $.map(viewData, (elem) -> elem.y)
    submitDataset = $.map(submitData, (elem) -> elem.y)

    chartData = {
        labels: labels,
        datasets: [
            {
                data: viewDataset,
                fillColor: "rgba(0, 0, 0, 0)",
                strokeColor: "#3f3f3e",
                pointColor: "#3f3f3e"
            },
            {
                data: submitDataset,
                fillColor: "rgba(0, 0, 0, 0)",
                strokeColor: "#1d93d6",<commit_msg>Fix our math for calculating the y-axis.<commit_after>$(document).ready ->
  ctx = $("#weeks-performance-graph").get(0).getContext('2d')
  viewData = []
  submitData = []

  requestEventSummary()

  $(document).on 'event-summary-updated', (event) ->
    if event.eventSummary.name == "tab-view"
      viewData = event.eventSummary.data
    else if event.eventSummary.name == "tab-submit"
      submitData = event.eventSummary.data

    labels = $.map(viewData, (elem) -> elem.name)
    viewDataset = $.map(viewData, (elem) -> elem.y)
    submitDataset = $.map(submitData, (elem) -> elem.y)

    maxOfViews = Math.max.apply(null, viewDataset)
    maxOfSubmits = Math.max.apply(null, submitDataset)
    minimumMaxValue = 50
    maxValue = Math.max(maxOfViews, maxOfSubmits, minimumMaxValue)
    maxValueRemainder = maxValue % 10
    maxValueAdd = if maxValueRemainder > 0
      10 - maxValueRemainder
    else
      0
    ceilingValue = maxValue + maxValueAdd
    stepWidth = ceilingValue / 10

    options = {
      animation: false,
      scaleOverride: true,
      scaleSteps: 10,
      scaleStepWidth: stepWidth,
      scaleStartValue: 0
    }

    chartData = {
        labels: labels,
        datasets: [
            {
                data: viewDataset,
                fillColor: "rgba(0, 0, 0, 0)",
                strokeColor: "#3f3f3e",
                pointColor: "#3f3f3e"
            },
            {
                data: submitDataset,
                fillColor: "rgba(0, 0, 0, 0)",
                strokeColor: "#1d93d6",
{'fraction_non_alphanumeric': 0.12364353830976653, 'fraction_numerical': 0.021703387043735613, 'mean_word_length': 2.1853403141361256, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '982224', 'n_tokens_mistral': 1002, 'n_tokens_neox': 946, 'n_words': 197}