setup map display

This commit is contained in:
axolotle
2021-03-10 12:48:36 +01:00
parent 9b980cdab6
commit f28c1fe4dd
2 changed files with 41 additions and 7 deletions
+36 -2
View File
@@ -1,10 +1,44 @@
<template>
<component-debug :component="this" />
<b-overlay :show="loading" class="h-100 position-absolute">
<node-map
v-if="!loading"
v-bind="mapData"
:show-id="true"
/>
</b-overlay>
</template>
<script>
import NodeMap from '@/components/NodeMap'
import { toManyManyData } from '@/helpers/d3Data'
export default {
name: 'TreeMap'
name: 'TreeMap',
components: {
NodeMap
},
props: {
id: { type: Number, default: 1 }
},
data () {
return {
loading: true,
depth: 3,
mapData: { nodes: null, links: null }
}
},
created () {
const { id, depth } = this
this.$store.dispatch('GET_TREE_WITH_DEPTH', { id, depth }).then((data) => {
this.mapData = toManyManyData(data)
this.loading = false
})
}
}
</script>