- {obj.data.reactivationCount ?
-
: null
- }
-
- {obj.data.activationCount ?
-
: null
- }
- {(obj.data.latestCommission && obj.data.latestCommission.length) ?
-
: null}
- {obj.data.bondCount ?
-
: null
- }
- {obj.data.unbondCount ?
-
: null
- }
- {obj.data.rewardCount ?
-
: null
- }
- {obj.data.claimCount ?
-
: null
- }
- {obj.data.withdrawStakeCount ?
-
: null
- }
- {obj.data.withdrawFeesCount ?
-
: null
- }
- {obj.data.moveStakeCount ?
-
: null
- }
- {obj.data.winningTicketsReceivedCount ?
-
: null
- }
- {obj.data.winningTicketsRedeemedCount ?
-
: null
- }
+
+
+ {obj.data.reactivationCount ?
+
-
+
+
+
+
: null
+ }
+
+ {obj.data.activationCount ?
+
: null
+ }
+ {(obj.data.latestCommission && obj.data.latestCommission.length) ?
+
: null}
+ {obj.data.bondCount ?
+
: null
+ }
+ {obj.data.unbondCount ?
+
: null
+ }
+ {obj.data.rewardCount ?
+
: null
+ }
+ {obj.data.claimCount ?
+
: null
+ }
+ {obj.data.withdrawStakeCount ?
+
: null
+ }
+ {obj.data.withdrawFeesCount ?
+
: null
+ }
+ {obj.data.moveStakeCount ?
+
: null
+ }
+ {obj.data.winningTicketsReceivedCount ?
+
: null
+ }
+ {obj.data.winningTicketsRedeemedCount ?
+
: null
+ }
+
)
diff --git a/src/components/MonthlyGraphs.js b/src/components/MonthlyGraphs.js
index 430d665..161ec47 100644
--- a/src/components/MonthlyGraphs.js
+++ b/src/components/MonthlyGraphs.js
@@ -53,27 +53,48 @@ const MonthlyGraphs = (obj) => {
// Show all orchs (if latestTotalStake exists) or show only those in winningTicketsReceived
let orchList;
- let ticketList = obj.data.winningTicketsReceived || [];
- let stakeList = obj.data.latestTotalStake || [];
+ if (obj.data.latestTotalStake && obj.data.latestTotalStake.length) {
+ orchList = [...obj.data.latestTotalStake];
+ // Filter out orchestrators who have not earned any fees, to get a more accurate earnings vs stake overview
+ if (obj.showOnlyTranscoders) {
+ if (obj.data.winningTicketsReceived && obj.data.winningTicketsReceived.length) {
+ // For each orchestrator in latestTotalStake, splice it if they are not present in winningTicketsReceived
+ let ticketIdx = obj.data.latestTotalStake.length - 1;
+ while (ticketIdx >= 0) {
+ const thisOrch = obj.data.latestTotalStake[ticketIdx];
+ let found = false;
+ for (const orchWinnings of obj.data.winningTicketsReceived) {
+ if (orchWinnings.address == thisOrch.address) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ orchList.splice(ticketIdx, 1);
+ }
+ ticketIdx--;
+ }
+ }
+ }
+ }
// Pies for stake overview, if have stake data for that month saved
let stakeObj;
let totalStakeSum = 0;
- if (obj.data.latestTotalStake && obj.data.latestTotalStake.length) {
- orchList = [...obj.data.latestTotalStake];
+ if (orchList && orchList.length) {
let pieList = [];
let otherSum = 0;
- let ticketIdx = obj.data.latestTotalStake.length - 1;
+ let ticketIdx = orchList.length - 1;
// Calc total stake at that time
while (ticketIdx >= 0) {
- const thisTicket = obj.data.latestTotalStake[ticketIdx];
+ const thisTicket = orchList[ticketIdx];
ticketIdx -= 1;
totalStakeSum += thisTicket.totalStake;
}
- ticketIdx = obj.data.latestTotalStake.length - 1;
+ ticketIdx = orchList.length - 1;
// Create pie chart
while (ticketIdx >= 0) {
- const thisTicket = obj.data.latestTotalStake[ticketIdx];
+ const thisTicket = orchList[ticketIdx];
ticketIdx -= 1;
if ((thisTicket.totalStake / totalStakeSum) < 0.015) {
otherSum += thisTicket.totalStake;
@@ -143,8 +164,6 @@ const MonthlyGraphs = (obj) => {
labelPlacement="parallel"
/>