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

  angular
    .module('openSenseMapApp')
    .directive('osemCharts', osemCharts);

  osemCharts.$inject = ['$timeout', '$location'];

  /* @ngInject */
  function osemCharts ($timeout, $location) {
    var rmax = 30;
    var directive = {
      templateUrl: 'components/charts.directive.html',
      link: link,
      restrict: 'EA',
      transclude: true,
      controller: ChartController,
      controllerAs: 'chart',
      bindToController: true, // because the scope is isolated
      scope: {
        chartData: '=',
        yAxisTitle: '=',
        selectedMeasurement: '=',
        tooltipPlaceholder: '@'
      }
    };
    return directive;

    function link(scope, element, attrs, chartCtrl) {
      var margin = {top: 20, right: 5, bottom: 30, left: 50, yAxis: 10};
      var svg = d3.select('.chart-container').append('svg')
          .attr('width', '100%')
          .attr('height', '215');
      var width = +element.parent()[0].offsetWidth - margin.right;
      var height = +svg.attr("height") - margin.top - margin.bottom;
      var g = svg.append('g').attr('transform', 'translate(' + margin.left+','+margin.top+')');<commit_msg>select correct element for chart<commit_after>(function () {
  'use strict';

  angular
    .module('openSenseMapApp')
    .directive('osemCharts', osemCharts);

  osemCharts.$inject = ['$timeout', '$location'];

  /* @ngInject */
  function osemCharts ($timeout, $location) {
    var rmax = 30;
    var directive = {
      templateUrl: 'components/charts.directive.html',
      link: link,
      restrict: 'EA',
      transclude: true,
      controller: ChartController,
      controllerAs: 'chart',
      bindToController: true, // because the scope is isolated
      scope: {
        chartData: '=',
        yAxisTitle: '=',
        selectedMeasurement: '=',
        tooltipPlaceholder: '@'
      }
    };
    return directive;

    function link(scope, element, attrs, chartCtrl) {
      var margin = {top: 20, right: 5, bottom: 30, left: 50, yAxis: 10};
      var svg = d3.select(element[0]).select('.chart-container').append('svg')
          .attr('width', '100%')
          .attr('height', '215');
      var width = +element.parent()[0].offsetWidth - margin.right;
      var height = +svg.attr("height") - margin.top - margin.bottom;
      var g = svg.append('g').attr('transform', 'translate(' + margin.left+','+margin.top+')');
{'fraction_non_alphanumeric': 0.16721446179129007, 'fraction_numerical': 0.01602300739523418, 'mean_word_length': 2.8046875, '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': '7038778', 'n_tokens_mistral': 789, 'n_tokens_neox': 748, 'n_words': 171}