MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / layoutGraph

Function layoutGraph

deployments/desktop/static/desktop.js:3640–3702  ·  view source on GitHub ↗
(nodes, edges)

Source from the content-addressed store, hash-verified

3638 const type = graphType(node);
3639 if (type === "method") return { x: 64, y: 42 };
3640 if (type === "paper") return { x: 46, y: 74 };
3641 if (type === "frontier") return { x: 74, y: 30 };
3642 return { x: 34, y: 42 };
3643 }
3644
3645 function graphDegreeMap(nodes, edges) {
3646 const degree = Object.fromEntries(nodes.map((node) => [graphId(node), 0]));
3647 edges.forEach((edge) => {
3648 degree[edge.src_id] = (degree[edge.src_id] || 0) + graphWeight(edge);
3649 degree[edge.dst_id] = (degree[edge.dst_id] || 0) + graphWeight(edge);
3650 });
3651 return degree;
3652 }
3653
3654 function uniqueGraphNodes(nodes) {
3655 const seen = new Set();
3656 return (nodes || []).filter((node) => {
3657 const id = graphId(node);
3658 if (!id || seen.has(id)) return false;
3659 seen.add(id);
3660 return true;
3661 });
3662 }
3663
3664 const keywordStopWords = new Set([
3665 "the", "and", "for", "with", "from", "that", "this", "are", "was", "were", "into", "across", "using", "used",
3666 "based", "paper", "papers", "model", "models", "method", "methods", "task", "tasks", "data", "study",
3667 "analysis", "approach", "experiments", "future", "directions", "summary", "related", "work", "problem",
3668 "abstract", "legacy", "reading", "plan", "tldr", "cs", "cl", "ai", "lg", "ir"
3669 ]);
3670
3671 const phraseAliases = [
3672 { label: "Deep Search Agent", patterns: [/deep search/i, /search agents?/i, /shortcut-resistant search/i] },
3673 { label: "多模态推理", patterns: [/multimodal/i, /multi-modal/i, /long-video understanding/i, /contextual reasoning/i] },
3674 { label: "推理泛化", patterns: [/reasoning generalization/i, /verifiable environments?/i, /recursive composition/i] },
3675 { label: "视觉语言模型", patterns: [/vision-language/i, /visual grounding/i, /visual token/i, /token routing/i] },
3676 { label: "推理效率", patterns: [/inference efficiency/i, /kv-cache/i, /cache compress/i, /token reduction/i] },
3677 { label: "蛋白结构检索", patterns: [/protein/i, /structural motif/i, /protein universe/i] },
3678 { label: "基因编辑", patterns: [/genome engineering/i, /prime editing/i, /monocots/i] },
3679 { label: "强化学习", patterns: [/reinforcement learning/i] },
3680 { label: "开源模型", patterns: [/open-source/i, /closed-source/i] }
3681 ];
3682
3683 const topicPositions = [
3684 { x: 30, y: 36, size: "large" },
3685 { x: 70, y: 36, size: "large" },
3686 { x: 28, y: 58, size: "medium" },
3687 { x: 72, y: 58, size: "medium" }
3688 ];
3689 const methodPositions = [
3690 { x: 43, y: 25, size: "small" },
3691 { x: 57, y: 25, size: "small" },
3692 { x: 84, y: 48, size: "small" }
3693 ];
3694 const paperPositions = [
3695 { x: 22, y: 77, size: "medium" },
3696 { x: 50, y: 82, size: "medium" },
3697 { x: 78, y: 77, size: "medium" }

Callers 1

renderWikiGraphFunction · 0.85

Calls 6

uniqueGraphNodesFunction · 0.85
graphIdFunction · 0.85
graphDegreeMapFunction · 0.85
graphTypeFunction · 0.85
pickWikiFocusNodeIdFunction · 0.85
clampFunction · 0.70

Tested by

no test coverage detected