

const getSankeyChart = (nodes, links) => {
  const option = {
    series: {
      type: 'sankey',
      layout: 'none',
      left: '2%',
      right: '26%',
      top: '5%',
      bottom: '5%',
      emphasis: {
        focus: 'adjacency'
      },
      nodeWidth: 40,
      label: {
        show: true,
        formatter: function (params) {
          return `${params.name}`;
        },
        position: 'right',
        textStyle: {
          fontSize: '14px',
          color: '#555'
        }
      },
      data: nodes,
      links: links
    }
  };

  return option
}

export default getSankeyChart