Remove duplicated nodes from the world map

This commit is contained in:
nymkappa 2022-07-24 15:08:48 +02:00
parent 0f91778970
commit 44725d9b29
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04

View File

@ -57,20 +57,26 @@ export class NodesChannelsMap implements OnInit, OnDestroy {
const channelsLoc = []; const channelsLoc = [];
const nodes = []; const nodes = [];
const nodesPubkeys = {};
for (const channel of data[1]) { for (const channel of data[1]) {
channelsLoc.push([[channel[2], channel[3]], [channel[6], channel[7]]]); channelsLoc.push([[channel[2], channel[3]], [channel[6], channel[7]]]);
nodes.push({ if (!nodesPubkeys[channel[0]]) {
publicKey: channel[0], nodes.push({
name: channel[1], publicKey: channel[0],
value: [channel[2], channel[3]], name: channel[1],
}); value: [channel[2], channel[3]],
nodes.push({ });
publicKey: channel[4], nodesPubkeys[channel[0]] = true;
name: channel[5], }
value: [channel[6], channel[7]], if (!nodesPubkeys[channel[4]]) {
}); nodes.push({
publicKey: channel[4],
name: channel[5],
value: [channel[6], channel[7]],
});
nodesPubkeys[channel[4]] = true;
}
} }
this.prepareChartOptions(nodes, channelsLoc); this.prepareChartOptions(nodes, channelsLoc);
})); }));
}) })
@ -100,7 +106,7 @@ export class NodesChannelsMap implements OnInit, OnDestroy {
postEffect: { postEffect: {
enable: true, enable: true,
bloom: { bloom: {
intensity: this.style === 'nodepage' ? 0.1 : 0.01, intensity: 0.1,
} }
}, },
viewControl: { viewControl: {
@ -113,10 +119,10 @@ export class NodesChannelsMap implements OnInit, OnDestroy {
zoomSensivity: 0.5, zoomSensivity: 0.5,
}, },
itemStyle: { itemStyle: {
color: '#FFFFFF', color: 'white',
opacity: 0.02, opacity: 0.02,
borderWidth: 1, borderWidth: 1,
borderColor: '#00000050', borderColor: 'black',
}, },
regionHeight: 0.01, regionHeight: 0.01,
}, },