fix: fallback to referral role fill color when subscription_status is null

When subscription_status is not available (backend not deployed or user
has no subscription), fill color now falls through to referral role
(partner/topReferrer/activeReferrer) before defaulting to campaign/regular.
Increases border size from 0.25 to 0.35 and merges legend sections.
This commit is contained in:
Fringg
2026-03-22 09:32:53 +03:00
parent b18f3fb211
commit 61ca5cc53d
3 changed files with 18 additions and 24 deletions

View File

@@ -154,7 +154,12 @@ function buildFullGraph(graphData: NetworkGraphData): Graph {
});
graphData.users.forEach((user) => {
const fillColor = getNodeFillColor(user.subscription_status, user.campaign_id);
const fillColor = getNodeFillColor(
user.subscription_status,
user.campaign_id,
user.direct_referrals,
user.is_partner,
);
const borderColor = getNodeBorderColor(user.direct_referrals, user.is_partner);
const size = getUserNodeSize(user.direct_referrals);
const pos = positions.get(`user_${user.id}`) ?? {
@@ -176,7 +181,7 @@ function buildFullGraph(graphData: NetworkGraphData): Graph {
campaignId: user.campaign_id,
subscriptionStatus: user.subscription_status,
borderColor: borderColor ?? fillColor,
borderSize: borderColor ? 0.25 : 0,
borderSize: borderColor ? 0.35 : 0,
});
});