<commit_before>'use strict';

angular.module('picardy.graphs.common', [])
  .factory('common', ['$window', function ($window) {

    var common = {

      define: function ($rootScope, render) {
        return {
          restrict: 'E',
          scope: {
            render: '=',
            data: '='
          },
          link: function (scope, element, attrs) {
            $rootScope[attrs.render] = function (data) {
              scope.data = data;
              render(scope, element, attrs);
            };
          }
        };
      },

      initSvg: function (el, width, height) {
        return d3.select(el).
          append('svg').<commit_msg>remove element children every re-render<commit_after>'use strict';

angular.module('picardy.graphs.common', [])
  .factory('common', ['$window', function ($window) {

    var common = {

      define: function ($rootScope, render) {
        return {
          restrict: 'E',
          scope: {
            render: '=',
            data: '='
          },
          link: function (scope, element, attrs) {
            $rootScope[attrs.render] = function (data) {
              scope.data = data;
              render(scope, element, attrs);
            };
          }
        };
      },

      initSvg: function (el, width, height) {
        el.innerHTML = '';
        return d3.select(el).
          append('svg').
{'fraction_non_alphanumeric': 0.14960058097313, 'fraction_numerical': 0.0014524328249818446, 'mean_word_length': 1.6098484848484849, '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': '2471070', 'n_tokens_mistral': 388, 'n_tokens_neox': 385, 'n_words': 84}