feat: add partner → campaign edges with distinct color to referral network

This commit is contained in:
Fringg
2026-03-20 01:17:01 +03:00
parent 2b43a30ccc
commit 2adb0047dd
7 changed files with 19 additions and 3 deletions

View File

@@ -53,8 +53,13 @@ function buildFullGraph(graphData: NetworkGraphData): Graph {
const edgeKey = `${edge.source}->${edge.target}`;
if (!graph.hasEdge(edgeKey)) {
graph.addEdgeWithKey(edgeKey, edge.source, edge.target, {
color: edge.type === 'campaign' ? 'rgba(77, 217, 192, 0.06)' : 'rgba(255,255,255,0.03)',
size: 0.3,
color:
edge.type === 'partner_campaign'
? 'rgba(255, 138, 101, 0.5)'
: edge.type === 'campaign'
? 'rgba(77, 217, 192, 0.06)'
: 'rgba(255,255,255,0.03)',
size: edge.type === 'partner_campaign' ? 1.5 : 0.3,
edgeType: edge.type,
});
}

View File

@@ -38,6 +38,13 @@ export function NetworkLegend({ className }: NetworkLegendProps) {
<span className="text-xs text-dark-300">{t(item.labelKey)}</span>
</div>
))}
{/* Partner → Campaign edge */}
<div className="flex items-center gap-2">
<div className="h-0.5 w-4 shrink-0 rounded-full" style={{ backgroundColor: '#ff8a65' }} />
<span className="text-xs text-dark-300">
{t('admin.referralNetwork.legend.partnerCampaignEdge')}
</span>
</div>
{/* Campaign node with gradient to represent varying colors */}
<div className="flex items-center gap-2">
<div className="h-2.5 w-2.5 shrink-0 rounded-full" style={gradientStyle} />