<commit_before>// View.vue
// Component creates a view. This is a combination of an image canvas (either
// deepZoom or standard) and an annotation canvas. When the components are
// mounted they are setup with the appropriate librarys.
<template lang="html">

  <div
    id="view"
    class="elevation-2 pointers-please">

    <app-osd-canvas/>

    <app-annotation-canvas/>

  </div>

</template>

<script>
import { mapState, mapActions } from 'vuex'

import OSDCanvas from './OSDCanvas.vue'
import AnnotationCanvas from './AnnotationCanvas.vue'

export default {
  components: {
    'app-osd-canvas': OSDCanvas,
    'app-annotation-canvas': AnnotationCanvas
  },

  computed: {
    ...mapState({
      projectImageName: state => state.image.projectImageName
    })
  },

  async mounted () {
    if (this.$router.currentRoute.name === 'demo') {
      await this.setProjectImageName('demo')
      this.loadDemo()
    }
    else if (!this.projectImageName) {
      this.$router.replace('/dashboard')
    } else {
      this.loadProject()
    }
  },

  methods: {
    ...mapActions({
      setProjectImageName: 'image/setProjectImageName',
      loadDemo: 'app/loadDemo',
      loadProject: 'app/loadProject'
    })
  }
}
</script>

<style scoped>
#view {
  position: relative;
  display: flex;
  flex: 1 1 auto;
}
</style><commit_msg>moved loadProject<commit_after>// View.vue
// Component creates a view. This is a combination of an image canvas (either
// deepZoom or standard) and an annotation canvas. When the components are
// mounted they are setup with the appropriate librarys.
<template lang="html">

  <div
    id="view"
    class="elevation-2 pointers-please">

    <app-osd-canvas/>

    <app-annotation-canvas/>

  </div>

</template>

<script>
import { mapState, mapActions } from 'vuex'

import OSDCanvas from './OSDCanvas.vue'
import AnnotationCanvas from './AnnotationCanvas.vue'

export default {
  components: {
    'app-osd-canvas': OSDCanvas,
    'app-annotation-canvas': AnnotationCanvas
  },

  computed: {
    ...mapState({
      projectImageName: state => state.image.projectImageName
    })
  },

  async mounted () {
    if (this.$router.currentRoute.name === 'demo') {
      await this.setProjectImageName('demo')
      this.loadDemo()
    }
    else if (!this.projectImageName) {
      this.$router.replace('/dashboard')
    } else {
      this.loadProject()
    }
  },

  methods: {
    ...mapActions({
      setProjectImageName: 'image/setProjectImageName',
      loadDemo: 'app/loadDemo',
      loadProject: 'backend/loadProject'
    })
  }
}
</script>

<style scoped>
#view {
  position: relative;
  display: flex;
  flex: 1 1 auto;
}
</style>
{'fraction_non_alphanumeric': 0.13741598207617625, 'fraction_numerical': 0.0022404779686333084, 'mean_word_length': 3.0104790419161676, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, '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': '4993669', 'n_tokens_mistral': 863, 'n_tokens_neox': 834, 'n_words': 210}