

const getGraphChart = (nodes, links) => {

  const option = {

    legend: {
      // data: categories.map(c => c.name),
      show: false,
      top: 40,
      textStyle: {
        fontSize: 12
      }
    },
    animation: true,
    animationDuration: 1000,
    animationEasing: 'cubicOut',
    series: [{
      type: 'graph',
      itemStyle: {
        color: '#73C0DE'
      },
      layout: 'force',
      data: nodes,
      links: links,
      // categories: categories,
      roam: true,
      label: {
        show: true,
        position: 'bottom',
        formatter: '{b}',
        fontSize: 12,
        fontWeight: 'bold',
        // backgroundColor: 'rgba(255,255,255,0.8)',
        padding: [4, 6],
        borderRadius: 4
      },
      lineStyle: {
        color: 'source',
        curveness: 0,
        width: 1,
        color: '#AED6FF'
      },
      edgeSymbol: ['none', 'arrow'],
      edgeSymbolSize: [0, 5],
      emphasis: {
        focus: 'adjacency',
        lineStyle: {
          width: 4
        },
        label: {
          show: true,
          fontSize: 14
        }
      },
      force: {
        repulsion: 300,
        gravity: 0,
        edgeLength: 300
      }
    }],
    // color: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de']
  };

  return option

}

export default getGraphChart