<commit_before>/* global d3 */
/* @Author <NAME> */
'use strict';

angular.module('metadatamanagementApp')
  .controller('VariableDetailController', ['$scope', 'entity', 'Language',
    '$translate',

    function($scope, entity, Language, $translate) {
      $scope.variable = entity;

      //options for charts
      $scope.optionsRelative = {
        chart: {
          //CSS information
          type: 'discreteBarChart',
          height: 250,
          showValues: true,
          color: ['#0069B4'],
          valueFormat: function(d) {
            //.2f means two numbers after a commata
            return d3.format(',.2f')(d);
          },

          transitionDuration: 500,

          //Point for data extraction to visualisation
          x: function(d) {

            //if en, return en lables
            if (Language.getCurrentInstantly() === 'en') {
              if (d.label.en) {
                return d.label.en;
                //return the code, if label is not set
              } else {
                return d.code;
              }
            }

            //de is default. return de labels.
            if (d.label.de) {
              return d.label.de;
              //return code, if label is not set
            } else {
              return d.code;
            }
          },

          y: function(d) {
            return d.relativeFrequency;
          },
        },

        // title options
        title: {
          enable: true,
          text: '',
        },
        // subtitle options
        subtitle: {
          enable: true,
          text: '',
          css: {
            'text-align': 'center',
            margin: '10px 13px 0px 7px',
          },
        }
      };

      $scope.optionsAbsolute = {
        chart: {
          //CSS information
          type: 'discreteBarChart',
          height: 250,
          showValues: true,
          color: ['#0069B4'],
          valueFormat: function(d) {
            //.2f means two numbers after a commata
            return d3.format(',.2f')(d);
          },

          transitionDuration: 500,

          //Point for data extraction to visualisation
          x: function(d) {

            //if en, return en lables
            if (Language.getCurrentInstantly() === 'en') {
              if (d.label.en) {
                return d.label.en;
                //return the code, if label is not set
              } else {
                return d.code;
              }
            }

            //de is default. return de labels.
            if (d.label.de) {
              return d.label.de;
              //return code, if label is not set
            } else {
              return d.code;
            }
          },

          y: function(d) {
            return d.absoluteFrequency;
          },
        },

        // title options
        title: {
          enable: true,
          text: '',
        },

        // subtitle options
        subtitle: {
          enable: true,
          text: '',
          css: {
            'text-align': 'center',
            margin: '10px 13px 0px 7px',
          },
        }
      };

      //Wait for promise object
      $scope.variable.$promise.then(function() {
        var statistics = $scope.variable.statistics;

        //The data object is for the display
        $scope.data = [{
          values: $scope.variable.values
        }];

        // Box Plot Chart
        //----------------------------------------------------------------------
        $scope.options = {
          chart: {
            type: 'boxPlotChart',
            height: 550,
            color: ['#0069B4'],
            x: function(d) {
              return d.label;
            },
            y: function(d) {
              return d.values.Q3;
            },
            maxBoxWidth: 55,
            yDomain: [statistics.minimum, statistics.maximum]
          }
        };

        // Code here will be linted with JSCS.
        // jscs:disable
        $scope.data2 = [{
          label: $scope.variable.name,
          values: {
            Q1: statistics.firstQuartile,
            Q2: statistics.median,
            Q3: statistics.thirdQuartile,
            whisker_low: statistics.lowWhisker,
            whisker_high: statistics.highWhisker
          }
        }];
        // Code here will be linted with JSCS.
        // jscs:enable

        $translate(<commit_msg>#157 changed small box plot min/max config.<commit_after>/* global d3 */
/* @Author <NAME> */
'use strict';

angular.module('metadatamanagementApp')
  .controller('VariableDetailController', ['$scope', 'entity', 'Language',
    '$translate',

    function($scope, entity, Language, $translate) {
      $scope.variable = entity;

      //options for charts
      $scope.optionsRelative = {
        chart: {
          //CSS information
          type: 'discreteBarChart',
          height: 250,
          showValues: true,
          color: ['#0069B4'],
          valueFormat: function(d) {
            //.2f means two numbers after a commata
            return d3.format(',.2f')(d);
          },

          transitionDuration: 500,

          //Point for data extraction to visualisation
          x: function(d) {

            //if en, return en lables
            if (Language.getCurrentInstantly() === 'en') {
              if (d.label.en) {
                return d.label.en;
                //return the code, if label is not set
              } else {
                return d.code;
              }
            }

            //de is default. return de labels.
            if (d.label.de) {
              return d.label.de;
              //return code, if label is not set
            } else {
              return d.code;
            }
          },

          y: function(d) {
            return d.relativeFrequency;
          },
        },

        // title options
        title: {
          enable: true,
          text: '',
        },
        // subtitle options
        subtitle: {
          enable: true,
          text: '',
          css: {
            'text-align': 'center',
            margin: '10px 13px 0px 7px',
          },
        }
      };

      $scope.optionsAbsolute = {
        chart: {
          //CSS information
          type: 'discreteBarChart',
          height: 250,
          showValues: true,
          color: ['#0069B4'],
          valueFormat: function(d) {
            //.2f means two numbers after a commata
            return d3.format(',.2f')(d);
          },

          transitionDuration: 500,

          //Point for data extraction to visualisation
          x: function(d) {

            //if en, return en lables
            if (Language.getCurrentInstantly() === 'en') {
              if (d.label.en) {
                return d.label.en;
                //return the code, if label is not set
              } else {
                return d.code;
              }
            }

            //de is default. return de labels.
            if (d.label.de) {
              return d.label.de;
              //return code, if label is not set
            } else {
              return d.code;
            }
          },

          y: function(d) {
            return d.absoluteFrequency;
          },
        },

        // title options
        title: {
          enable: true,
          text: '',
        },

        // subtitle options
        subtitle: {
          enable: true,
          text: '',
          css: {
            'text-align': 'center',
            margin: '10px 13px 0px 7px',
          },
        }
      };

      //Wait for promise object
      $scope.variable.$promise.then(function() {
        var statistics = $scope.variable.statistics;

        //The data object is for the display
        $scope.data = [{
          values: $scope.variable.values
        }];

        // Box Plot Chart
        //----------------------------------------------------------------------
        $scope.options = {
          chart: {
            type: 'boxPlotChart',
            height: 550,
            color: ['#0069B4'],
            x: function(d) {
              return d.label;
            },
            y: function(d) {
              return d.values.Q3;
            },
            yDomain: [statistics.lowWhisker, statistics.highWhisker]
          }
        };

        // Code here will be linted with JSCS.
        // jscs:disable
        $scope.data2 = [{
          label: $scope.variable.name,
          values: {
            Q1: statistics.firstQuartile,
            Q2: statistics.median,
            Q3: statistics.thirdQuartile,
            whisker_low: statistics.lowWhisker,
            whisker_high: statistics.highWhisker
          }
        }];
        // Code here will be linted with JSCS.
        // jscs:enable

        $translate(
{'fraction_non_alphanumeric': 0.12667575551011134, 'fraction_numerical': 0.012837991365598728, 'mean_word_length': 1.101456194795894, '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': '3230741', 'n_tokens_mistral': 2436, 'n_tokens_neox': 2312, 'n_words': 593}