Fix author network graph: tune force sim, reduce node count
- Raise co-authorship threshold from 1 to 2 shared drafts (498→156 nodes) - Tune D3 force parameters for large graphs: capped link strength, wider distance, adaptive charge, lower velocity decay - Add initial circular layout to prevent explosion on load - Fix cluster highlighting with fallback name matching and position validation before zoom-to-fit Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -508,18 +508,18 @@ def get_author_network_full(db: Database) -> dict:
|
||||
"org": aff, "draft_count": cnt, "drafts": drafts, "avg_score": avg
|
||||
}
|
||||
|
||||
# Build node set: authors with 2+ drafts OR 1+ co-authorship
|
||||
# Build node set: authors with meaningful collaboration (2+ shared drafts)
|
||||
node_set = set()
|
||||
edges = []
|
||||
for a, b, shared in pairs:
|
||||
if shared >= 1:
|
||||
if shared >= 2:
|
||||
node_set.add(a)
|
||||
node_set.add(b)
|
||||
edges.append({"source": a, "target": b, "weight": shared})
|
||||
|
||||
# Also include authors with 2+ drafts even if no co-authorships
|
||||
# Also include authors with 3+ drafts even if no co-authorships
|
||||
for name, info in author_info.items():
|
||||
if info["draft_count"] >= 2:
|
||||
if info["draft_count"] >= 3:
|
||||
node_set.add(name)
|
||||
|
||||
nodes = []
|
||||
|
||||
Reference in New Issue
Block a user