This page helps diagnose issues with Dagre and Circular layouts in the visualization.
http://localhost:8089 in a new browser tabCopy and paste these commands into the browser console at http://localhost:8089:
// Run this BEFORE switching layouts
console.log('=== INITIAL DATA STATE ===');
console.log('allLinks.length:', allLinks?.length);
console.log('allNodes.length:', allNodes?.length);
console.log('First link:', allLinks?.[0]);
console.log('First link source type:', typeof allLinks?.[0]?.source);
console.log('First link target type:', typeof allLinks?.[0]?.target);
console.log('Current layout:', currentLayout);
console.log('================================');
// Run this AFTER switching to Dagre layout
console.log('=== AFTER DAGRE SWITCH ===');
console.log('Current layout:', currentLayout);
console.log('Cytoscape exists:', !!cy);
console.log('Cytoscape nodes:', cy?.nodes().length);
console.log('Cytoscape edges:', cy?.edges().length);
if (cy && cy.edges().length > 0) {
console.log('First edge data:', cy.edges()[0].data());
} else {
console.log('⚠️ NO EDGES FOUND IN CYTOSCAPE');
}
console.log('First link source after switch:', typeof allLinks?.[0]?.source);
console.log('================================');
// Run this AFTER switching to Circular layout
console.log('=== AFTER CIRCULAR SWITCH ===');
console.log('Current layout:', currentLayout);
console.log('Cytoscape exists:', !!cy);
console.log('Cytoscape nodes:', cy?.nodes().length);
console.log('Cytoscape edges:', cy?.edges().length);
if (cy && cy.edges().length > 0) {
console.log('First edge data:', cy.edges()[0].data());
} else {
console.log('⚠️ NO EDGES FOUND IN CYTOSCAPE');
}
console.log('================================');
// Check what links are being passed to Cytoscape
console.log('=== VISIBLE LINKS CHECK ===');
const visibleNodesList = allNodes.filter(n => visibleNodes.has(n.id));
const filteredLinks = getFilteredLinks();
const visibleLinks = filteredLinks.filter(l =>
visibleNodes.has(l.source.id || l.source) &&
visibleNodes.has(l.target.id || l.target)
);
console.log('Visible nodes:', visibleNodesList.length);
console.log('Filtered links:', filteredLinks.length);
console.log('Visible links:', visibleLinks.length);
if (visibleLinks.length > 0) {
console.log('First visible link:', visibleLinks[0]);
console.log('Source type:', typeof visibleLinks[0].source);
console.log('Target type:', typeof visibleLinks[0].target);
} else {
console.log('⚠️ NO VISIBLE LINKS');
}
console.log('================================');
// Monitor for errors during layout switch
console.clear();
console.log('=== SWITCHING TO DAGRE - WATCH FOR ERRORS ===');
document.getElementById('layoutSelector').value = 'dagre';
document.getElementById('layoutSelector').dispatchEvent(new Event('change'));
// Check if Dagre extension is loaded
console.log('=== CYTOSCAPE EXTENSIONS ===');
console.log('Cytoscape version:', cytoscape.version);
console.log('Dagre available:', typeof dagre !== 'undefined');
console.log('Cytoscape extensions:', Object.keys(cytoscape.extensions || {}));
console.log('================================');
allLinks.length: 150
allNodes.length: 80
First link source type: "string" (before Force layout) OR "object" (after Force layout)
Cytoscape nodes: 80
Cytoscape edges: 150
First edge data: {source: "some-id", target: "another-id", ...}
Cytoscape edges: 0 ← NO EDGES! ⚠️ NO EDGES FOUND IN CYTOSCAPE OR Error: "Cannot create edge with source [object Object]"
Error: Layout 'dagre' not found OR Dagre available: false
Circular layout may show nodes but layout options like 'rankDir' don't apply to circle layout. This won't cause errors but may result in unexpected layout.
Follow this exact sequence and note results:
http://localhost:8089 in browserAfter running tests, paste console output here and save/screenshot: