<commit_before>
<dom-module id="taaabs-trace-display-icons-fix">
  <link rel="import" type="css" href="../../bower_components/samotracesjs/dist/samotraces.css"/>
  <template>
    <paper-button raised on-click="refreshButtonClick">
      <iron-icon icon="refresh"></iron-icon>
      Refresh
    </paper-button>
  </template>

  <script>
    /* global Polymer, Samotraces */
    Polymer({
      is: 'taaabs-trace-display-icons-fix',
      properties: {
        time: {
          type: Object,
          notify: true,
          reflectToAttribute: true,
          value: function() { return {}; },
          observer: 'timeChanged'
        },
        timezoom: {
          type: Object,
          notify: true,
          reflectToAttribute: true,
          value: function() { return {}; },
          observer: 'timeZoomChanged'
        },
        trace: {
          type: Object,
          notify: true,
          reflectToAttribute: true,
          value: function() { return {}; },
          observer: 'traceChanged'
        },
        selected: {
          type: Number,
          observer: '_selectedChanged'
        },
        pageNum: {
          type: Number,
        }
      },
      traceChanged: function() {
        this.attachWidget();
      },
      timeChanged: function() {
        this.attachWidget();
      },
      timeZoomChanged: function() {
        this.attachWidget();
      },
      attached: function() {
        this.attachWidget();
      },
      attachWidget: function() {
        if (!! this.trace && !! this.time && !! this.timezoom && this.pageNum === this.selected) {
          var options = {
            url: function() {
              return 'images/teapot.png';
            }
          };
          this.trace.list_obsels(); // jshint ignore:line
          if (!this.widgetObject) {
            var element = document.createElement('div');
            element.setAttribute('id', 'traceIcon');
            Polymer.dom(this.root).appendChild(element);
            this.widgetObject = new Samotraces.Ui.Widgets.TraceDisplayIconsFix(this.$$('#traceIcon'), this.trace, this.time, this.timezoom, options);            
          }
        }
      },
      refreshButtonClick: function() {
        var coeff = Math.pow(0.8, 1);
        this.timezoom.zoom(coeff);
        this.widgetObject.addbrush();
        this.widgetObject.refresh_x(); // jshint ignore:line
      },
      _selectedChanged: function(newSelectedValue) {
        if (newSelectedValue === this.pageNum) {
          setTimeout(this.attachWidget.bind(this), 1000);
        } 
        else {
          if (!! this.$$('#traceIcon')) {
            Polymer.dom(this.root).removeChild(this.$$('#traceIcon'));
            this.set('widgetObject', null);
          }
        }
      }
    });
  </script>
</dom-module><commit_msg>taaabs-window-scale-fix dont need anymore a refresh button<commit_after>
<dom-module id="taaabs-trace-display-icons-fix">
  <link rel="import" type="css" href="../../bower_components/samotracesjs/dist/samotraces.css"/>
  <template>
  </template>

  <script>
    /* global Polymer, Samotraces */
    Polymer({
      is: 'taaabs-trace-display-icons-fix',
      properties: {
        time: {
          type: Object,
          notify: true,
          reflectToAttribute: true,
          value: function() { return {}; },
          observer: 'timeChanged'
        },
        timezoom: {
          type: Object,
          notify: true,
          reflectToAttribute: true,
          value: function() { return {}; },
          observer: 'timeZoomChanged'
        },
        trace: {
          type: Object,
          notify: true,
          reflectToAttribute: true,
          value: function() { return {}; },
          observer: 'traceChanged'
        },
        selected: {
          type: Number,
          observer: '_selectedChanged'
        },
        pageNum: {
          type: Number,
        }
      },
      traceChanged: function() {
        this.attachWidget();
      },
      timeChanged: function() {
        this.attachWidget();
      },
      timeZoomChanged: function() {
        this.attachWidget();
      },
      attached: function() {
        this.attachWidget();
      },
      attachWidget: function() {
        if (!! this.trace && !! this.time && !! this.timezoom && this.pageNum === this.selected) {
          var options = {
            url: function() {
              return 'images/teapot.png';
            }
          };
          this.trace.list_obsels(); // jshint ignore:line
          if (!this.widgetObject) {
            var element = document.createElement('div');
            element.setAttribute('id', 'traceIcon');
            Polymer.dom(this.root).appendChild(element);
            this.widgetObject = new Samotraces.Ui.Widgets.TraceDisplayIconsFix(this.$$('#traceIcon'), this.trace, this.time, this.timezoom, options);            
          }
        }
      },
      _selectedChanged: function(newSelectedValue) {
        if (newSelectedValue === this.pageNum) {
          setTimeout(this.attachWidget.bind(this), 1000);
        } 
        else {
          if (!! this.$$('#traceIcon')) {
            Polymer.dom(this.root).removeChild(this.$$('#traceIcon'));
            this.set('widgetObject', null);
          }
        }
      }
    });
  </script>
</dom-module>
{'fraction_non_alphanumeric': 0.14417293233082706, 'fraction_numerical': 0.0020676691729323306, 'mean_word_length': 1.7756911841418883, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '7252872', 'n_tokens_mistral': 1479, 'n_tokens_neox': 1468, 'n_words': 263}