1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <template>
- <b-overlay :show="loading" class="h-100">
- <node-map
- v-if="!loading"
- v-bind="mapData"
- :show-id="true"
- v-on="$listeners"
- />
- </b-overlay>
- </template>
- <script>
- import NodeMap from '@/components/NodeMap'
- import { toManyManyData } from '@/helpers/d3Data'
- export default {
- 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>
- <style lang="scss" scoped>
- </style>
|