<commit_before><template lang="pug">
div
  div.aw-summary-container
  // Use visibility to make sure elements don't skip when data finishes loading
  div(:style='{"visibility": visible ? "visible" : "hidden"}')
    b-button.mt-1(size="sm", variant="outline-secondary", @click="limit_ += 5")
      icon(name="angle-double-down")
      | Show more
    b-button.ml-2.mt-1(v-if="limit_ != limit" size="sm", variant="outline-secondary", @click="limit_ = limit")
      icon(name="angle-double-up")
</template>

<style scoped lang="scss">
.aw-summary-container > svg {
  border: 1px solid #999;
  border-radius: 0.5em;
}
</style>

<script>
// NOTE: This is just a Vue.js component wrapper for summary.js
//       Code should generally go in the framework-independent file.

import summary from './summary.js';
import 'vue-awesome/icons/angle-double-down';
import 'vue-awesome/icons/angle-double-up';

export default {
  name: 'aw-summary',
  props: {
    fields: Array,
    namefunc: Function,
    hoverfunc: {
      type: Function,
      default: null, // If not set we will default to namefunc
    },
    colorfunc: Function,
    limit: {
      type: Number,
      default: 5,
    },
    with_limit: {
      type: Boolean,
      default: false,
    },
  },
  data: function () {
    return { limit_: this.limit };
  },
  computed: {
    visible() {
      return (
        this.fields && this.fields.length > 0 && this.with_limit && this.fields.length > this.limit_
      );
    },
  },
  watch: {
    fields: function () {
      this.update();
    },
    limit_: function () {<commit_msg>fix: fixed 'show less' button in Summary vis when all entries shown<commit_after><template lang="pug">
div
  div.aw-summary-container
  // Use visibility to make sure elements don't skip when data finishes loading
  div(:style='{"visibility": visible_more ? "visible" : "hidden"}')
    b-button.mt-1.mr-2(v-if="fields && (limit_ < fields.length)", size="sm", variant="outline-secondary", @click="limit_ += 5")
      icon(name="angle-double-down")
      | Show more
    b-button.mt-1(v-if="limit_ != limit" size="sm", variant="outline-secondary", @click="limit_ = limit")
      icon(name="angle-double-up")
</template>

<style scoped lang="scss">
.aw-summary-container > svg {
  border: 1px solid #999;
  border-radius: 0.5em;
}
</style>

<script>
// NOTE: This is just a Vue.js component wrapper for summary.js
//       Code should generally go in the framework-independent file.

import summary from './summary.js';
import 'vue-awesome/icons/angle-double-down';
import 'vue-awesome/icons/angle-double-up';

export default {
  name: 'aw-summary',
  props: {
    fields: Array,
    namefunc: Function,
    hoverfunc: {
      type: Function,
      default: null, // If not set we will default to namefunc
    },
    colorfunc: Function,
    limit: {
      type: Number,
      default: 5,
    },
    with_limit: {
      type: Boolean,
      default: false,
    },
  },
  data: function () {
    return { limit_: this.limit };
  },
  computed: {
    visible_more() {
      return this.fields && this.fields.length > 0 && this.with_limit;
    },
  },
  watch: {
    fields: function () {
      this.update();
    },
    limit_: function () {
{'fraction_non_alphanumeric': 0.15470643056849953, 'fraction_numerical': 0.007455731593662628, 'mean_word_length': 2.8983050847457625, 'pattern_counts': {'":': 2, '<': 14, '<?xml version=': 0, '>': 18, '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': '2862005', 'n_tokens_mistral': 1059, 'n_tokens_neox': 1034, 'n_words': 268}