<template>
  <div class="graph-chart-wrapper" id="graph">

  </div>
</template>

<script setup>
import { onMounted, nextTick } from 'vue';
import setChart from '@/utils/setChart';
import getGraphChart from './graphChart';

const props = defineProps({
  nodes: {
    type: Array,
    default: []
  },
  links: {
    type: Array,
    default: []
  },
  layoutType: {
    type: String,
    default: 'force'
  },
  width: {
    type: String,
    default: 'force'
  },
  height: {
        type: String,
    default: 'force'
  }
})

onMounted(() => {
  const graph = getGraphChart(props.nodes, props.links, props.layoutType)
  setChart(graph, 'graph')
})


</script>


<style lang="scss" scoped>
.graph-chart-wrapper {
  width: 100%;
  height: 100%;
}
</style>