|
@@ -42,7 +42,7 @@
|
|
|
--font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
|
|
--font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
|
|
|
--font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
|
|
--font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
|
|
|
--sidebar-width: 320px;
|
|
--sidebar-width: 320px;
|
|
|
- --panel-width: 420px;
|
|
|
|
|
|
|
+ --panel-width: 460px;
|
|
|
--header-height: 52px;
|
|
--header-height: 52px;
|
|
|
--radius: 8px;
|
|
--radius: 8px;
|
|
|
--radius-sm: 6px;
|
|
--radius-sm: 6px;
|
|
@@ -991,8 +991,8 @@
|
|
|
'height': 'label',
|
|
'height': 'label',
|
|
|
'padding': '12px',
|
|
'padding': '12px',
|
|
|
'shape': 'data(shape)',
|
|
'shape': 'data(shape)',
|
|
|
- 'text-wrap': 'none',
|
|
|
|
|
- 'text-max-width': '160px',
|
|
|
|
|
|
|
+ 'text-wrap': 'wrap',
|
|
|
|
|
+ 'text-max-width': '180px',
|
|
|
'transition-property': 'background-opacity, border-color, border-opacity, opacity, text-opacity',
|
|
'transition-property': 'background-opacity, border-color, border-opacity, opacity, text-opacity',
|
|
|
'transition-duration': '0.2s',
|
|
'transition-duration': '0.2s',
|
|
|
}
|
|
}
|
|
@@ -1130,16 +1130,24 @@
|
|
|
// ====================================================================
|
|
// ====================================================================
|
|
|
// Graph Operations
|
|
// Graph Operations
|
|
|
// ====================================================================
|
|
// ====================================================================
|
|
|
|
|
+ const kindLabels = {
|
|
|
|
|
+ 'function': 'fn', 'method': 'method', 'class': 'class', 'interface': 'iface',
|
|
|
|
|
+ 'component': 'comp', 'route': 'route', 'enum': 'enum', 'type_alias': 'type',
|
|
|
|
|
+ 'struct': 'struct', 'trait': 'trait', 'variable': 'var', 'constant': 'const',
|
|
|
|
|
+ 'property': 'prop', 'field': 'field', 'file': 'file', 'module': 'mod',
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
function addNodeToGraph(node) {
|
|
function addNodeToGraph(node) {
|
|
|
if (cy.getElementById(node.id).length > 0) return;
|
|
if (cy.getElementById(node.id).length > 0) return;
|
|
|
const color = kindColors[node.kind] || '#8b949e';
|
|
const color = kindColors[node.kind] || '#8b949e';
|
|
|
const shape = kindShapes[node.kind] || 'round-rectangle';
|
|
const shape = kindShapes[node.kind] || 'round-rectangle';
|
|
|
|
|
+ const kindLabel = kindLabels[node.kind] || node.kind;
|
|
|
cy.add({
|
|
cy.add({
|
|
|
group: 'nodes',
|
|
group: 'nodes',
|
|
|
data: {
|
|
data: {
|
|
|
id: node.id,
|
|
id: node.id,
|
|
|
nodeId: node.id,
|
|
nodeId: node.id,
|
|
|
- label: node.name,
|
|
|
|
|
|
|
+ label: `${node.name}\n${kindLabel}`,
|
|
|
color: color,
|
|
color: color,
|
|
|
shape: shape,
|
|
shape: shape,
|
|
|
kind: node.kind,
|
|
kind: node.kind,
|
|
@@ -1541,6 +1549,16 @@
|
|
|
|
|
|
|
|
let html = '';
|
|
let html = '';
|
|
|
|
|
|
|
|
|
|
+ // Quick actions
|
|
|
|
|
+ html += `<div class="detail-section" style="padding:8px 16px;">
|
|
|
|
|
+ <div style="display:flex;gap:6px;flex-wrap:wrap;">
|
|
|
|
|
+ <button class="toolbar-btn" onclick="expandCallees('${escapeAttr(node.id)}')" style="font-size:12px;">Expand Callees →</button>
|
|
|
|
|
+ <button class="toolbar-btn" onclick="expandCallers('${escapeAttr(node.id)}')" style="font-size:12px;">← Expand Callers</button>
|
|
|
|
|
+ <button class="toolbar-btn" onclick="loadCallGraph('${escapeAttr(node.id)}')" style="font-size:12px;">Full Call Graph</button>
|
|
|
|
|
+ <button class="toolbar-btn" onclick="loadImpact('${escapeAttr(node.id)}')" style="font-size:12px;">Impact Analysis</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>`;
|
|
|
|
|
+
|
|
|
// Meta info
|
|
// Meta info
|
|
|
html += `<div class="detail-section">
|
|
html += `<div class="detail-section">
|
|
|
<div class="detail-section-title">Info</div>
|
|
<div class="detail-section-title">Info</div>
|