Merge pull request #2171 from mempool/nymkappa/bugfix/remove-duplicated-node-map

Remove duplicated nodes from the world map
This commit is contained in:
wiz 2022-07-24 17:41:29 +02:00 committed by GitHub
commit 12e516c366
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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]]]);
if (!nodesPubkeys[channel[0]]) {
nodes.push({ nodes.push({
publicKey: channel[0], publicKey: channel[0],
name: channel[1], name: channel[1],
value: [channel[2], channel[3]], value: [channel[2], channel[3]],
}); });
nodesPubkeys[channel[0]] = true;
}
if (!nodesPubkeys[channel[4]]) {
nodes.push({ nodes.push({
publicKey: channel[4], publicKey: channel[4],
name: channel[5], name: channel[5],
value: [channel[6], channel[7]], 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,
}, },