Create active channel tree map component

This commit is contained in:
nymkappa
2022-08-23 11:26:00 +02:00
parent 7fe9029a4e
commit 08b04c3264
10 changed files with 192 additions and 11 deletions

View File

@@ -217,8 +217,12 @@ class ChannelsApi {
let channelStatusFilter;
if (status === 'open') {
channelStatusFilter = '< 2';
} else if (status === 'active') {
channelStatusFilter = '= 1';
} else if (status === 'closed') {
channelStatusFilter = '= 2';
} else {
throw new Error('getChannelsForNode: Invalid status requested');
}
// Channels originating from node
@@ -247,7 +251,12 @@ class ChannelsApi {
allChannels.sort((a, b) => {
return b.capacity - a.capacity;
});
allChannels = allChannels.slice(index, index + length);
if (index >= 0) {
allChannels = allChannels.slice(index, index + length);
} else if (index === -1) { // Node channels tree chart
allChannels = allChannels.slice(0, 1000);
}
const channels: any[] = []
for (const row of allChannels) {