Skip to content

Commit 5648e36

Browse files
committed
Fix code formatting and style
1 parent 5087086 commit 5648e36

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

src/js/netjsongraph.render.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import {
1212
LegendComponent,
1313
GraphicComponent,
1414
} from "echarts/components";
15-
import { SVGRenderer } from "echarts/renderers";
15+
import {SVGRenderer} from "echarts/renderers";
1616
import L from "leaflet/dist/leaflet";
1717
import "echarts-gl";
18-
import { addPolygonOverlays } from "./netjsongraph.geojson";
18+
import {addPolygonOverlays} from "./netjsongraph.geojson";
1919

2020
echarts.use([
2121
GraphChart,
@@ -111,7 +111,7 @@ class NetJSONGraphRender {
111111
? clickElement("link", params.data.link)
112112
: !params.data.cluster && clickElement("node", params.data.node);
113113
},
114-
{ passive: true },
114+
{passive: true},
115115
);
116116

117117
return echartsLayer;
@@ -134,7 +134,7 @@ class NetJSONGraphRender {
134134
const configs = self.config;
135135
const nodes = JSONData.nodes.map((node) => {
136136
const nodeResult = JSON.parse(JSON.stringify(node));
137-
const { nodeStyleConfig, nodeSizeConfig, nodeEmphasisConfig } =
137+
const {nodeStyleConfig, nodeSizeConfig, nodeEmphasisConfig} =
138138
self.utils.getNodeStyle(node, configs, "graph");
139139

140140
nodeResult.itemStyle = nodeStyleConfig;
@@ -159,21 +159,21 @@ class NetJSONGraphRender {
159159
});
160160
const links = JSONData.links.map((link) => {
161161
const linkResult = JSON.parse(JSON.stringify(link));
162-
const { linkStyleConfig, linkEmphasisConfig } = self.utils.getLinkStyle(
162+
const {linkStyleConfig, linkEmphasisConfig} = self.utils.getLinkStyle(
163163
link,
164164
configs,
165165
"graph",
166166
);
167167

168168
linkResult.lineStyle = linkStyleConfig;
169-
linkResult.emphasis = { lineStyle: linkEmphasisConfig.linkStyle };
169+
linkResult.emphasis = {lineStyle: linkEmphasisConfig.linkStyle};
170170

171171
return linkResult;
172172
});
173173

174174
// Clone label config to avoid mutating defaults
175-
const baseGraphSeries = { ...configs.graphConfig.series };
176-
const baseGraphLabel = { ...(baseGraphSeries.label || {}) };
175+
const baseGraphSeries = {...configs.graphConfig.series};
176+
const baseGraphLabel = {...(baseGraphSeries.label || {})};
177177

178178
// Shared helper to get current graph zoom level
179179
const getGraphZoom = () => {
@@ -217,8 +217,8 @@ class NetJSONGraphRender {
217217
];
218218
const legend = categories.length
219219
? {
220-
data: categories,
221-
}
220+
data: categories,
221+
}
222222
: undefined;
223223

224224
return {
@@ -242,7 +242,7 @@ class NetJSONGraphRender {
242242
*/
243243
generateMapOption(JSONData, self, clusters = []) {
244244
const configs = self.config;
245-
const { nodes, links } = JSONData;
245+
const {nodes, links} = JSONData;
246246
const flatNodes = JSONData.flatNodes || {};
247247
const linesData = [];
248248
let nodesData = [];
@@ -268,12 +268,12 @@ class NetJSONGraphRender {
268268
if (!node.properties) {
269269
console.error(`Node ${node.id} position is undefined!`);
270270
} else {
271-
const { location } = node.properties;
271+
const {location} = node.properties;
272272

273273
if (!location || !location.lng || !location.lat) {
274274
console.error(`Node ${node.id} position is undefined!`);
275275
} else {
276-
const { nodeEmphasisConfig } = self.utils.getNodeStyle(
276+
const {nodeEmphasisConfig} = self.utils.getNodeStyle(
277277
node,
278278
configs,
279279
"map",
@@ -306,7 +306,7 @@ class NetJSONGraphRender {
306306
} else if (!flatNodes[link.target]) {
307307
console.warn(`Node ${link.target} does not exist!`);
308308
} else {
309-
const { linkStyleConfig, linkEmphasisConfig } = self.utils.getLinkStyle(
309+
const {linkStyleConfig, linkEmphasisConfig} = self.utils.getLinkStyle(
310310
link,
311311
configs,
312312
"map",
@@ -323,7 +323,7 @@ class NetJSONGraphRender {
323323
],
324324
],
325325
lineStyle: linkStyleConfig,
326-
emphasis: { lineStyle: linkEmphasisConfig.linkStyle },
326+
emphasis: {lineStyle: linkEmphasisConfig.linkStyle},
327327
link,
328328
});
329329
}
@@ -382,15 +382,15 @@ class NetJSONGraphRender {
382382
);
383383
}
384384
if (params.data && params.data.node) {
385-
const { nodeSizeConfig } = self.utils.getNodeStyle(
385+
const {nodeSizeConfig} = self.utils.getNodeStyle(
386386
params.data.node,
387387
configs,
388388
"map",
389389
);
390390
return typeof nodeSizeConfig === "object"
391391
? (configs.mapOptions.nodeConfig &&
392-
configs.mapOptions.nodeConfig.nodeSize) ||
393-
17
392+
configs.mapOptions.nodeConfig.nodeSize) ||
393+
17
394394
: nodeSizeConfig;
395395
}
396396
return (
@@ -451,7 +451,7 @@ class NetJSONGraphRender {
451451
option.series[0] &&
452452
option.series[0].zoom >= self.config.showGraphLabelsAtZoom;
453453
if (labelsVisible !== self._labelsVisible) {
454-
self.echarts.resize({ animation: false, silent: true });
454+
self.echarts.resize({animation: false, silent: true});
455455
self._labelsVisible = labelsVisible;
456456
}
457457
});
@@ -545,12 +545,12 @@ class NetJSONGraphRender {
545545
}
546546

547547
if (bounds && bounds.isValid()) {
548-
self.leaflet.fitBounds(bounds, { padding: [20, 20] });
548+
self.leaflet.fitBounds(bounds, {padding: [20, 20]});
549549
}
550550
}
551551

552552
// 4. Resolve label visibility threshold
553-
let { showMapLabelsAtZoom } = self.config;
553+
let {showMapLabelsAtZoom} = self.config;
554554
if (showMapLabelsAtZoom === undefined) {
555555
if (self.config.showLabelsAtZoomLevel !== undefined) {
556556
showMapLabelsAtZoom = self.config.showLabelsAtZoomLevel;
@@ -685,7 +685,7 @@ class NetJSONGraphRender {
685685
self.config.clustering &&
686686
self.config.clusteringThreshold < JSONData.nodes.length
687687
) {
688-
let { clusters, nonClusterNodes, nonClusterLinks } =
688+
let {clusters, nonClusterNodes, nonClusterLinks} =
689689
self.utils.makeCluster(self);
690690

691691
// Only show clusters if we're below the disableClusteringAtLevel
@@ -770,7 +770,7 @@ class NetJSONGraphRender {
770770
if (self.config.render === self.utils.mapRender) {
771771
const opts = self.utils.generateMapOption(JSONData, self);
772772
opts.series.forEach((obj, index) => {
773-
self.echarts.appendData({ seriesIndex: index, data: obj.data });
773+
self.echarts.appendData({seriesIndex: index, data: obj.data});
774774
});
775775
// modify this.data
776776
self.utils.mergeData(JSONData, self);
@@ -850,4 +850,4 @@ class NetJSONGraphRender {
850850
}
851851
}
852852

853-
export { NetJSONGraphRender, echarts, L };
853+
export {NetJSONGraphRender, echarts, L};

0 commit comments

Comments
 (0)