<commit_before>angular
  .module("Poll")
  .controller "ResultController", ["$scope", "$interval", "Pusher", ($scope, $interval, Pusher) ->

      $scope.ctx = $('canvas')[0].getContext("2d")

      $scope.chartData = []
      $scope.chartOptions = {
        responsive: true
      }

      $scope.updateChart = ->
        $.ajax
          url: "/#{$scope.question}/results.json"
          success: (data) ->
            $scope.$apply ->
              if $scope.chartData.length != data.length
                colors = color.randomColors(data.length)
                $scope.chartData = $.extend true, data, colors
              else
                $scope.chartData = $.extend true, $scope.chartData, data

              if $scope.chart?
                for datum, index in data
                  $scope.chart.segments[index].value = datum.value
                $scope.chart.update()
              else<commit_msg>Disable chart tooltips<commit_after>angular
  .module("Poll")
  .controller "ResultController", ["$scope", "$interval", "Pusher", ($scope, $interval, Pusher) ->

      $scope.ctx = $('canvas')[0].getContext("2d")

      $scope.chartData = []
      $scope.chartOptions = {
        responsive: true
        showTooltips: false
      }

      $scope.updateChart = ->
        $.ajax
          url: "/#{$scope.question}/results.json"
          success: (data) ->
            $scope.$apply ->
              if $scope.chartData.length != data.length
                colors = color.randomColors(data.length)
                $scope.chartData = $.extend true, data, colors
              else
                $scope.chartData = $.extend true, $scope.chartData, data

              if $scope.chart?
                for datum, index in data
                  $scope.chart.segments[index].value = datum.value
                $scope.chart.update()
              else
{'fraction_non_alphanumeric': 0.13994638069705093, 'fraction_numerical': 0.0021447721179624667, 'mean_word_length': 1.7004341534008682, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4824921', 'n_tokens_mistral': 525, 'n_tokens_neox': 506, 'n_words': 103}