mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
fix: referral network graph rendering and layout
- fix top offset breakpoint: sm:top-14 → lg:top-14 to match AppShell header visibility (mobile header is lg:hidden with h-16) - add gravity to FA2 layout to prevent disconnected nodes from flying to extreme positions, making auto-rescale shrink everything to dots - clamp outlier node positions after FA2 finishes (3σ threshold) - add ResizeObserver to sync sigma canvas with container size changes - call sigma.resize() before camera reset after FA2 - increase node sizes: user min 8→12, max 40→50, campaign 18→24 - reduce FA2 duration 5s→3s and slowDown 5→2 for tighter layout
This commit is contained in:
@@ -46,8 +46,8 @@ export function getUserNodeColor(
|
||||
* Size is proportional to direct_referrals, clamped between min and max.
|
||||
*/
|
||||
export function getUserNodeSize(directReferrals: number): number {
|
||||
const MIN_SIZE = 8;
|
||||
const MAX_SIZE = 40;
|
||||
const MIN_SIZE = 12;
|
||||
const MAX_SIZE = 50;
|
||||
if (directReferrals === 0) return MIN_SIZE;
|
||||
return Math.min(MAX_SIZE, MIN_SIZE + Math.sqrt(directReferrals) * 5);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user