@opensip-cli/dashboard 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/__tests__/catalog-provenance.test.js +6 -24
- package/dist/__tests__/catalog-provenance.test.js.map +1 -1
- package/dist/__tests__/coupling-attribution.test.js +10 -14
- package/dist/__tests__/coupling-attribution.test.js.map +1 -1
- package/dist/__tests__/dashboard-bundle-weight.test.d.ts +9 -2
- package/dist/__tests__/dashboard-bundle-weight.test.d.ts.map +1 -1
- package/dist/__tests__/dashboard-bundle-weight.test.js +19 -12
- package/dist/__tests__/dashboard-bundle-weight.test.js.map +1 -1
- package/dist/__tests__/dashboard-cell-containment.test.js +5 -2
- package/dist/__tests__/dashboard-cell-containment.test.js.map +1 -1
- package/dist/__tests__/dashboard-editor-link.test.d.ts +9 -0
- package/dist/__tests__/dashboard-editor-link.test.d.ts.map +1 -1
- package/dist/__tests__/dashboard-editor-link.test.js +72 -21
- package/dist/__tests__/dashboard-editor-link.test.js.map +1 -1
- package/dist/__tests__/dashboard-filters.test.js +6 -14
- package/dist/__tests__/dashboard-filters.test.js.map +1 -1
- package/dist/__tests__/dashboard-function-card-singleton.test.js +15 -27
- package/dist/__tests__/dashboard-function-card-singleton.test.js.map +1 -1
- package/dist/__tests__/dashboard-function-card.test.d.ts +4 -4
- package/dist/__tests__/dashboard-function-card.test.js +23 -44
- package/dist/__tests__/dashboard-function-card.test.js.map +1 -1
- package/dist/__tests__/dashboard-function-row.test.js +6 -16
- package/dist/__tests__/dashboard-function-row.test.js.map +1 -1
- package/dist/__tests__/dashboard-generator-graph-catalog.test.js +3 -1
- package/dist/__tests__/dashboard-generator-graph-catalog.test.js.map +1 -1
- package/dist/__tests__/dashboard-graph-offline.integration.test.js +3 -1
- package/dist/__tests__/dashboard-graph-offline.integration.test.js.map +1 -1
- package/dist/__tests__/dashboard-help-drawer.test.js +11 -17
- package/dist/__tests__/dashboard-help-drawer.test.js.map +1 -1
- package/dist/__tests__/dashboard-indexes.test.d.ts +6 -4
- package/dist/__tests__/dashboard-indexes.test.d.ts.map +1 -1
- package/dist/__tests__/dashboard-indexes.test.js +10 -7
- package/dist/__tests__/dashboard-indexes.test.js.map +1 -1
- package/dist/__tests__/dashboard-path-utils.test.d.ts +7 -0
- package/dist/__tests__/dashboard-path-utils.test.d.ts.map +1 -1
- package/dist/__tests__/dashboard-path-utils.test.js +11 -3
- package/dist/__tests__/dashboard-path-utils.test.js.map +1 -1
- package/dist/__tests__/dashboard-search.test.d.ts +5 -0
- package/dist/__tests__/dashboard-search.test.d.ts.map +1 -1
- package/dist/__tests__/dashboard-search.test.js +9 -3
- package/dist/__tests__/dashboard-search.test.js.map +1 -1
- package/dist/__tests__/dashboard-sessions.test.js +13 -11
- package/dist/__tests__/dashboard-sessions.test.js.map +1 -1
- package/dist/__tests__/dashboard-trace.test.d.ts +11 -0
- package/dist/__tests__/dashboard-trace.test.d.ts.map +1 -1
- package/dist/__tests__/dashboard-trace.test.js +55 -32
- package/dist/__tests__/dashboard-trace.test.js.map +1 -1
- package/dist/__tests__/dashboard-view-conformance.test.js +9 -15
- package/dist/__tests__/dashboard-view-conformance.test.js.map +1 -1
- package/dist/__tests__/dashboard-view-coupling.test.js +14 -35
- package/dist/__tests__/dashboard-view-coupling.test.js.map +1 -1
- package/dist/__tests__/dashboard-view-distribution.test.js +14 -37
- package/dist/__tests__/dashboard-view-distribution.test.js.map +1 -1
- package/dist/__tests__/dashboard-view-graph.test.js +29 -62
- package/dist/__tests__/dashboard-view-graph.test.js.map +1 -1
- package/dist/__tests__/dashboard-view-template.test.d.ts +13 -14
- package/dist/__tests__/dashboard-view-template.test.d.ts.map +1 -1
- package/dist/__tests__/dashboard-view-template.test.js +165 -112
- package/dist/__tests__/dashboard-view-template.test.js.map +1 -1
- package/dist/__tests__/graph-tab.test.js +4 -2
- package/dist/__tests__/graph-tab.test.js.map +1 -1
- package/dist/client-bundle.generated.d.ts +2 -0
- package/dist/client-bundle.generated.d.ts.map +1 -0
- package/dist/client-bundle.generated.js +3 -0
- package/dist/client-bundle.generated.js.map +1 -0
- package/dist/code-paths/__tests__/views-registry.test.d.ts +13 -8
- package/dist/code-paths/__tests__/views-registry.test.d.ts.map +1 -1
- package/dist/code-paths/__tests__/views-registry.test.js +27 -25
- package/dist/code-paths/__tests__/views-registry.test.js.map +1 -1
- package/dist/code-paths.d.ts +21 -62
- package/dist/code-paths.d.ts.map +1 -1
- package/dist/code-paths.js +24 -349
- package/dist/code-paths.js.map +1 -1
- package/dist/generator.d.ts +2 -0
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js +28 -17
- package/dist/generator.js.map +1 -1
- package/package.json +5 -4
- package/dist/checks.d.ts +0 -7
- package/dist/checks.d.ts.map +0 -1
- package/dist/checks.js +0 -283
- package/dist/checks.js.map +0 -1
- package/dist/code-paths/catalog-provenance.d.ts +0 -22
- package/dist/code-paths/catalog-provenance.d.ts.map +0 -1
- package/dist/code-paths/catalog-provenance.js +0 -108
- package/dist/code-paths/catalog-provenance.js.map +0 -1
- package/dist/code-paths/catalog-recipes-tables.d.ts +0 -11
- package/dist/code-paths/catalog-recipes-tables.d.ts.map +0 -1
- package/dist/code-paths/catalog-recipes-tables.js +0 -86
- package/dist/code-paths/catalog-recipes-tables.js.map +0 -1
- package/dist/code-paths/editor-link.d.ts +0 -10
- package/dist/code-paths/editor-link.d.ts.map +0 -1
- package/dist/code-paths/editor-link.js +0 -20
- package/dist/code-paths/editor-link.js.map +0 -1
- package/dist/code-paths/filters.d.ts +0 -19
- package/dist/code-paths/filters.d.ts.map +0 -1
- package/dist/code-paths/filters.js +0 -47
- package/dist/code-paths/filters.js.map +0 -1
- package/dist/code-paths/function-card.d.ts +0 -15
- package/dist/code-paths/function-card.d.ts.map +0 -1
- package/dist/code-paths/function-card.js +0 -169
- package/dist/code-paths/function-card.js.map +0 -1
- package/dist/code-paths/function-row.d.ts +0 -17
- package/dist/code-paths/function-row.d.ts.map +0 -1
- package/dist/code-paths/function-row.js +0 -77
- package/dist/code-paths/function-row.js.map +0 -1
- package/dist/code-paths/graph-controls.d.ts +0 -27
- package/dist/code-paths/graph-controls.d.ts.map +0 -1
- package/dist/code-paths/graph-controls.js +0 -257
- package/dist/code-paths/graph-controls.js.map +0 -1
- package/dist/code-paths/graph-stylesheet.d.ts +0 -22
- package/dist/code-paths/graph-stylesheet.d.ts.map +0 -1
- package/dist/code-paths/graph-stylesheet.js +0 -121
- package/dist/code-paths/graph-stylesheet.js.map +0 -1
- package/dist/code-paths/help-drawer.d.ts +0 -18
- package/dist/code-paths/help-drawer.d.ts.map +0 -1
- package/dist/code-paths/help-drawer.js +0 -54
- package/dist/code-paths/help-drawer.js.map +0 -1
- package/dist/code-paths/indexes.d.ts +0 -28
- package/dist/code-paths/indexes.d.ts.map +0 -1
- package/dist/code-paths/indexes.js +0 -97
- package/dist/code-paths/indexes.js.map +0 -1
- package/dist/code-paths/path-utils.d.ts +0 -15
- package/dist/code-paths/path-utils.d.ts.map +0 -1
- package/dist/code-paths/path-utils.js +0 -47
- package/dist/code-paths/path-utils.js.map +0 -1
- package/dist/code-paths/search.d.ts +0 -14
- package/dist/code-paths/search.d.ts.map +0 -1
- package/dist/code-paths/search.js +0 -54
- package/dist/code-paths/search.js.map +0 -1
- package/dist/code-paths/trace.d.ts +0 -11
- package/dist/code-paths/trace.d.ts.map +0 -1
- package/dist/code-paths/trace.js +0 -60
- package/dist/code-paths/trace.js.map +0 -1
- package/dist/code-paths/view-coupling.d.ts +0 -22
- package/dist/code-paths/view-coupling.d.ts.map +0 -1
- package/dist/code-paths/view-coupling.js +0 -218
- package/dist/code-paths/view-coupling.js.map +0 -1
- package/dist/code-paths/view-distribution.d.ts +0 -20
- package/dist/code-paths/view-distribution.d.ts.map +0 -1
- package/dist/code-paths/view-distribution.js +0 -82
- package/dist/code-paths/view-distribution.js.map +0 -1
- package/dist/code-paths/view-graph.d.ts +0 -35
- package/dist/code-paths/view-graph.d.ts.map +0 -1
- package/dist/code-paths/view-graph.js +0 -379
- package/dist/code-paths/view-graph.js.map +0 -1
- package/dist/code-paths/view-template.d.ts +0 -154
- package/dist/code-paths/view-template.d.ts.map +0 -1
- package/dist/code-paths/view-template.js +0 -218
- package/dist/code-paths/view-template.js.map +0 -1
- package/dist/code-paths/views-registry.d.ts +0 -13
- package/dist/code-paths/views-registry.d.ts.map +0 -1
- package/dist/code-paths/views-registry.js +0 -53
- package/dist/code-paths/views-registry.js.map +0 -1
- package/dist/overview.d.ts +0 -13
- package/dist/overview.d.ts.map +0 -1
- package/dist/overview.js +0 -91
- package/dist/overview.js.map +0 -1
- package/dist/recipes.d.ts +0 -6
- package/dist/recipes.d.ts.map +0 -1
- package/dist/recipes.js +0 -68
- package/dist/recipes.js.map +0 -1
- package/dist/sessions.d.ts +0 -6
- package/dist/sessions.d.ts.map +0 -1
- package/dist/sessions.js +0 -288
- package/dist/sessions.js.map +0 -1
- package/dist/shared/el.d.ts +0 -13
- package/dist/shared/el.d.ts.map +0 -1
- package/dist/shared/el.js +0 -27
- package/dist/shared/el.js.map +0 -1
- package/dist/shared/pagination.d.ts +0 -15
- package/dist/shared/pagination.d.ts.map +0 -1
- package/dist/shared/pagination.js +0 -113
- package/dist/shared/pagination.js.map +0 -1
- package/dist/shared/sortable.d.ts +0 -14
- package/dist/shared/sortable.d.ts.map +0 -1
- package/dist/shared/sortable.js +0 -101
- package/dist/shared/sortable.js.map +0 -1
- package/dist/shared/tab-activators.d.ts +0 -16
- package/dist/shared/tab-activators.d.ts.map +0 -1
- package/dist/shared/tab-activators.js +0 -33
- package/dist/shared/tab-activators.js.map +0 -1
- package/dist/shared/tab-bar.d.ts +0 -8
- package/dist/shared/tab-bar.d.ts.map +0 -1
- package/dist/shared/tab-bar.js +0 -20
- package/dist/shared/tab-bar.js.map +0 -1
- package/dist/shared.d.ts +0 -26
- package/dist/shared.d.ts.map +0 -1
- package/dist/shared.js +0 -39
- package/dist/shared.js.map +0 -1
- package/dist/subtab-bar.d.ts +0 -23
- package/dist/subtab-bar.d.ts.map +0 -1
- package/dist/subtab-bar.js +0 -77
- package/dist/subtab-bar.js.map +0 -1
- package/dist/tool-tabs.d.ts +0 -12
- package/dist/tool-tabs.d.ts.map +0 -1
- package/dist/tool-tabs.js +0 -80
- package/dist/tool-tabs.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-card.d.ts","sourceRoot":"","sources":["../../src/code-paths/function-card.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,wBAAgB,uBAAuB,IAAI,MAAM,CA0JhD"}
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Universal Function Card overlay — opened by every view's row click.
|
|
3
|
-
*
|
|
4
|
-
* `openFunctionCard(bodyHash)` looks up the occurrence in
|
|
5
|
-
* `graphIndexes.byBodyHash`, renders a card with name + location +
|
|
6
|
-
* meta + callers + callees + action buttons, and appends a single
|
|
7
|
-
* `.function-card-overlay` element to <body>. Re-opening swaps the
|
|
8
|
-
* content of the same overlay (singleton invariant — §10.2).
|
|
9
|
-
*
|
|
10
|
-
* Closes on Escape key (panel orchestrator), close-button click, and click on
|
|
11
|
-
* the overlay backdrop. "Trace from entry" renders the shortest indexed path
|
|
12
|
-
* from an inferred entry point when one exists.
|
|
13
|
-
*/
|
|
14
|
-
export function dashboardFunctionCardJs() {
|
|
15
|
-
return String.raw `
|
|
16
|
-
function openFunctionCard(bodyHash) {
|
|
17
|
-
if (!bodyHash) return;
|
|
18
|
-
const occ = graphIndexes.byBodyHash.get(bodyHash);
|
|
19
|
-
if (!occ) return;
|
|
20
|
-
|
|
21
|
-
// Singleton: reuse the existing overlay if it's open.
|
|
22
|
-
let overlay = document.querySelector('.function-card-overlay');
|
|
23
|
-
if (!overlay) {
|
|
24
|
-
overlay = el('div', { class: 'function-card-overlay' });
|
|
25
|
-
overlay.addEventListener('click', e => {
|
|
26
|
-
if (e.target === overlay) closeFunctionCard();
|
|
27
|
-
});
|
|
28
|
-
document.body.appendChild(overlay);
|
|
29
|
-
}
|
|
30
|
-
while (overlay.firstChild) overlay.removeChild(overlay.firstChild);
|
|
31
|
-
|
|
32
|
-
const card = el('div', { class: 'function-card' });
|
|
33
|
-
overlay.appendChild(card);
|
|
34
|
-
|
|
35
|
-
const closeBtn = el('button', { class: 'fc-close', text: '×', onclick: closeFunctionCard });
|
|
36
|
-
card.appendChild(closeBtn);
|
|
37
|
-
|
|
38
|
-
card.appendChild(el('h3', { text: displayName(occ.simpleName || '<anonymous>') }));
|
|
39
|
-
card.appendChild(el('div', { class: 'fc-loc', text: occ.filePath + ':' + occ.line }));
|
|
40
|
-
|
|
41
|
-
const paramText = (occ.params || []).map(p => (p.rest ? '...' : '') + p.name + (p.optional ? '?' : '')).join(', ');
|
|
42
|
-
const metaText = 'Body: ' + Math.max(0, (occ.endLine || occ.line) - occ.line + 1) + ' lines · '
|
|
43
|
-
+ (occ.kind || 'function') + ' · '
|
|
44
|
-
+ (occ.visibility || 'module-local')
|
|
45
|
-
+ (paramText ? ' · params: (' + paramText + ')' : '')
|
|
46
|
-
+ (occ.returnType ? ' · returns: ' + occ.returnType : '');
|
|
47
|
-
card.appendChild(el('div', { class: 'fc-meta', text: metaText }));
|
|
48
|
-
|
|
49
|
-
// Callers section, grouped by package of caller.
|
|
50
|
-
const callerHashes = graphIndexes.callers.get(occ.bodyHash) || [];
|
|
51
|
-
const callerSection = el('div', { class: 'fc-section' });
|
|
52
|
-
callerSection.appendChild(el('h4', { text: 'Callers (' + callerHashes.length + ')' }));
|
|
53
|
-
if (callerHashes.length === 0) {
|
|
54
|
-
callerSection.appendChild(el('div', { class: 'empty', text: 'No callers in catalog.' }));
|
|
55
|
-
} else {
|
|
56
|
-
const list = el('ul', { class: 'fc-list' });
|
|
57
|
-
const grouped = new Map();
|
|
58
|
-
for (const h of callerHashes) {
|
|
59
|
-
const c = graphIndexes.byBodyHash.get(h);
|
|
60
|
-
if (!c) continue;
|
|
61
|
-
const pkg = pkgOf(c);
|
|
62
|
-
let bucket = grouped.get(pkg);
|
|
63
|
-
if (!bucket) { bucket = []; grouped.set(pkg, bucket); }
|
|
64
|
-
bucket.push(c);
|
|
65
|
-
}
|
|
66
|
-
const pkgNames = Array.from(grouped.keys()).sort();
|
|
67
|
-
for (const pkg of pkgNames) {
|
|
68
|
-
const groupHeader = el('li', { class: 'external', text: pkg + ' (' + grouped.get(pkg).length + ')' });
|
|
69
|
-
list.appendChild(groupHeader);
|
|
70
|
-
for (const c of grouped.get(pkg)) {
|
|
71
|
-
const item = el('li', {
|
|
72
|
-
'data-body-hash': c.bodyHash,
|
|
73
|
-
text: displayName(c.simpleName) + ' — ' + c.filePath + ':' + c.line,
|
|
74
|
-
});
|
|
75
|
-
item.addEventListener('click', () => openFunctionCard(c.bodyHash));
|
|
76
|
-
list.appendChild(item);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
callerSection.appendChild(list);
|
|
80
|
-
}
|
|
81
|
-
card.appendChild(callerSection);
|
|
82
|
-
|
|
83
|
-
// Callees section.
|
|
84
|
-
const calleeHashes = graphIndexes.callees.get(occ.bodyHash) || [];
|
|
85
|
-
const externalCalls = (occ.calls || []).reduce((n, e) => {
|
|
86
|
-
let c = 0;
|
|
87
|
-
for (const t of (e.to || [])) if (!graphIndexes.byBodyHash.has(t)) c++;
|
|
88
|
-
return n + c + ((e.to || []).length === 0 ? 1 : 0);
|
|
89
|
-
}, 0);
|
|
90
|
-
const calleeSection = el('div', { class: 'fc-section' });
|
|
91
|
-
calleeSection.appendChild(el('h4', { text: 'Callees (' + calleeHashes.length + ' resolved' + (externalCalls > 0 ? ', ' + externalCalls + ' external' : '') + ')' }));
|
|
92
|
-
if (calleeHashes.length === 0 && externalCalls === 0) {
|
|
93
|
-
calleeSection.appendChild(el('div', { class: 'empty', text: 'No callees.' }));
|
|
94
|
-
} else {
|
|
95
|
-
const list = el('ul', { class: 'fc-list' });
|
|
96
|
-
for (const h of calleeHashes) {
|
|
97
|
-
const c = graphIndexes.byBodyHash.get(h);
|
|
98
|
-
if (!c) continue;
|
|
99
|
-
const item = el('li', { 'data-body-hash': c.bodyHash, text: displayName(c.simpleName) + ' — ' + c.filePath + ':' + c.line });
|
|
100
|
-
item.addEventListener('click', () => openFunctionCard(c.bodyHash));
|
|
101
|
-
list.appendChild(item);
|
|
102
|
-
}
|
|
103
|
-
if (externalCalls > 0) {
|
|
104
|
-
list.appendChild(el('li', { class: 'external', text: externalCalls + ' external or unresolved call(s)' }));
|
|
105
|
-
}
|
|
106
|
-
calleeSection.appendChild(list);
|
|
107
|
-
}
|
|
108
|
-
card.appendChild(calleeSection);
|
|
109
|
-
|
|
110
|
-
// Action buttons.
|
|
111
|
-
const actions = el('div', { class: 'fc-actions' });
|
|
112
|
-
const editorUrl = editorLinkUrl(occ.filePath, occ.line);
|
|
113
|
-
if (editorUrl) {
|
|
114
|
-
const a = el('a', { class: 'fc-action', href: editorUrl, text: 'Open in editor' });
|
|
115
|
-
actions.appendChild(a);
|
|
116
|
-
} else {
|
|
117
|
-
const copyBtn = el('button', {
|
|
118
|
-
class: 'fc-action',
|
|
119
|
-
text: 'Copy path',
|
|
120
|
-
onclick: () => {
|
|
121
|
-
if (navigator && navigator.clipboard) navigator.clipboard.writeText(occ.filePath + ':' + occ.line);
|
|
122
|
-
},
|
|
123
|
-
});
|
|
124
|
-
actions.appendChild(copyBtn);
|
|
125
|
-
}
|
|
126
|
-
const traceBtn = el('button', {
|
|
127
|
-
class: 'fc-action',
|
|
128
|
-
text: 'Trace from entry',
|
|
129
|
-
onclick: () => {
|
|
130
|
-
const path = traceFromEntry(occ.bodyHash, graphCatalog, graphIndexes);
|
|
131
|
-
renderTraceInCard(card, path);
|
|
132
|
-
},
|
|
133
|
-
});
|
|
134
|
-
actions.appendChild(traceBtn);
|
|
135
|
-
card.appendChild(actions);
|
|
136
|
-
|
|
137
|
-
// Move keyboard focus to the close button (accessibility).
|
|
138
|
-
closeBtn.focus();
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function renderTraceInCard(card, path) {
|
|
142
|
-
// Replace the body of the card with the rendered trace path.
|
|
143
|
-
const old = card.querySelector('.fc-trace-result');
|
|
144
|
-
if (old) old.parentNode.removeChild(old);
|
|
145
|
-
const section = el('div', { class: 'fc-section fc-trace-result' });
|
|
146
|
-
section.appendChild(el('h4', { text: 'Trace from entry point' }));
|
|
147
|
-
if (!path || path.length === 0) {
|
|
148
|
-
section.appendChild(el('div', { class: 'empty', text: 'No path from any entry point.' }));
|
|
149
|
-
} else {
|
|
150
|
-
const list = el('ol', { class: 'fc-list' });
|
|
151
|
-
for (const h of path) {
|
|
152
|
-
const occ = graphIndexes.byBodyHash.get(h);
|
|
153
|
-
if (!occ) continue;
|
|
154
|
-
const item = el('li', { 'data-body-hash': occ.bodyHash, text: displayName(occ.simpleName) + ' — ' + occ.filePath + ':' + occ.line });
|
|
155
|
-
item.addEventListener('click', () => openFunctionCard(occ.bodyHash));
|
|
156
|
-
list.appendChild(item);
|
|
157
|
-
}
|
|
158
|
-
section.appendChild(list);
|
|
159
|
-
}
|
|
160
|
-
card.appendChild(section);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function closeFunctionCard() {
|
|
164
|
-
const overlay = document.querySelector('.function-card-overlay');
|
|
165
|
-
if (overlay && overlay.parentNode) overlay.parentNode.removeChild(overlay);
|
|
166
|
-
}
|
|
167
|
-
`;
|
|
168
|
-
}
|
|
169
|
-
//# sourceMappingURL=function-card.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-card.js","sourceRoot":"","sources":["../../src/code-paths/function-card.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,UAAU,uBAAuB;IACrC,OAAO,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwJlB,CAAC;AACF,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reusable simple-table renderer for the Hot/Big/Wide/Untested/Search
|
|
3
|
-
* views.
|
|
4
|
-
*
|
|
5
|
-
* Wraps the rendered table in the same .section + .card shell used by
|
|
6
|
-
* fit/sim's renderSessionTable so all dashboard tables share one shape:
|
|
7
|
-
* a section heading, a card-bordered sortable table, and a pagination
|
|
8
|
-
* footer wired through paginateTable (defined in shared.ts).
|
|
9
|
-
*
|
|
10
|
-
* Each caller passes its own `columns` array, a `heading` string, and
|
|
11
|
-
* an optional `viewId` (used to attach the help-drawer info icon to
|
|
12
|
-
* the heading). The helper handles header, body, click delegation
|
|
13
|
-
* via data-body-hash, sortable activation, and pagination at 10
|
|
14
|
-
* rows/page.
|
|
15
|
-
*/
|
|
16
|
-
export declare function dashboardFunctionRowJs(): string;
|
|
17
|
-
//# sourceMappingURL=function-row.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-row.d.ts","sourceRoot":"","sources":["../../src/code-paths/function-row.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,sBAAsB,IAAI,MAAM,CA4D/C"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reusable simple-table renderer for the Hot/Big/Wide/Untested/Search
|
|
3
|
-
* views.
|
|
4
|
-
*
|
|
5
|
-
* Wraps the rendered table in the same .section + .card shell used by
|
|
6
|
-
* fit/sim's renderSessionTable so all dashboard tables share one shape:
|
|
7
|
-
* a section heading, a card-bordered sortable table, and a pagination
|
|
8
|
-
* footer wired through paginateTable (defined in shared.ts).
|
|
9
|
-
*
|
|
10
|
-
* Each caller passes its own `columns` array, a `heading` string, and
|
|
11
|
-
* an optional `viewId` (used to attach the help-drawer info icon to
|
|
12
|
-
* the heading). The helper handles header, body, click delegation
|
|
13
|
-
* via data-body-hash, sortable activation, and pagination at 10
|
|
14
|
-
* rows/page.
|
|
15
|
-
*/
|
|
16
|
-
export function dashboardFunctionRowJs() {
|
|
17
|
-
return String.raw `
|
|
18
|
-
function makeSectionHeading(text, viewId) {
|
|
19
|
-
// Heading + optional ⓘ button that opens the help drawer for this
|
|
20
|
-
// view. SCCs and Coupling use the same shape inline.
|
|
21
|
-
const h3 = el('h3');
|
|
22
|
-
h3.appendChild(document.createTextNode(text));
|
|
23
|
-
if (viewId && typeof openHelpDrawer === 'function') {
|
|
24
|
-
const info = el('button', {
|
|
25
|
-
class: 'section-info',
|
|
26
|
-
'aria-label': 'About this view',
|
|
27
|
-
title: 'About this view',
|
|
28
|
-
text: 'i',
|
|
29
|
-
});
|
|
30
|
-
info.addEventListener('click', e => {
|
|
31
|
-
e.stopPropagation();
|
|
32
|
-
openHelpDrawer(viewId);
|
|
33
|
-
});
|
|
34
|
-
h3.appendChild(info);
|
|
35
|
-
}
|
|
36
|
-
return h3;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function renderFunctionRows(container, occurrences, columns, heading, viewId, skipHeading) {
|
|
40
|
-
while (container.firstChild) container.removeChild(container.firstChild);
|
|
41
|
-
if (!occurrences || occurrences.length === 0) {
|
|
42
|
-
container.appendChild(el('div', { class: 'empty', text: 'No functions to show.' }));
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const headingText = (heading || 'Results') + ' (' + occurrences.length + ')';
|
|
46
|
-
const section = el('div', { class: 'section' });
|
|
47
|
-
// skipHeading lets a caller render the section heading itself (e.g. ABOVE its
|
|
48
|
-
// own controls row) rather than at the top of the rows host.
|
|
49
|
-
if (!skipHeading) section.appendChild(makeSectionHeading(headingText, viewId));
|
|
50
|
-
const card = el('div', { class: 'card' });
|
|
51
|
-
const table = el('table', { class: 'data-table sortable' });
|
|
52
|
-
const thead = el('thead');
|
|
53
|
-
const headRow = el('tr');
|
|
54
|
-
for (const col of columns) headRow.appendChild(el('th', { text: col.label }));
|
|
55
|
-
thead.appendChild(headRow);
|
|
56
|
-
table.appendChild(thead);
|
|
57
|
-
const tbody = el('tbody');
|
|
58
|
-
for (const occ of occurrences) {
|
|
59
|
-
const tr = el('tr', { class: 'clickable', 'data-body-hash': occ.bodyHash });
|
|
60
|
-
for (const col of columns) {
|
|
61
|
-
const v = col.value(occ);
|
|
62
|
-
tr.appendChild(el('td', { text: v == null ? '' : String(v) }));
|
|
63
|
-
}
|
|
64
|
-
tbody.appendChild(tr);
|
|
65
|
-
}
|
|
66
|
-
table.appendChild(tbody);
|
|
67
|
-
const pag = el('div', { class: 'pagination' });
|
|
68
|
-
card.appendChild(table);
|
|
69
|
-
card.appendChild(pag);
|
|
70
|
-
section.appendChild(card);
|
|
71
|
-
container.appendChild(section);
|
|
72
|
-
if (typeof paginateTable === 'function') paginateTable(tbody, pag, 10);
|
|
73
|
-
if (typeof makeSortable === 'function') makeSortable(table);
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=function-row.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-row.js","sourceRoot":"","sources":["../../src/code-paths/function-row.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,UAAU,sBAAsB;IACpC,OAAO,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DlB,CAAC;AACF,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Visualization control toolbar + function-level projector.
|
|
3
|
-
*
|
|
4
|
-
* A render helper (registers no view), extracted from `view-graph.ts` to keep
|
|
5
|
-
* that emitter under the file-length budget — and, like `graph-stylesheet.ts`,
|
|
6
|
-
* deliberately named out of the `view-*` namespace so it stays clear of the
|
|
7
|
-
* views-disjoint architecture rule. Emits two browser functions plus a tiny
|
|
8
|
-
* helper as a JS string; the main emitter interpolates it into its `<script>`
|
|
9
|
-
* body, so they share one runtime scope with the view's state vars
|
|
10
|
-
* (`gvLevel`, `gvSelectedPackage`, …) and `gvRenderGraph`.
|
|
11
|
-
*
|
|
12
|
-
* - `gvRenderControls(host, catalog, indexes)` — the self-contained Level /
|
|
13
|
-
* Scope / Package / Kind / Edges control bar. Package + Kind are disabled at
|
|
14
|
-
* package level (they only apply at function level). Every change re-renders
|
|
15
|
-
* the graph in place via `gvRenderGraph`.
|
|
16
|
-
* - `gvBuildFunctionElements(indexes, pkg, includeTests, kinds, crossPackage)`
|
|
17
|
-
* — projects ONE package's function call graph client-side from the catalog
|
|
18
|
-
* indexes (the package→package view-model blob can't express it).
|
|
19
|
-
* - `gvAddOptions(sel, pairs, current)` — small `<select>` option builder.
|
|
20
|
-
*
|
|
21
|
-
* Free identifiers (supplied by earlier prelude emitters / the host template):
|
|
22
|
-
* `el`, `pkgOf`, `displayName`, `resolveCalleeOcc`, `packagesInCatalog`,
|
|
23
|
-
* `KIND_LIST`, `gvRenderGraph`, `GV_LAYOUTS`, `gvRunLayout`, `gvSccHighlight`,
|
|
24
|
-
* `gvApplySccHighlight`, and the `gv*` control-state vars.
|
|
25
|
-
*/
|
|
26
|
-
export declare function dashboardGraphControlsJs(): string;
|
|
27
|
-
//# sourceMappingURL=graph-controls.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph-controls.d.ts","sourceRoot":"","sources":["../../src/code-paths/graph-controls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAsOjD"}
|
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Visualization control toolbar + function-level projector.
|
|
3
|
-
*
|
|
4
|
-
* A render helper (registers no view), extracted from `view-graph.ts` to keep
|
|
5
|
-
* that emitter under the file-length budget — and, like `graph-stylesheet.ts`,
|
|
6
|
-
* deliberately named out of the `view-*` namespace so it stays clear of the
|
|
7
|
-
* views-disjoint architecture rule. Emits two browser functions plus a tiny
|
|
8
|
-
* helper as a JS string; the main emitter interpolates it into its `<script>`
|
|
9
|
-
* body, so they share one runtime scope with the view's state vars
|
|
10
|
-
* (`gvLevel`, `gvSelectedPackage`, …) and `gvRenderGraph`.
|
|
11
|
-
*
|
|
12
|
-
* - `gvRenderControls(host, catalog, indexes)` — the self-contained Level /
|
|
13
|
-
* Scope / Package / Kind / Edges control bar. Package + Kind are disabled at
|
|
14
|
-
* package level (they only apply at function level). Every change re-renders
|
|
15
|
-
* the graph in place via `gvRenderGraph`.
|
|
16
|
-
* - `gvBuildFunctionElements(indexes, pkg, includeTests, kinds, crossPackage)`
|
|
17
|
-
* — projects ONE package's function call graph client-side from the catalog
|
|
18
|
-
* indexes (the package→package view-model blob can't express it).
|
|
19
|
-
* - `gvAddOptions(sel, pairs, current)` — small `<select>` option builder.
|
|
20
|
-
*
|
|
21
|
-
* Free identifiers (supplied by earlier prelude emitters / the host template):
|
|
22
|
-
* `el`, `pkgOf`, `displayName`, `resolveCalleeOcc`, `packagesInCatalog`,
|
|
23
|
-
* `KIND_LIST`, `gvRenderGraph`, `GV_LAYOUTS`, `gvRunLayout`, `gvSccHighlight`,
|
|
24
|
-
* `gvApplySccHighlight`, and the `gv*` control-state vars.
|
|
25
|
-
*/
|
|
26
|
-
export function dashboardGraphControlsJs() {
|
|
27
|
-
return String.raw `
|
|
28
|
-
// Append [value, label] option pairs to a select, marking 'current' selected.
|
|
29
|
-
function gvAddOptions(sel, pairs, current) {
|
|
30
|
-
for (var i = 0; i < pairs.length; i++) {
|
|
31
|
-
var opt = el('option', { value: pairs[i][0], text: pairs[i][1] });
|
|
32
|
-
if (pairs[i][0] === current) opt.selected = true;
|
|
33
|
-
sel.appendChild(opt);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// The view's controls, laid out as a 2-row × 4-column CSS grid where each cell
|
|
38
|
-
// is a labeled control (label + control flex pair). Auto-flow fills 4 cells per
|
|
39
|
-
// row:
|
|
40
|
-
// Row 1: Layout · Scope · Search · Highlight cycles
|
|
41
|
-
// Row 2: Level · Package · Kind · Edges
|
|
42
|
-
// Self-contained (the shared Explore filter bar was removed). The Level
|
|
43
|
-
// dropdown decides what the graph shows; Package, Kind, AND Edges only apply at
|
|
44
|
-
// function level, so all three are DISABLED at package level (faded, not
|
|
45
|
-
// hidden) — consistent greying. Most changes re-render the graph in place via
|
|
46
|
-
// gvRenderGraph; Layout re-runs the layout on the live graph (no remount).
|
|
47
|
-
function gvRenderControls(host, catalog, indexes) {
|
|
48
|
-
function rerender() { gvRenderGraph(host, catalog, indexes); }
|
|
49
|
-
var fnLevel = (gvLevel === 'function');
|
|
50
|
-
var grid = el('div', { class: 'code-paths-graph-grid' });
|
|
51
|
-
// cell(labelText, control) — one labeled grid cell (label + control). A null
|
|
52
|
-
// labelText yields an unlabeled cell (used for the search box).
|
|
53
|
-
function cell(labelText, control) {
|
|
54
|
-
var c = el('div', { class: 'code-paths-graph-cell' });
|
|
55
|
-
if (labelText) c.appendChild(el('span', { class: 'code-paths-graph-toolbar-label', text: labelText }));
|
|
56
|
-
if (control) c.appendChild(control);
|
|
57
|
-
grid.appendChild(c);
|
|
58
|
-
return c;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// ---- Row 1: Layout · Scope · Search · Highlight cycles ----
|
|
62
|
-
// Layout — dropdown; re-runs the layout on the live graph (no full remount).
|
|
63
|
-
var layoutSel = el('select', { class: 'code-paths-graph-select', 'data-control': 'layout' });
|
|
64
|
-
gvAddOptions(layoutSel, GV_LAYOUTS.map(function(l) { return [l.id, l.label]; }), gvCurrentLayout);
|
|
65
|
-
layoutSel.addEventListener('change', function(e) { gvRunLayout(e.target.value); });
|
|
66
|
-
cell('Layout', layoutSel);
|
|
67
|
-
|
|
68
|
-
// Scope — always enabled. Production-only vs include-tests.
|
|
69
|
-
var scopeSel = el('select', { class: 'code-paths-graph-select', 'data-control': 'scope' });
|
|
70
|
-
gvAddOptions(scopeSel, [['prod', 'Production only'], ['tests', 'Include tests']], gvIncludeTests ? 'tests' : 'prod');
|
|
71
|
-
scopeSel.addEventListener('change', function(e) { gvIncludeTests = (e.target.value === 'tests'); rerender(); });
|
|
72
|
-
cell('Scope', scopeSel);
|
|
73
|
-
|
|
74
|
-
// Search (unlabeled cell) — the name search box.
|
|
75
|
-
var searchCell = el('div', { class: 'code-paths-graph-cell code-paths-graph-cell-search' });
|
|
76
|
-
gvRenderSearchBox(searchCell);
|
|
77
|
-
grid.appendChild(searchCell);
|
|
78
|
-
|
|
79
|
-
// Highlight cycles (unlabeled cell) — the checkbox toggle.
|
|
80
|
-
var cyclesCell = el('div', { class: 'code-paths-graph-cell' });
|
|
81
|
-
gvRenderCyclesToggle(cyclesCell);
|
|
82
|
-
grid.appendChild(cyclesCell);
|
|
83
|
-
|
|
84
|
-
// ---- Row 2: Level · Package · Kind · Edges ----
|
|
85
|
-
// Level — always enabled. Drives package vs function granularity.
|
|
86
|
-
var levelSel = el('select', { class: 'code-paths-graph-select', 'data-control': 'level' });
|
|
87
|
-
gvAddOptions(levelSel, [['package', 'Package'], ['function', 'Function']], gvLevel);
|
|
88
|
-
levelSel.addEventListener('change', function(e) { gvLevel = e.target.value; rerender(); });
|
|
89
|
-
cell('Level', levelSel);
|
|
90
|
-
|
|
91
|
-
// Package — single-select; function level only (disabled at package level).
|
|
92
|
-
var pkgs = (typeof packagesInCatalog === 'function') ? packagesInCatalog(catalog) : [];
|
|
93
|
-
var pkgSel = el('select', { class: 'code-paths-graph-select', 'data-control': 'package' });
|
|
94
|
-
pkgSel.appendChild(el('option', { value: '', text: pkgs.length ? '— select —' : '— none —' }));
|
|
95
|
-
gvAddOptions(pkgSel, pkgs.map(function(p) { return [p, p]; }), gvSelectedPackage);
|
|
96
|
-
pkgSel.disabled = !fnLevel;
|
|
97
|
-
pkgSel.addEventListener('change', function(e) { gvSelectedPackage = e.target.value || null; rerender(); });
|
|
98
|
-
cell('Package', pkgSel);
|
|
99
|
-
|
|
100
|
-
// Kind — multi-select dropdown; function level only (disabled at package
|
|
101
|
-
// level). A custom checkbox popover (gvMultiSelect) rather than a native
|
|
102
|
-
// <select multiple> listbox, which renders as an always-open box.
|
|
103
|
-
cell('Kind', gvMultiSelect({
|
|
104
|
-
id: 'kind',
|
|
105
|
-
items: (typeof KIND_LIST !== 'undefined') ? KIND_LIST : [],
|
|
106
|
-
selected: gvKinds,
|
|
107
|
-
allLabel: 'All kinds',
|
|
108
|
-
disabled: !fnLevel,
|
|
109
|
-
onClose: function(sel) { gvKinds = sel; rerender(); },
|
|
110
|
-
}));
|
|
111
|
-
|
|
112
|
-
// Edges — function level only: intra-package (default) vs + cross-package.
|
|
113
|
-
// Always present; disabled at package level (consistent with Package/Kind).
|
|
114
|
-
var edgeSel = el('select', { class: 'code-paths-graph-select', 'data-control': 'granularity' });
|
|
115
|
-
gvAddOptions(edgeSel, [['intra', 'Intra-package'], ['cross', '+ cross-package']], gvCrossPackage ? 'cross' : 'intra');
|
|
116
|
-
edgeSel.disabled = !fnLevel;
|
|
117
|
-
edgeSel.addEventListener('change', function(e) { gvCrossPackage = (e.target.value === 'cross'); rerender(); });
|
|
118
|
-
cell('Edges', edgeSel);
|
|
119
|
-
|
|
120
|
-
host.appendChild(grid);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// The "Highlight cycles" checkbox — rendered into the row-3 search row (beside
|
|
124
|
-
// the search box), not in the control grid. Package-level SCC emphasis; toggles
|
|
125
|
-
// the emphasis on the live graph in place (no re-render).
|
|
126
|
-
function gvRenderCyclesToggle(host) {
|
|
127
|
-
var sccToggle = el('label', { class: 'code-paths-graph-checkbox' });
|
|
128
|
-
var sccCb = el('input', { type: 'checkbox', 'data-scc-toggle': '1' });
|
|
129
|
-
sccCb.checked = gvSccHighlight;
|
|
130
|
-
sccCb.addEventListener('change', function() { gvSccHighlight = sccCb.checked; gvApplySccHighlight(); });
|
|
131
|
-
sccToggle.appendChild(sccCb);
|
|
132
|
-
sccToggle.appendChild(document.createTextNode(' Highlight cycles'));
|
|
133
|
-
host.appendChild(sccToggle);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// A compact multi-select dropdown: a trigger button + a checkbox popover.
|
|
137
|
-
// Native <select multiple> renders an ugly always-open listbox, so we roll a
|
|
138
|
-
// small popover instead. Checkboxes toggle the selection live and update the
|
|
139
|
-
// trigger label; the graph re-renders only when the panel CLOSES (trigger
|
|
140
|
-
// re-click or outside click) so a remount doesn't fire on every checkbox.
|
|
141
|
-
// opts: { id, items:[string], selected:[string], allLabel, disabled, onClose }
|
|
142
|
-
function gvMultiSelect(opts) {
|
|
143
|
-
var wrap = el('div', { class: 'code-paths-graph-ms' });
|
|
144
|
-
var selected = opts.selected.slice();
|
|
145
|
-
function triggerLabel() {
|
|
146
|
-
if (selected.length === 0) return opts.allLabel;
|
|
147
|
-
if (selected.length === 1) return selected[0];
|
|
148
|
-
return selected.length + ' selected';
|
|
149
|
-
}
|
|
150
|
-
var trigger = el('button', { class: 'code-paths-graph-select code-paths-graph-ms-trigger', 'data-control': opts.id, text: triggerLabel() + ' ▾' });
|
|
151
|
-
trigger.disabled = !!opts.disabled;
|
|
152
|
-
var panel = el('div', { class: 'code-paths-graph-ms-panel' });
|
|
153
|
-
panel.style.display = 'none';
|
|
154
|
-
var open = false;
|
|
155
|
-
var docHandler = null;
|
|
156
|
-
function close() {
|
|
157
|
-
if (!open) return;
|
|
158
|
-
open = false;
|
|
159
|
-
panel.style.display = 'none';
|
|
160
|
-
if (docHandler) { document.removeEventListener('mousedown', docHandler); docHandler = null; }
|
|
161
|
-
opts.onClose(selected.slice());
|
|
162
|
-
}
|
|
163
|
-
function openPanel() {
|
|
164
|
-
if (open || opts.disabled) return;
|
|
165
|
-
open = true;
|
|
166
|
-
panel.style.display = 'block';
|
|
167
|
-
docHandler = function(e) { if (!wrap.contains(e.target)) close(); };
|
|
168
|
-
document.addEventListener('mousedown', docHandler);
|
|
169
|
-
}
|
|
170
|
-
trigger.addEventListener('click', function() { if (open) close(); else openPanel(); });
|
|
171
|
-
for (var i = 0; i < opts.items.length; i++) {
|
|
172
|
-
(function(item) {
|
|
173
|
-
var row = el('label', { class: 'code-paths-graph-ms-item' });
|
|
174
|
-
var cb = el('input', { type: 'checkbox' });
|
|
175
|
-
cb.checked = selected.indexOf(item) >= 0;
|
|
176
|
-
cb.addEventListener('change', function() {
|
|
177
|
-
var ix = selected.indexOf(item);
|
|
178
|
-
if (cb.checked && ix < 0) selected.push(item);
|
|
179
|
-
else if (!cb.checked && ix >= 0) selected.splice(ix, 1);
|
|
180
|
-
trigger.textContent = triggerLabel() + ' ▾';
|
|
181
|
-
});
|
|
182
|
-
row.appendChild(cb);
|
|
183
|
-
row.appendChild(document.createTextNode(' ' + item));
|
|
184
|
-
panel.appendChild(row);
|
|
185
|
-
})(opts.items[i]);
|
|
186
|
-
}
|
|
187
|
-
wrap.appendChild(trigger);
|
|
188
|
-
wrap.appendChild(panel);
|
|
189
|
-
return wrap;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// Project the function-level graph for a single package, client-side from the
|
|
193
|
-
// embedded catalog indexes (the package->package view-model blob can't express
|
|
194
|
-
// it). Nodes = the package's functions passing the Scope/Kind filters; edges =
|
|
195
|
-
// resolved function->function calls. Intra-package mode keeps only calls whose
|
|
196
|
-
// callee is in the same package; "+ cross-package" mode also keeps calls
|
|
197
|
-
// leaving the package, drawing the external callee as a faded node. Node size
|
|
198
|
-
// (totalCoupling) is the incident-edge degree. Bounded by package size.
|
|
199
|
-
function gvBuildFunctionElements(indexes, pkg, includeTests, kinds, crossPackage) {
|
|
200
|
-
var elements = [];
|
|
201
|
-
if (!indexes || !indexes.occurrencesByHash || !indexes.callees) return elements;
|
|
202
|
-
var kindSet = (kinds && kinds.length) ? kinds : null;
|
|
203
|
-
function passes(occ) {
|
|
204
|
-
if (!includeTests && occ.inTestFile) return false;
|
|
205
|
-
if (kindSet && kindSet.indexOf(occ.kind) < 0) return false;
|
|
206
|
-
return true;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// Seeds: one occurrence per bodyHash that lives in 'pkg' and passes filters.
|
|
210
|
-
var seeds = [];
|
|
211
|
-
var seenSeed = {};
|
|
212
|
-
indexes.occurrencesByHash.forEach(function(occs) {
|
|
213
|
-
for (var i = 0; i < occs.length; i++) {
|
|
214
|
-
if (pkgOf(occs[i]) === pkg && passes(occs[i])) {
|
|
215
|
-
if (!seenSeed[occs[i].bodyHash]) { seenSeed[occs[i].bodyHash] = true; seeds.push(occs[i]); }
|
|
216
|
-
break;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
var nodeIds = {};
|
|
222
|
-
var degree = {};
|
|
223
|
-
function addNode(occ, external) {
|
|
224
|
-
if (nodeIds[occ.bodyHash]) return;
|
|
225
|
-
nodeIds[occ.bodyHash] = true;
|
|
226
|
-
if (degree[occ.bodyHash] === undefined) degree[occ.bodyHash] = 0;
|
|
227
|
-
elements.push({ group: 'nodes', data: { id: occ.bodyHash, label: displayName(occ.simpleName), external: external ? 1 : 0, totalCoupling: 0 } });
|
|
228
|
-
}
|
|
229
|
-
for (var s = 0; s < seeds.length; s++) addNode(seeds[s], false);
|
|
230
|
-
|
|
231
|
-
var edgeSeen = {};
|
|
232
|
-
for (var s2 = 0; s2 < seeds.length; s2++) {
|
|
233
|
-
var seed = seeds[s2];
|
|
234
|
-
var targets = indexes.callees.get(seed.bodyHash) || [];
|
|
235
|
-
for (var t = 0; t < targets.length; t++) {
|
|
236
|
-
var callee = resolveCalleeOcc(targets[t], seed, indexes);
|
|
237
|
-
if (!callee) continue;
|
|
238
|
-
var external = (pkgOf(callee) !== pkg);
|
|
239
|
-
if (external && !crossPackage) continue;
|
|
240
|
-
if (!external && !passes(callee)) continue;
|
|
241
|
-
addNode(callee, external);
|
|
242
|
-
var ekey = seed.bodyHash + '\n' + callee.bodyHash;
|
|
243
|
-
if (edgeSeen[ekey]) continue;
|
|
244
|
-
edgeSeen[ekey] = true;
|
|
245
|
-
elements.push({ group: 'edges', data: { id: 'fe' + s2 + '_' + t, source: seed.bodyHash, target: callee.bodyHash, weight: 1, isCycleEdge: false } });
|
|
246
|
-
degree[seed.bodyHash] = (degree[seed.bodyHash] || 0) + 1;
|
|
247
|
-
degree[callee.bodyHash] = (degree[callee.bodyHash] || 0) + 1;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
for (var e = 0; e < elements.length; e++) {
|
|
251
|
-
if (elements[e].group === 'nodes') elements[e].data.totalCoupling = degree[elements[e].data.id] || 0;
|
|
252
|
-
}
|
|
253
|
-
return elements;
|
|
254
|
-
}
|
|
255
|
-
`;
|
|
256
|
-
}
|
|
257
|
-
//# sourceMappingURL=graph-controls.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph-controls.js","sourceRoot":"","sources":["../../src/code-paths/graph-controls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,wBAAwB;IACtC,OAAO,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoOlB,CAAC;AACF,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Cytoscape stylesheet for the Code Graph "Visualization" view.
|
|
3
|
-
*
|
|
4
|
-
* A render helper (registers no view), extracted from `view-graph.ts` to keep
|
|
5
|
-
* that emitter under the file-length budget and deliberately named out of the
|
|
6
|
-
* `view-*` namespace so it stays clear of the views-disjoint architecture
|
|
7
|
-
* rule. Emits the `gvStylesheet()` browser function as a JS string; the main
|
|
8
|
-
* emitter interpolates it into its `<script>` body.
|
|
9
|
-
*
|
|
10
|
-
* PACKAGE granularity (item 10): nodes are packages, not functions. The
|
|
11
|
-
* visual encoding is therefore simpler than the function-level original —
|
|
12
|
-
* uniform round-rectangle nodes sized by total coupling degree, edges
|
|
13
|
-
* thickened by call-count weight, plus the cross-package SCC accent and the
|
|
14
|
-
* shared selection/search/impact highlight classes.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Emit the `gvStylesheet()` browser function as a JS string. No leading or
|
|
18
|
-
* trailing newline, so the main emitter can interpolate it where the inline
|
|
19
|
-
* function used to sit.
|
|
20
|
-
*/
|
|
21
|
-
export declare function dashboardViewGraphStylesheetJs(): string;
|
|
22
|
-
//# sourceMappingURL=graph-stylesheet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph-stylesheet.d.ts","sourceRoot":"","sources":["../../src/code-paths/graph-stylesheet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,CAmGvD"}
|