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
+5 -5
View File
@@ -1,7 +1,7 @@
<template>
<div class="h-100">
<div class="h-100 position-relative">
<!-- BACKGROUND (mode) -->
<!-- <component :is="mode" /> -->
<component :is="mode" />
<!-- FOREGROUND (texts) -->
<section v-for="group in groups" :key="group.id" class="split-screen">
@@ -22,9 +22,9 @@ export default {
name: 'Library',
components: {
// CardList,
// CardMap,
// TreeMap,
CardList,
CardMap,
TreeMap,
TextCard
},
+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>