11import * as echarts from "echarts/core" ;
2- import {
3- GraphChart ,
4- EffectScatterChart ,
5- LinesChart ,
6- ScatterChart ,
7- } from "echarts/charts" ;
2+ import { GraphChart , EffectScatterChart , LinesChart , ScatterChart } from "echarts/charts" ;
83import {
94 TooltipComponent ,
105 TitleComponent ,
@@ -205,8 +200,7 @@ class NetJSONGraphRender {
205200 {
206201 ...baseGraphSeries ,
207202 id : "network-graph" ,
208- type :
209- configs . graphConfig . series . type === "graphGL" ? "graphGL" : "graph" ,
203+ type : configs . graphConfig . series . type === "graphGL" ? "graphGL" : "graph" ,
210204 layout :
211205 configs . graphConfig . series . type === "graphGL"
212206 ? "forceAtlas2"
@@ -273,11 +267,7 @@ class NetJSONGraphRender {
273267 if ( ! location || ! location . lng || ! location . lat ) {
274268 console . error ( `Node ${ node . id } position is undefined!` ) ;
275269 } else {
276- const { nodeEmphasisConfig} = self . utils . getNodeStyle (
277- node ,
278- configs ,
279- "map" ,
280- ) ;
270+ const { nodeEmphasisConfig} = self . utils . getNodeStyle ( node , configs , "map" ) ;
281271
282272 let nodeName = "" ;
283273 if ( typeof node . label === "string" ) {
@@ -394,8 +384,7 @@ class NetJSONGraphRender {
394384 : nodeSizeConfig ;
395385 }
396386 return (
397- ( configs . mapOptions . nodeConfig &&
398- configs . mapOptions . nodeConfig . nodeSize ) ||
387+ ( configs . mapOptions . nodeConfig && configs . mapOptions . nodeConfig . nodeSize ) ||
399388 17
400389 ) ;
401390 } ,
@@ -429,10 +418,7 @@ class NetJSONGraphRender {
429418 *
430419 */
431420 graphRender ( JSONData , self ) {
432- self . utils . echartsSetOption (
433- self . utils . generateGraphOption ( JSONData , self ) ,
434- self ,
435- ) ;
421+ self . utils . echartsSetOption ( self . utils . generateGraphOption ( JSONData , self ) , self ) ;
436422
437423 window . onresize = ( ) => {
438424 self . echarts . resize ( ) ;
@@ -644,29 +630,22 @@ class NetJSONGraphRender {
644630 self . leaflet . getZoom ( ) >= self . config . loadMoreAtZoomLevel &&
645631 self . hasMoreData
646632 ) {
647- const data = await self . utils . getBBoxData . call (
648- self ,
649- self . JSONParam ,
650- bounds ,
651- ) ;
633+ const data = await self . utils . getBBoxData . call ( self , self . JSONParam , bounds ) ;
652634 self . config . prepareData . call ( self , data ) ;
653635 const dataNodeSet = new Set ( self . data . nodes . map ( ( n ) => n . id ) ) ;
654636 const sourceLinkSet = new Set ( self . data . links . map ( ( l ) => l . source ) ) ;
655637 const targetLinkSet = new Set ( self . data . links . map ( ( l ) => l . target ) ) ;
656638 const nodes = data . nodes . filter ( ( node ) => ! dataNodeSet . has ( node . id ) ) ;
657639 const links = data . links . filter (
658- ( link ) =>
659- ! sourceLinkSet . has ( link . source ) && ! targetLinkSet . has ( link . target ) ,
640+ ( link ) => ! sourceLinkSet . has ( link . source ) && ! targetLinkSet . has ( link . target ) ,
660641 ) ;
661642 const boundsDataSet = new Set ( data . nodes . map ( ( n ) => n . id ) ) ;
662643 const nonCommonNodes = self . bboxData . nodes . filter (
663644 ( node ) => ! boundsDataSet . has ( node . id ) ,
664645 ) ;
665646 const removableNodes = new Set ( nonCommonNodes . map ( ( n ) => n . id ) ) ;
666647
667- JSONData . nodes = JSONData . nodes . filter (
668- ( node ) => ! removableNodes . has ( node . id ) ,
669- ) ;
648+ JSONData . nodes = JSONData . nodes . filter ( ( node ) => ! removableNodes . has ( node . id ) ) ;
670649 self . bboxData . nodes = self . bboxData . nodes . concat ( nodes ) ;
671650 self . bboxData . links = self . bboxData . links . concat ( links ) ;
672651 JSONData = {
@@ -684,8 +663,7 @@ class NetJSONGraphRender {
684663 self . config . clustering &&
685664 self . config . clusteringThreshold < JSONData . nodes . length
686665 ) {
687- let { clusters, nonClusterNodes, nonClusterLinks} =
688- self . utils . makeCluster ( self ) ;
666+ let { clusters, nonClusterNodes, nonClusterLinks} = self . utils . makeCluster ( self ) ;
689667
690668 // Only show clusters if we're below the disableClusteringAtLevel
691669 if ( self . leaflet . getZoom ( ) > self . config . disableClusteringAtLevel ) {
@@ -829,9 +807,7 @@ class NetJSONGraphRender {
829807 return true ;
830808 }
831809 if ( existingNodeIds . has ( node . id ) ) {
832- console . warn (
833- `Duplicate node ID ${ node . id } detected during merge and skipped.` ,
834- ) ;
810+ console . warn ( `Duplicate node ID ${ node . id } detected during merge and skipped.` ) ;
835811 return false ;
836812 }
837813 return true ;
0 commit comments