()
| 4096 | sourceEdgeCount: map.sourceEdges.length |
| 4097 | }; |
| 4098 | } |
| 4099 | |
| 4100 | function renderWikiGraph() { |
| 4101 | const target = $("wikiGraph"); |
| 4102 | const graph = state.wikiGraph || {}; |
| 4103 | const hasBackendGraph = Boolean(graph.nodes?.length); |
| 4104 | const graphNodes = hasBackendGraph ? graph.nodes : state.wikiNodes.length ? state.wikiNodes : DEMO_MODE ? demoWikiNodes : []; |
| 4105 | const graphEdges = hasBackendGraph ? graph.edges || [] : DEMO_MODE ? demoWikiEdges : []; |
| 4106 | const layout = layoutGraph(graphNodes, graphEdges); |
| 4107 | if (!layout.nodes.length) { |
| 4108 | target.innerHTML = ` |
| 4109 | <div class="wiki-empty-state"> |
| 4110 | <strong>${escapeHtml(ui().wiki.emptyGraphTitle)}</strong> |
| 4111 | <p>${escapeHtml(ui().wiki.emptyGraphBody)}</p> |
| 4112 | </div> |
| 4113 | `; |
| 4114 | return; |
| 4115 | } |
| 4116 | const spread = state.wikiGraphTransform.scale; |
| 4117 | const visualNodes = layout.nodes.map((node) => ({ |
| 4118 | ...node, |
nothing calls this directly
no test coverage detected