<commit_before>(function(ng) {
  'use strict';

  /**
   * generate directive link function
   *
   * @param {function} $http service to make ajax requests from angular
   * @param {object}   util  service to get echart
   * @param {string}   type  chart type
   */

  var getLinkFunction = function($http, util, type) {
    return function(scope, element, attrs) {
      scope.config = scope.config || {};

      var dom = element.find('div')[0],
        width, height, chart, radius;

      function getSizes(config) {
        width = config.width || attrs.width || 320;
        height = config.height || attrs.height || 240;

        if (type === 'easyPie') {
          width = config.width || attrs.width || 150;
          height = config.height || attrs.height || 150;
        }

        if (type === 'ntdPie') {
            width = config.width || attrs.pieWidth || 800;
            height = config.height || attrs.pieHeight || 300;
            radius = Math.min(width, height) / 2;
        }

        dom.style.width = width + 'px';
        dom.style.height = height + 'px';
      }

      function getOptions(data, config, type) {
        // merge default config
        config = ng.extend({
          showXAxis: true,
          showYAxis: true,
          showLegend: true
        }, config);

        var xAxis = ng.extend({
          orient: 'top',
          axisLine: { show: true}
        }, ng.isObject(config.xAxis) ? config.xAxis : {});

        var yAxis = ng.extend({
          type: 'value',
          orient: 'right',
          scale: true,
          axisLine: {
            show: true
          },
          axisLabel: {
            formatter: function(v) {
              return util.formatKMBT(v);
            }
          }
        }, ng.isObject(config.yAxis) ? config.yAxis : {});

        var toolbox = {show: false};

        if (type === 'bubble') {
          var bubbleXAxis = {
            type: 'value',
            power: 1,
            splitNumber: 4,
            scale: true
          };
          xAxis = ng.extend(bubbleXAxis, xAxis);
          yAxis = ng.extend(bubbleXAxis, yAxis);
          toolbox = {
            show: true,
            feature: {
              dataZoom: {show: true},
              restore: {show: true}
            }
          };
        }
        if (type === 'scatter') {
          var scatterXAxis = {
            type: 'category',
            axisLabel: {
              formatter: function(v) {
                return '类目' + v;
              }
            },<commit_msg>fix echarts<commit_after>(function(ng) {
  'use strict';

  /**
   * generate directive link function
   *
   * @param {function} $http service to make ajax requests from angular
   * @param {object}   util  service to get echart
   * @param {string}   type  chart type
   */

  var getLinkFunction = function($http, util, type) {
    return function(scope, element, attrs) {
      scope.config = scope.config || {};

      var dom = element.find('div')[0],
        width, height, chart, radius;

      function getSizes(config) {
        width = config.width || attrs.width || 320;
        height = config.height || attrs.height || 240;

        if (type === 'easyPie') {
          width = config.width || attrs.width || 150;
          height = config.height || attrs.height || 150;
        }

        if (type === 'ntdPie') {
            width = config.width || attrs.pieWidth || 800;
            height = config.height || attrs.pieHeight || 300;
            radius = Math.min(width, height) / 2;
        }

        dom.style.width = width + 'px';
        dom.style.height = height + 'px';
      }

      function getOptions(data, config, type) {
        // merge default config
        config = ng.extend({
          showXAxis: true,
          showYAxis: true,
          showLegend: true
        }, config);

        var xAxis = ng.extend({
          orient: 'top',
          axisLine: { show: true}
        }, ng.isObject(config.xAxis) ? config.xAxis : {});

        var yAxis = ng.extend({
          type: 'value',
          orient: 'right',
          scale: true,
          axisLine: {
            show: true
          },
          axisLabel: {
            formatter: function(v) {
              return util.formatKMBT(v);
            }
          }
        }, ng.isObject(config.yAxis) ? config.yAxis : {});

        var toolbox = {show: false};

        if (type === 'bubble') {
          var bubbleXAxis = {
            type: 'value',
            power: 1,
            splitNumber: 4,
            scale: true
          };
          xAxis = ng.extend(bubbleXAxis,
            ng.isObject(config.yAxis) ? config.yAxis : {});
          yAxis = ng.extend(bubbleXAxis,
            ng.isObject(config.yAxis) ? config.yAxis : {});
          toolbox = {
            show: true,
            feature: {
              dataZoom: {show: true},
              restore: {show: true}
            }
          };
        }
        if (type === 'scatter') {
          var scatterXAxis = {
            type: 'category',
            axisLabel: {
              formatter: function(v) {
                return '类目' + v;
              }
            },
{'fraction_non_alphanumeric': 0.13008130081300814, 'fraction_numerical': 0.008517228029423151, 'mean_word_length': 1.4581351094196005, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7137672', 'n_tokens_mistral': 1534, 'n_tokens_neox': 1470, 'n_words': 363}