Closed benalleng closed 5 months ago
The charts have some legend inconsistencies that I'm not sure how to fix, namely the naming convention as demonstrated below in the three graphs top is local bottom is from prod global analytics
user satistics global analytics
user satistics global analytics
user satistics global analytics
legend inconsistencies
not that every legend needs to be the same as global analytics but I do think that we should try to keep the naming convention similar, like what is "fees" in relation to with user stacking... zaps received (thats probably "tipped"), activity in a territory you own?
Edit: It looks like the "fees" and "spent" keys in question are actually just the total, but as I moved these charts over to the <WhenAreaChart />
I think showing these totals separately is not necessary as the area chart aleady stacks items. As well the backend tracking doesn't seem quite right, not accounting for all the sats i've spent accurately, need to look a little deeper (likely has to do with this summed "fees"/"spent" key)
Here is the current migration for user stats on spending
-- spending
(sum(quantity) FILTER (WHERE type IN ('BOOST', 'TIP', 'FEE', 'STREAM', 'POLL', 'DONT_LIKE_THIS')))::BIGINT as msats_fees,
(sum(quantity) FILTER (WHERE type = 'DONATION'))::BIGINT as msats_donated,
(sum(quantity) FILTER (WHERE type = 'TERRITORY'))::BIGINT as msats_billing,
(sum(quantity) FILTER (WHERE type IN ('BOOST', 'TIP', 'FEE', 'STREAM', 'POLL', 'DONT_LIKE_THIS', 'DONATION', 'TERRITORY')))::BIGINT as msats_spent
We could split the msats_fees
stats up for a little more granular tracking in the spending category if we want
I made some updates to the legend names, you can see them in the screenshot above but here are the changes
tipped => zaps revenue => territories ~fees~ (total)
donated => donations billed => territories ~spent~ (total)
Description
closes #794
supercedes #988
Adds compatibility with the new mobile navigation
Adds styling to the tabs for consistent UI
Alters the legend names and removes some for consistency between the user stats global analytics
stacking and spending charts are area charts meaning a legend key for a total is not necessary as the indivdual metrics are stacked on top of each other summing them together
the items chart uses areas for posts and comments and lines for territories and referrals
<WhenComposedChart data={userStatsActions} areaNames={['posts', 'comments']} areaAxis='left' lineNames={['territories', 'referrals']} lineAxis='right' />
Screenshots
Additional Context
Checklist
[ ] Did you QA this? Could we deploy this straight to production?
[ ] For frontend changes: Tested on mobile?
[ ] Did you introduce any new environment variables? If so, call them out explicitly in the PR description.
Summary by CodeRabbit
New Features
Enhancements
Bug Fixes