export default function splitOption(dataNodes = [],dataEdges=[]) { let nodes = []; dataNodes.forEach(ele => { let obj = { x: ele.x, y: ele.y, id: ele.id, name: ele.name, value: ele.value, symbolSize: ele.symbolSize, itemStyle: { color: ele.color } }; nodes.push(obj) }) let edges = []; dataEdges.forEach(ele => { let obj = { source: ele.source, target: ele.target }; edges.push(obj); }) return { tooltip: { trigger: "item", backgroundColor: "#08182F", color: "#fff", borderColor: "#3373CC", textStyle: { color: "#fff", //设置文字颜色 fontSize: 9 }, extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;", confine: true }, title: { show: false, text: 'NPM Dependencies' }, animationDurationUpdate: 1500, animationEasingUpdate: 'quinticInOut', series: [ { type: 'graph', layout: 'none', // progressiveThreshold: 700, data: nodes, links: edges, emphasis: { focus: 'adjacency', label: { position: 'right', show: true } }, label: { show: true, color: '#333', position: 'right', formatter: '{b}' }, labelLayout: { hideOverlap: true }, scaleLimit: { min: 0.4, max: 2 }, roam: true, lineStyle: { color: 'source', width: 0.5, curveness: 0.3, opacity: 0.7 } } ] } }