mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
fix: referral network rendering — portal fix and visual tuning
Portal to document.body escapes main's contain:content which broke fixed positioning (container had height:0 and was clipped to main). Visual fixes for 662+ node graphs: - labels only on large nodes (threshold 6→14, density 0.5→0.12) - leaf nodes 5px, referrers 10px, campaigns 16px - edge opacity reduced to prevent white starburst - default edge color opacity lowered
This commit is contained in:
@@ -21,7 +21,7 @@ function buildFullGraph(graphData: NetworkGraphData): Graph {
|
||||
label: campaign.name,
|
||||
x: Math.random() * 100,
|
||||
y: Math.random() * 100,
|
||||
size: 24,
|
||||
size: 16,
|
||||
color: getCampaignColor(index),
|
||||
type: 'circle',
|
||||
nodeType: 'campaign',
|
||||
@@ -53,8 +53,8 @@ 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.12)' : 'rgba(255,255,255,0.06)',
|
||||
size: 0.5,
|
||||
color: edge.type === 'campaign' ? 'rgba(77, 217, 192, 0.06)' : 'rgba(255,255,255,0.03)',
|
||||
size: 0.3,
|
||||
edgeType: edge.type,
|
||||
});
|
||||
}
|
||||
@@ -183,14 +183,14 @@ export function NetworkGraph({ data, className }: NetworkGraphProps) {
|
||||
|
||||
const sigma = new Sigma(graph, container, {
|
||||
renderEdgeLabels: false,
|
||||
labelDensity: 0.5,
|
||||
labelRenderedSizeThreshold: 6,
|
||||
labelDensity: 0.12,
|
||||
labelRenderedSizeThreshold: 14,
|
||||
zIndex: true,
|
||||
defaultEdgeColor: '#ffffff10',
|
||||
defaultEdgeColor: '#ffffff06',
|
||||
defaultNodeColor: '#6b7280',
|
||||
labelColor: { color: '#e8e6f0' },
|
||||
labelFont: 'Inter, system-ui, sans-serif',
|
||||
labelSize: 12,
|
||||
labelSize: 11,
|
||||
stagePadding: 40,
|
||||
nodeReducer: (node, attrs) => {
|
||||
const res = { ...attrs };
|
||||
|
||||
Reference in New Issue
Block a user