@zenfg/inspector 0.1.0-beta.3 → 0.1.0
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/GUIDE.md +182 -0
- package/README.md +61 -89
- package/THEMING.md +124 -0
- package/dist/FrameGraphInspector.d.ts +23 -4
- package/dist/FrameGraphInspector.d.ts.map +1 -1
- package/dist/FrameGraphInspector.js +137 -29
- package/dist/FrameGraphInspector.js.map +1 -1
- package/dist/capture.d.ts +5 -0
- package/dist/capture.d.ts.map +1 -0
- package/dist/capture.js +2 -0
- package/dist/capture.js.map +1 -0
- package/dist/debugCaptureModel.d.ts +19 -0
- package/dist/debugCaptureModel.d.ts.map +1 -1
- package/dist/debugCaptureModel.js +36 -2
- package/dist/debugCaptureModel.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/panelAliasAnalysis.d.ts +1 -0
- package/dist/panelAliasAnalysis.d.ts.map +1 -1
- package/dist/panelAliasAnalysis.js +23 -54
- package/dist/panelAliasAnalysis.js.map +1 -1
- package/dist/panelCytoscapeGraphRenderer.d.ts +15 -2
- package/dist/panelCytoscapeGraphRenderer.d.ts.map +1 -1
- package/dist/panelCytoscapeGraphRenderer.js +145 -23
- package/dist/panelCytoscapeGraphRenderer.js.map +1 -1
- package/dist/panelDetailLayout.d.ts +27 -0
- package/dist/panelDetailLayout.d.ts.map +1 -0
- package/dist/panelDetailLayout.js +174 -0
- package/dist/panelDetailLayout.js.map +1 -0
- package/dist/panelDetailStyles.d.ts +2 -0
- package/dist/panelDetailStyles.d.ts.map +1 -0
- package/dist/panelDetailStyles.js +57 -0
- package/dist/panelDetailStyles.js.map +1 -0
- package/dist/panelDiagnosticsView.d.ts +10 -1
- package/dist/panelDiagnosticsView.d.ts.map +1 -1
- package/dist/panelDiagnosticsView.js +166 -57
- package/dist/panelDiagnosticsView.js.map +1 -1
- package/dist/panelDomHelpers.d.ts.map +1 -1
- package/dist/panelDomHelpers.js +6 -5
- package/dist/panelDomHelpers.js.map +1 -1
- package/dist/panelGraphLayout.d.ts +3 -2
- package/dist/panelGraphLayout.d.ts.map +1 -1
- package/dist/panelGraphLayout.js +6 -5
- package/dist/panelGraphLayout.js.map +1 -1
- package/dist/panelGraphRenderer.d.ts +10 -0
- package/dist/panelGraphRenderer.d.ts.map +1 -1
- package/dist/panelGraphRenderer.js.map +1 -1
- package/dist/panelGraphScene.d.ts +1 -0
- package/dist/panelGraphScene.d.ts.map +1 -1
- package/dist/panelGraphScene.js +69 -32
- package/dist/panelGraphScene.js.map +1 -1
- package/dist/panelGraphSearch.d.ts +16 -0
- package/dist/panelGraphSearch.d.ts.map +1 -0
- package/dist/panelGraphSearch.js +93 -0
- package/dist/panelGraphSearch.js.map +1 -0
- package/dist/panelGraphView.d.ts +82 -0
- package/dist/panelGraphView.d.ts.map +1 -1
- package/dist/panelGraphView.js +15 -4
- package/dist/panelGraphView.js.map +1 -1
- package/dist/panelGraphVisuals.d.ts +14 -6
- package/dist/panelGraphVisuals.d.ts.map +1 -1
- package/dist/panelGraphVisuals.js +126 -51
- package/dist/panelGraphVisuals.js.map +1 -1
- package/dist/panelInspectorView.d.ts +8 -0
- package/dist/panelInspectorView.d.ts.map +1 -1
- package/dist/panelInspectorView.js +242 -48
- package/dist/panelInspectorView.js.map +1 -1
- package/dist/panelListStyles.d.ts +3 -0
- package/dist/panelListStyles.d.ts.map +1 -0
- package/dist/panelListStyles.js +155 -0
- package/dist/panelListStyles.js.map +1 -0
- package/dist/panelMemoryStyles.d.ts +3 -0
- package/dist/panelMemoryStyles.d.ts.map +1 -0
- package/dist/panelMemoryStyles.js +42 -0
- package/dist/panelMemoryStyles.js.map +1 -0
- package/dist/panelMemoryView.d.ts +13 -1
- package/dist/panelMemoryView.d.ts.map +1 -1
- package/dist/panelMemoryView.js +161 -41
- package/dist/panelMemoryView.js.map +1 -1
- package/dist/panelPassesView.d.ts +15 -0
- package/dist/panelPassesView.d.ts.map +1 -1
- package/dist/panelPassesView.js +202 -72
- package/dist/panelPassesView.js.map +1 -1
- package/dist/panelRawView.d.ts +15 -0
- package/dist/panelRawView.d.ts.map +1 -0
- package/dist/panelRawView.js +105 -0
- package/dist/panelRawView.js.map +1 -0
- package/dist/panelResourcesView.d.ts +8 -0
- package/dist/panelResourcesView.d.ts.map +1 -1
- package/dist/panelResourcesView.js +62 -31
- package/dist/panelResourcesView.js.map +1 -1
- package/dist/panelSelection.d.ts +9 -1
- package/dist/panelSelection.d.ts.map +1 -1
- package/dist/panelSelection.js +34 -4
- package/dist/panelSelection.js.map +1 -1
- package/dist/panelTheme.d.ts +13 -0
- package/dist/panelTheme.d.ts.map +1 -0
- package/dist/panelTheme.js +104 -0
- package/dist/panelTheme.js.map +1 -0
- package/dist/panelTypes.d.ts +10 -1
- package/dist/panelTypes.d.ts.map +1 -1
- package/dist/panelTypes.js.map +1 -1
- package/dist/panelVisualTheme.d.ts +147 -50
- package/dist/panelVisualTheme.d.ts.map +1 -1
- package/dist/panelVisualTheme.js +34 -44
- package/dist/panelVisualTheme.js.map +1 -1
- package/dist/panelWorkbenchHelpers.d.ts +12 -1
- package/dist/panelWorkbenchHelpers.d.ts.map +1 -1
- package/dist/panelWorkbenchHelpers.js +62 -1
- package/dist/panelWorkbenchHelpers.js.map +1 -1
- package/dist/panelWorkbenchStyles.d.ts +2 -0
- package/dist/panelWorkbenchStyles.d.ts.map +1 -0
- package/dist/panelWorkbenchStyles.js +101 -0
- package/dist/panelWorkbenchStyles.js.map +1 -0
- package/dist/panelWorkbenchView.d.ts +16 -0
- package/dist/panelWorkbenchView.d.ts.map +1 -1
- package/dist/panelWorkbenchView.js +228 -50
- package/dist/panelWorkbenchView.js.map +1 -1
- package/dist/query.js.map +1 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +147 -195
- package/dist/styles.js.map +1 -1
- package/dist/theme.d.ts +22 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +10 -0
- package/dist/theme.js.map +1 -0
- package/dist/themeDefinitions.d.ts +251 -0
- package/dist/themeDefinitions.d.ts.map +1 -0
- package/dist/themeDefinitions.js +96 -0
- package/dist/themeDefinitions.js.map +1 -0
- package/dist/themePalette.d.ts +66 -0
- package/dist/themePalette.d.ts.map +1 -0
- package/dist/themePalette.js +37 -0
- package/dist/themePalette.js.map +1 -0
- package/dist/themes.css +165 -0
- package/package.json +44 -10
- package/src/FrameGraphInspector.ts +130 -31
- package/src/capture.ts +4 -0
- package/src/debugCaptureModel.ts +53 -2
- package/src/index.ts +6 -2
- package/src/panelAliasAnalysis.ts +24 -70
- package/src/panelCytoscapeGraphRenderer.ts +140 -23
- package/src/panelDetailLayout.ts +155 -0
- package/src/panelDetailStyles.ts +56 -0
- package/src/panelDiagnosticsView.ts +166 -85
- package/src/panelDomHelpers.ts +4 -5
- package/src/panelGraphLayout.ts +6 -5
- package/src/panelGraphRenderer.ts +7 -0
- package/src/panelGraphScene.ts +68 -30
- package/src/panelGraphSearch.ts +96 -0
- package/src/panelGraphView.ts +14 -4
- package/src/panelGraphVisuals.ts +122 -52
- package/src/panelInspectorView.ts +227 -48
- package/src/panelListStyles.ts +154 -0
- package/src/panelMemoryStyles.ts +41 -0
- package/src/panelMemoryView.ts +178 -53
- package/src/panelPassesView.ts +190 -137
- package/src/panelRawView.ts +99 -0
- package/src/panelResourcesView.ts +69 -56
- package/src/panelSelection.ts +37 -5
- package/src/panelTheme.ts +85 -0
- package/src/panelTypes.ts +7 -1
- package/src/panelVisualTheme.ts +38 -49
- package/src/panelWorkbenchHelpers.ts +60 -2
- package/src/panelWorkbenchStyles.ts +100 -0
- package/src/panelWorkbenchView.ts +201 -52
- package/src/query.ts +11 -11
- package/src/styles.ts +148 -195
- package/src/theme.ts +24 -0
- package/src/themeDefinitions.ts +103 -0
- package/src/themePalette.ts +44 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelGraphView.js","sourceRoot":"","sources":["../src/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,CAAC,CAAC;QAC7C,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC;QAChC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC3B,KAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;AACL,CAAC","sourcesContent":["import type { FrameGraphDebugViewModel } from './debugCaptureModel.ts';\nimport { CytoscapeGraphRenderer } from './panelCytoscapeGraphRenderer.ts';\nimport { createGraphScene, type GraphScene } from './panelGraphScene.ts';\nimport { createGraphLegend } from './panelGraphVisuals.ts';\nimport type { GraphViewState, Selection } from './panelTypes.ts';\n\ntype GraphSceneCacheEntry = {\n readonly snapshot: FrameGraphDebugViewModel;\n readonly optionsKey: string;\n readonly scene: GraphScene;\n};\n\nconst graphSceneCache = new WeakMap<GraphViewState, GraphSceneCacheEntry>();\n\nexport function renderGraphView(\n graphView: GraphViewState,\n snapshot: FrameGraphDebugViewModel,\n selected: Selection | undefined,\n hovered: Selection | undefined,\n onSelect: (selection: Selection) => void,\n onHover: (selection: Selection | undefined) => void,\n onToggleGroup: (pathKey: string) => void,\n): void {\n const scene = resolveGraphScene(graphView, snapshot);\n renderGraphLegend(graphView.legend, snapshot);\n\tconst elementCount = scene.nodes.length + scene.edges.length;\n\tconst layoutElementBudget = graphView.layoutElementBudget ?? Number.MAX_SAFE_INTEGER;\n\tif (elementCount > layoutElementBudget) {\n\t\tgraphView.renderer?.destroy();\n\t\tgraphView.renderer = undefined;\n\t\tconst notice = document.createElement('div');\n\t\tnotice.className = 'zenfg-inspector-graph-status';\n\t\tnotice.dataset.state = 'empty';\n\t\tnotice.setAttribute('role', 'status');\n\t\tnotice.textContent = `Automatic layout disabled: ${elementCount} graph elements exceed the ${layoutElementBudget} element budget. Passes, Resources, Memory, Diagnostics, and raw data remain available.`;\n\t\tgraphView.host.replaceChildren(notice);\n\t\treturn;\n\t}\n\tgraphView.renderer ??= new CytoscapeGraphRenderer(graphView.host);\n graphView.renderer.render({\n scene,\n selected,\n hovered,\n fit: graphView.fitOnNextRender,\n anchorElementId: graphView.anchorElementIdOnNextRender,\n onSelect,\n onHover,\n onToggleGroup,\n });\n graphView.fitOnNextRender = false;\n graphView.anchorElementIdOnNextRender = undefined;\n}\n\nexport function resolveGraphScene(\n graphView: GraphViewState,\n snapshot: FrameGraphDebugViewModel,\n): GraphScene {\n const optionsKey = JSON.stringify([\n graphView.groupsEnabled,\n [...graphView.expandedGroupPaths].sort(),\n ]);\n const cached = graphSceneCache.get(graphView);\n if (cached?.snapshot === snapshot && cached.optionsKey === optionsKey) return cached.scene;\n const scene = createGraphScene(snapshot, {\n groupsEnabled: graphView.groupsEnabled,\n expandedGroupPaths: graphView.expandedGroupPaths,\n });\n graphSceneCache.set(graphView, { snapshot, optionsKey, scene });\n return scene;\n}\n\nexport function fitGraph(graphView: GraphViewState): void {\n graphView.renderer?.fit();\n}\n\nexport function resizeGraph(graphView: GraphViewState): void {\n graphView.renderer?.resize();\n}\n\nexport function destroyGraph(graphView: GraphViewState): void {\n graphView.renderer?.destroy();\n graphView.renderer = undefined;\n graphSceneCache.delete(graphView);\n}\n\nfunction renderGraphLegend(host: HTMLElement | undefined, snapshot: FrameGraphDebugViewModel): void {\n if (!host) return;\n const entries = createGraphLegend(snapshot);\n const key = JSON.stringify(entries);\n if (host.dataset.legendKey === key) return;\n host.dataset.legendKey = key;\n host.replaceChildren();\n let group: HTMLElement | undefined;\n for (const entry of entries) {\n if (group?.getAttribute('aria-label') !== entry.group) {\n group = document.createElement('span');\n group.className = 'zenfg-inspector-legend-group';\n group.setAttribute('role', 'group');\n group.setAttribute('aria-label', entry.group);\n const heading = document.createElement('span');\n heading.className = 'zenfg-inspector-legend-heading';\n heading.textContent = entry.group;\n group.appendChild(heading);\n host.appendChild(group);\n }\n const item = document.createElement('span');\n item.className = 'zenfg-inspector-legend-item';\n const swatch = document.createElement('span');\n swatch.className = 'zenfg-inspector-legend-swatch';\n swatch.dataset.shape = entry.shape;\n if (entry.lineStyle) swatch.dataset.lineStyle = entry.lineStyle;\n if (entry.hollowArrow) swatch.dataset.hollowArrow = 'true';\n swatch.style.setProperty('--zenfg-inspector-legend-color', entry.color);\n if (entry.shape === 'cut-rectangle' || entry.shape === 'tag') {\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttribute('viewBox', '0 0 20 14');\n svg.setAttribute('aria-hidden', 'true');\n const polygon = document.createElementNS('http://www.w3.org/2000/svg', 'polygon');\n polygon.setAttribute('points', entry.shape === 'tag'\n ? '1,1 12,1 19,7 12,13 1,13'\n : '4,1 16,1 19,4 19,10 16,13 4,13 1,10 1,4');\n svg.appendChild(polygon);\n swatch.appendChild(svg);\n }\n const label = document.createElement('span');\n label.textContent = entry.label;\n item.append(swatch, label);\n group!.appendChild(item);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"panelGraphView.js","sourceRoot":"","sources":["../src/panelGraphView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAmB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAS3D,MAAM,eAAe,GAAG,IAAI,OAAO,EAAwC,CAAC;AAE5E,MAAM,UAAU,eAAe,CAC3B,SAAyB,EACzB,QAAkC,EAClC,QAA+B,EAC/B,OAA8B,EAC9B,QAAwC,EACxC,OAAmD,EACnD,aAAwC;IAExC,MAAM,KAAK,GAAG,iBAAiB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACrD,IAAI,CAAC,SAAS,CAAC,KAAK;QAAE,SAAS,CAAC,YAAY,EAAE,EAAE,CAAC;IACjD,iBAAiB,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,w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;QAChC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC3B,KAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;AACL,CAAC","sourcesContent":["import { GRAPH_VISUAL_THEME } from './panelVisualTheme.ts';\nimport type { FrameGraphDebugViewModel } from './debugCaptureModel.ts';\nimport { CytoscapeGraphRenderer } from './panelCytoscapeGraphRenderer.ts';\nimport { createGraphScene, type GraphScene } from './panelGraphScene.ts';\nimport { createGraphLegend } from './panelGraphVisuals.ts';\nimport type { GraphViewState, Selection } from './panelTypes.ts';\n\ntype GraphSceneCacheEntry = {\n readonly snapshot: FrameGraphDebugViewModel;\n readonly optionsKey: string;\n readonly scene: GraphScene;\n};\n\nconst graphSceneCache = new WeakMap<GraphViewState, GraphSceneCacheEntry>();\n\nexport function renderGraphView(\n graphView: GraphViewState,\n snapshot: FrameGraphDebugViewModel,\n selected: Selection | undefined,\n hovered: Selection | undefined,\n onSelect: (selection: Selection) => void,\n onHover: (selection: Selection | undefined) => void,\n onToggleGroup: (pathKey: string) => void,\n): void {\n const scene = resolveGraphScene(graphView, snapshot);\n if (!graphView.theme) graphView.refreshTheme?.();\n renderGraphLegend(graphView.legend, snapshot, graphView.theme, graphView.showResourceDeclarations);\n\tconst elementCount = scene.nodes.length + scene.edges.length;\n\tconst layoutElementBudget = graphView.layoutElementBudget ?? Number.MAX_SAFE_INTEGER;\n\tif (elementCount > layoutElementBudget) {\n\t\tgraphView.renderer?.destroy();\n\t\tgraphView.renderer = undefined;\n\t\tconst notice = document.createElement('div');\n\t\tnotice.className = 'zenfg-inspector-graph-status';\n\t\tnotice.dataset.state = 'empty';\n\t\tnotice.setAttribute('role', 'status');\n\t\tnotice.textContent = `Automatic layout disabled: ${elementCount} graph elements exceed the ${layoutElementBudget} element budget. Passes, Resources, Memory, Diagnostics, and raw data remain available.`;\n\t\tgraphView.host.replaceChildren(notice);\n\t\treturn;\n\t}\n\tgraphView.renderer ??= new CytoscapeGraphRenderer(graphView.host);\n graphView.renderer.render({\n scene,\n theme: graphView.theme,\n onVisible: graphView.refreshTheme,\n selected,\n hovered,\n fit: graphView.fitOnNextRender,\n anchorElementId: graphView.anchorElementIdOnNextRender,\n reveal: graphView.revealOnNextRender,\n captureRevision: graphView.captureRevision,\n onSelect,\n onHover,\n onToggleGroup,\n });\n graphView.fitOnNextRender = false;\n graphView.anchorElementIdOnNextRender = undefined;\n graphView.revealOnNextRender = undefined;\n}\n\nexport function resolveGraphScene(\n graphView: GraphViewState,\n snapshot: FrameGraphDebugViewModel,\n): GraphScene {\n const optionsKey = JSON.stringify([\n graphView.groupsEnabled,\n graphView.showResourceDeclarations ?? true,\n [...graphView.expandedGroupPaths].sort(),\n ]);\n const cached = graphSceneCache.get(graphView);\n if (cached?.snapshot === snapshot && cached.optionsKey === optionsKey) return cached.scene;\n const scene = createGraphScene(snapshot, {\n groupsEnabled: graphView.groupsEnabled,\n showResourceDeclarations: graphView.showResourceDeclarations,\n expandedGroupPaths: graphView.expandedGroupPaths,\n });\n graphSceneCache.set(graphView, { snapshot, optionsKey, scene });\n return scene;\n}\n\nexport function fitGraph(graphView: GraphViewState): void {\n graphView.renderer?.fit();\n}\n\nexport function resizeGraph(graphView: GraphViewState): void {\n graphView.refreshTheme?.();\n graphView.renderer?.resize();\n}\n\nexport function destroyGraph(graphView: GraphViewState): void {\n graphView.renderer?.destroy();\n graphView.renderer = undefined;\n graphSceneCache.delete(graphView);\n}\n\nexport function renderGraphLegend(host: HTMLElement | undefined, snapshot: FrameGraphDebugViewModel, theme = GRAPH_VISUAL_THEME, showResourceDeclarations = true): void {\n if (!host) return;\n const entries = createGraphLegend(snapshot, theme, showResourceDeclarations);\n const key = JSON.stringify(entries);\n if (host.dataset.legendKey === key) return;\n host.dataset.legendKey = key;\n host.replaceChildren();\n let group: HTMLElement | undefined;\n for (const entry of entries) {\n if (group?.getAttribute('aria-label') !== entry.group) {\n group = document.createElement('span');\n group.className = 'zenfg-inspector-legend-group';\n group.setAttribute('role', 'group');\n group.setAttribute('aria-label', entry.group);\n const heading = document.createElement('span');\n heading.className = 'zenfg-inspector-legend-heading';\n heading.textContent = entry.group;\n group.appendChild(heading);\n host.appendChild(group);\n }\n const item = document.createElement('span');\n item.className = 'zenfg-inspector-legend-item';\n const swatch = document.createElement('span');\n swatch.className = 'zenfg-inspector-legend-swatch';\n swatch.dataset.shape = entry.shape;\n if (entry.lineStyle) swatch.dataset.lineStyle = entry.lineStyle;\n if (entry.hollowArrow) swatch.dataset.hollowArrow = 'true';\n swatch.style.setProperty('--zenfg-inspector-legend-color', entry.color);\n if (entry.shape === 'cut-rectangle' || entry.shape === 'tag') {\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttribute('viewBox', '0 0 20 14');\n svg.setAttribute('aria-hidden', 'true');\n const polygon = document.createElementNS('http://www.w3.org/2000/svg', 'polygon');\n polygon.setAttribute('points', entry.shape === 'tag'\n ? '1,1 16,1 19,7 16,13 1,13'\n : '4,1 16,1 19,4 19,10 16,13 4,13 1,10 1,4');\n svg.appendChild(polygon);\n swatch.appendChild(svg);\n }\n const label = document.createElement('span');\n label.textContent = entry.label;\n item.append(swatch, label);\n group!.appendChild(item);\n }\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type cytoscape from 'cytoscape';
|
|
2
2
|
import type { GraphScene, GraphSceneEdge, GraphSceneNode } from './panelGraphScene.ts';
|
|
3
|
+
import { type GraphVisualTheme } from './panelVisualTheme.ts';
|
|
3
4
|
import { type FrameGraphDebugViewModel } from './debugCaptureModel.ts';
|
|
4
5
|
export { GRAPH_VISUAL_THEME } from './panelVisualTheme.ts';
|
|
5
6
|
export declare const GRAPH_GEOMETRY: {
|
|
@@ -17,8 +18,9 @@ export declare const GRAPH_GEOMETRY: {
|
|
|
17
18
|
readonly left: 24;
|
|
18
19
|
};
|
|
19
20
|
readonly edgeCornerRadius: 6;
|
|
20
|
-
readonly outputWidth:
|
|
21
|
-
readonly
|
|
21
|
+
readonly outputWidth: 208;
|
|
22
|
+
readonly outputTipWidth: 24;
|
|
23
|
+
readonly outputLabelWidth: 160;
|
|
22
24
|
};
|
|
23
25
|
export type GraphLegendEntry = {
|
|
24
26
|
readonly group: 'Execution' | 'Resources' | 'Relationships';
|
|
@@ -29,14 +31,20 @@ export type GraphLegendEntry = {
|
|
|
29
31
|
readonly lineStyle?: 'solid' | 'dotted' | 'dashed';
|
|
30
32
|
readonly hollowArrow?: boolean;
|
|
31
33
|
};
|
|
32
|
-
export declare function createGraphLegend(snapshot: FrameGraphDebugViewModel): readonly GraphLegendEntry[];
|
|
33
|
-
export declare function createGraphStyles(): cytoscape.StylesheetJson;
|
|
34
|
-
export declare function nodeDimensions(node: GraphSceneNode): {
|
|
34
|
+
export declare function createGraphLegend(snapshot: FrameGraphDebugViewModel, theme?: GraphVisualTheme, showResourceDeclarations?: boolean): readonly GraphLegendEntry[];
|
|
35
|
+
export declare function createGraphStyles(theme?: GraphVisualTheme): cytoscape.StylesheetJson;
|
|
36
|
+
export declare function nodeDimensions(node: GraphSceneNode, theme?: GraphVisualTheme): {
|
|
35
37
|
readonly width: number;
|
|
36
38
|
readonly height: number;
|
|
37
39
|
};
|
|
40
|
+
/** Enlarge short labels within the existing box; retain the theme size for dense text. */
|
|
41
|
+
export declare function graphLabelFontSize(label: string, width: number, height: number, theme: GraphVisualTheme): number;
|
|
42
|
+
/** Wrap only the group name (up to two lines); keep the node-count row distinct. */
|
|
43
|
+
export declare function fitCollapsedGroupLabel(label: string, width: number, theme: GraphVisualTheme): string;
|
|
44
|
+
/** Fit the already semantic label to its available width after font changes. */
|
|
45
|
+
export declare function fitGraphLabel(label: string, width: number, theme: GraphVisualTheme): string;
|
|
38
46
|
export declare function graphLayoutGeometryKey(scene: GraphScene): string;
|
|
39
47
|
export declare function graphEdgeDisplayLabel(_edge: GraphSceneEdge): string;
|
|
40
48
|
export declare function expandedGroupLabelMaxWidth(outerWidth: number): number;
|
|
41
|
-
export declare function isOverviewGraphScale(zoom: number): boolean;
|
|
49
|
+
export declare function isOverviewGraphScale(zoom: number, theme?: GraphVisualTheme): boolean;
|
|
42
50
|
//# sourceMappingURL=panelGraphVisuals.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelGraphVisuals.d.ts","sourceRoot":"","sources":["../src/panelGraphVisuals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"panelGraphVisuals.d.ts","sourceRoot":"","sources":["../src/panelGraphVisuals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAwB,KAAK,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;CAajB,CAAC;AAKX,MAAM,MAAM,gBAAgB,GAAG;IAC3B,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,GAAG,eAAe,CAAC;IAC5D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IAC/E,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG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 32,
|
|
12
12
|
elkGroupPadding: { top: 46, right: 24, bottom: 24, left: 24 },
|
|
13
13
|
edgeCornerRadius: 6,
|
|
14
|
-
outputWidth:
|
|
15
|
-
|
|
14
|
+
outputWidth: 208,
|
|
15
|
+
outputTipWidth: 24,
|
|
16
|
+
outputLabelWidth: 160,
|
|
16
17
|
};
|
|
17
18
|
const ENDPOINT_EDGE_DISTANCES = 'endpoints';
|
|
18
19
|
const EDGE_SEGMENT_RADII = `${GRAPH_GEOMETRY.edgeCornerRadius}px`;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
20
|
+
export function createGraphLegend(snapshot, theme = GRAPH_VISUAL_THEME, showResourceDeclarations = true) {
|
|
21
|
+
const nodeEntries = {
|
|
22
|
+
render: nodeLegend('render', 'Render', theme.render.stroke),
|
|
23
|
+
compute: nodeLegend('compute', 'Compute', theme.compute.stroke),
|
|
24
|
+
copy: nodeLegend('copy', 'Copy', theme.copy.stroke),
|
|
25
|
+
'clear-buffer': nodeLegend('clear', 'Clear', theme.clear.stroke),
|
|
26
|
+
command: nodeLegend('command', 'Command', theme.command.stroke),
|
|
27
|
+
'external-submission': { ...nodeLegend('external', 'External', theme.external.stroke), shape: 'cut-rectangle' },
|
|
28
|
+
};
|
|
28
29
|
const entries = [];
|
|
29
30
|
const passKinds = new Set(snapshot.nodes.map((node) => node.kind));
|
|
30
31
|
for (const kind of ['render', 'compute', 'copy', 'clear-buffer', 'command', 'external-submission']) {
|
|
31
32
|
if (passKinds.has(kind))
|
|
32
|
-
entries.push(
|
|
33
|
+
entries.push(nodeEntries[kind]);
|
|
33
34
|
}
|
|
34
35
|
const retained = new Set(snapshot.nodes.map((node) => node.id));
|
|
35
36
|
const used = new Set([
|
|
36
37
|
...snapshot.accessEdges.filter((access) => retained.has(access.nodeId)).map((access) => access.resource.id),
|
|
37
38
|
...snapshot.roots.flatMap((root) => root.resource ? [root.resource.id] : []),
|
|
38
39
|
]);
|
|
39
|
-
const resources = snapshot.resources.filter((resource) => used.has(resource.id));
|
|
40
|
+
const resources = showResourceDeclarations ? snapshot.resources.filter((resource) => used.has(resource.id)) : [];
|
|
40
41
|
if (resources.length)
|
|
41
|
-
entries.push({ group: 'Resources', key: 'declaration', label: 'Declaration', color:
|
|
42
|
+
entries.push({ group: 'Resources', key: 'declaration', label: 'Declaration', color: theme.declaration.stroke, shape: 'ellipse' });
|
|
42
43
|
if (snapshot.roots.some((root) => root.resource))
|
|
43
|
-
entries.push({ group: 'Resources', key: 'output', label: 'Output', color:
|
|
44
|
+
entries.push({ group: 'Resources', key: 'output', label: 'Output', color: theme.output.stroke, shape: 'tag' });
|
|
44
45
|
if ([...snapshot.nodes, ...resources].some((item) => item.debugGroupId !== undefined)) {
|
|
45
|
-
entries.push({ group: 'Relationships', key: 'group', label: 'Group', color:
|
|
46
|
+
entries.push({ group: 'Relationships', key: 'group', label: 'Group', color: theme.group.stroke, shape: 'group' });
|
|
46
47
|
}
|
|
47
48
|
if (snapshot.edges.some((edge) => edge.kind === 'value')
|
|
48
|
-
|| declarationEntrances(snapshot.nodes, snapshot.accessEdges, snapshot.edges).length
|
|
49
|
-
|| snapshot.roots.some((root) => root.resource && root.resolution && (root.resolution.usesInitialContents || root.resolution.producerNodeIds.length))) {
|
|
50
|
-
entries.push(edgeLegend('flow', 'Resource Flow',
|
|
49
|
+
|| (showResourceDeclarations && declarationEntrances(snapshot.nodes, snapshot.accessEdges, snapshot.edges).length)
|
|
50
|
+
|| snapshot.roots.some((root) => root.resource && root.resolution && ((showResourceDeclarations && root.resolution.usesInitialContents) || root.resolution.producerNodeIds.length))) {
|
|
51
|
+
entries.push(edgeLegend('flow', 'Resource Flow', theme.dependency.value, 'solid'));
|
|
51
52
|
}
|
|
52
53
|
if (snapshot.edges.some((edge) => edge.kind === 'ordering')) {
|
|
53
54
|
entries.push({
|
|
54
|
-
...edgeLegend('ordering', 'Order',
|
|
55
|
+
...edgeLegend('ordering', 'Order', theme.dependency.ordering, 'dotted'),
|
|
55
56
|
hollowArrow: true,
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
59
|
return entries;
|
|
59
60
|
}
|
|
60
|
-
export function createGraphStyles() {
|
|
61
|
-
const theme = GRAPH_VISUAL_THEME;
|
|
61
|
+
export function createGraphStyles(theme = GRAPH_VISUAL_THEME) {
|
|
62
62
|
return [
|
|
63
|
+
{
|
|
64
|
+
selector: 'core',
|
|
65
|
+
style: {
|
|
66
|
+
'active-bg-color': theme.activeBackground.color,
|
|
67
|
+
'active-bg-opacity': theme.activeBackground.opacity,
|
|
68
|
+
'active-bg-size': theme.activeBackground.size,
|
|
69
|
+
// Cytoscape accepts partial core styles; its Core type marks every property required.
|
|
70
|
+
},
|
|
71
|
+
},
|
|
63
72
|
{
|
|
64
73
|
selector: 'node',
|
|
65
74
|
style: {
|
|
@@ -68,14 +77,15 @@ export function createGraphStyles() {
|
|
|
68
77
|
'height': 'data(height)',
|
|
69
78
|
'label': 'data(displayLabel)',
|
|
70
79
|
'text-wrap': 'wrap',
|
|
71
|
-
'text-max-width': '
|
|
72
|
-
'font-family':
|
|
73
|
-
'font-size':
|
|
80
|
+
'text-max-width': 'data(labelMaxWidth)',
|
|
81
|
+
'font-family': theme.fontFamily,
|
|
82
|
+
'font-size': (element) => element.data('labelFontSize') ?? theme.fontSize,
|
|
83
|
+
'line-height': 1.2,
|
|
74
84
|
'min-zoomed-font-size': GRAPH_GEOMETRY.minimumZoomedFontSize,
|
|
75
85
|
'color': theme.text,
|
|
76
86
|
'background-color': theme.surfaceRaised,
|
|
77
87
|
'border-color': theme.group.stroke,
|
|
78
|
-
'border-width':
|
|
88
|
+
'border-width': theme.nodeBorderWidth,
|
|
79
89
|
'border-style': 'solid',
|
|
80
90
|
'text-valign': 'center',
|
|
81
91
|
'text-halign': 'center',
|
|
@@ -108,12 +118,13 @@ export function createGraphStyles() {
|
|
|
108
118
|
{
|
|
109
119
|
selector: 'node[kind = "root"]',
|
|
110
120
|
style: {
|
|
111
|
-
'shape': '
|
|
121
|
+
'shape': 'polygon',
|
|
122
|
+
'shape-polygon-points': `-1 -1 ${1 - 2 * GRAPH_GEOMETRY.outputTipWidth / GRAPH_GEOMETRY.outputWidth} -1 1 0 ${1 - 2 * GRAPH_GEOMETRY.outputTipWidth / GRAPH_GEOMETRY.outputWidth} 1 -1 1`,
|
|
112
123
|
'background-color': theme.output.fill,
|
|
113
124
|
'border-color': theme.output.stroke,
|
|
114
|
-
'text-max-width':
|
|
115
|
-
//
|
|
116
|
-
'text-margin-x': -GRAPH_GEOMETRY.
|
|
125
|
+
'text-max-width': 'data(labelMaxWidth)',
|
|
126
|
+
// Keep a short tip and center the label in the rectangular body.
|
|
127
|
+
'text-margin-x': -GRAPH_GEOMETRY.outputTipWidth / 2 * theme.fontSize / GRAPH_GEOMETRY.baseFontSize,
|
|
117
128
|
},
|
|
118
129
|
},
|
|
119
130
|
{
|
|
@@ -127,13 +138,13 @@ export function createGraphStyles() {
|
|
|
127
138
|
style: {
|
|
128
139
|
'background-color': theme.group.fill,
|
|
129
140
|
'border-color': theme.group.stroke,
|
|
130
|
-
'border-width':
|
|
141
|
+
'border-width': theme.groupBorderWidth,
|
|
131
142
|
'color': theme.text,
|
|
132
143
|
},
|
|
133
144
|
},
|
|
134
145
|
{
|
|
135
146
|
selector: 'node[kind = "group"][collapsed = 0]',
|
|
136
|
-
style: expandedGroupStyle(theme.group.fill),
|
|
147
|
+
style: expandedGroupStyle(theme.group.fill, theme),
|
|
137
148
|
},
|
|
138
149
|
{
|
|
139
150
|
selector: 'node[kind = "group"][collapsed = 0][depthBand = 1]',
|
|
@@ -142,16 +153,16 @@ export function createGraphStyles() {
|
|
|
142
153
|
{
|
|
143
154
|
selector: 'edge',
|
|
144
155
|
style: {
|
|
145
|
-
'width':
|
|
156
|
+
'width': theme.edgeWidth,
|
|
146
157
|
'line-color': theme.dependency.value,
|
|
147
|
-
'line-opacity':
|
|
158
|
+
'line-opacity': theme.edgeOpacity,
|
|
148
159
|
'target-arrow-color': theme.dependency.value,
|
|
149
160
|
'target-arrow-shape': 'triangle',
|
|
150
161
|
'target-arrow-fill': 'filled',
|
|
151
|
-
'arrow-scale':
|
|
162
|
+
'arrow-scale': theme.arrowScale,
|
|
152
163
|
'curve-style': 'straight',
|
|
153
164
|
'label': 'data(displayLabel)',
|
|
154
|
-
'font-family':
|
|
165
|
+
'font-family': theme.fontFamily,
|
|
155
166
|
'font-size': 10,
|
|
156
167
|
'min-zoomed-font-size': GRAPH_GEOMETRY.minimumZoomedFontSize,
|
|
157
168
|
'color': theme.text,
|
|
@@ -170,7 +181,7 @@ export function createGraphStyles() {
|
|
|
170
181
|
'target-arrow-color': theme.dependency.ordering,
|
|
171
182
|
'line-style': 'dotted',
|
|
172
183
|
'target-arrow-fill': 'hollow',
|
|
173
|
-
'line-opacity':
|
|
184
|
+
'line-opacity': theme.orderingOpacity,
|
|
174
185
|
},
|
|
175
186
|
},
|
|
176
187
|
{
|
|
@@ -194,7 +205,7 @@ export function createGraphStyles() {
|
|
|
194
205
|
selector: 'node.semantic-hover',
|
|
195
206
|
style: {
|
|
196
207
|
'border-color': theme.hover,
|
|
197
|
-
'border-width':
|
|
208
|
+
'border-width': theme.hoverWidth,
|
|
198
209
|
'z-index': 15,
|
|
199
210
|
},
|
|
200
211
|
},
|
|
@@ -204,7 +215,7 @@ export function createGraphStyles() {
|
|
|
204
215
|
'line-color': theme.hover,
|
|
205
216
|
'target-arrow-color': theme.hover,
|
|
206
217
|
'line-opacity': 1,
|
|
207
|
-
'width':
|
|
218
|
+
'width': theme.hoverWidth,
|
|
208
219
|
'z-index': 15,
|
|
209
220
|
},
|
|
210
221
|
},
|
|
@@ -212,7 +223,7 @@ export function createGraphStyles() {
|
|
|
212
223
|
selector: 'node.semantic-selected',
|
|
213
224
|
style: {
|
|
214
225
|
'border-color': theme.selected,
|
|
215
|
-
'border-width':
|
|
226
|
+
'border-width': theme.selectedWidth,
|
|
216
227
|
'opacity': 1,
|
|
217
228
|
'z-index': 20,
|
|
218
229
|
},
|
|
@@ -223,13 +234,13 @@ export function createGraphStyles() {
|
|
|
223
234
|
'line-color': theme.selected,
|
|
224
235
|
'target-arrow-color': theme.selected,
|
|
225
236
|
'line-opacity': 1,
|
|
226
|
-
'width':
|
|
237
|
+
'width': theme.selectedWidth,
|
|
227
238
|
'z-index': 20,
|
|
228
239
|
},
|
|
229
240
|
},
|
|
230
241
|
];
|
|
231
242
|
}
|
|
232
|
-
|
|
243
|
+
function baseNodeDimensions(node) {
|
|
233
244
|
switch (node.kind) {
|
|
234
245
|
case 'pass':
|
|
235
246
|
return { width: 184, height: node.label.includes('\n') ? 62 : 48 };
|
|
@@ -238,9 +249,72 @@ export function nodeDimensions(node) {
|
|
|
238
249
|
case 'resource':
|
|
239
250
|
return { width: 184, height: Math.max(58, node.label.split('\n').length * 17 + 24) };
|
|
240
251
|
case 'group':
|
|
241
|
-
return node.collapsed ? { width:
|
|
252
|
+
return node.collapsed ? { width: 240, height: 80 } : { width: 120, height: 80 };
|
|
242
253
|
}
|
|
243
254
|
}
|
|
255
|
+
export function nodeDimensions(node, theme = GRAPH_VISUAL_THEME) {
|
|
256
|
+
const base = baseNodeDimensions(node);
|
|
257
|
+
const scale = theme.fontSize / GRAPH_GEOMETRY.baseFontSize;
|
|
258
|
+
return { width: base.width * scale, height: base.height * scale };
|
|
259
|
+
}
|
|
260
|
+
/** Enlarge short labels within the existing box; retain the theme size for dense text. */
|
|
261
|
+
export function graphLabelFontSize(label, width, height, theme) {
|
|
262
|
+
const context = graphTextContext();
|
|
263
|
+
if (context)
|
|
264
|
+
context.font = theme.fontSize + 'px ' + theme.fontFamily;
|
|
265
|
+
const lines = label.split('\n');
|
|
266
|
+
const widest = Math.max(1, ...lines.map(line => context?.measureText(line).width ?? [...line].length * theme.fontSize * .62));
|
|
267
|
+
const widthScale = width / widest;
|
|
268
|
+
const heightScale = height / (lines.length * theme.fontSize * 1.2);
|
|
269
|
+
return Math.max(theme.fontSize, Math.floor(theme.fontSize * Math.min(1.25, widthScale, heightScale) * 4) / 4);
|
|
270
|
+
}
|
|
271
|
+
/** Wrap only the group name (up to two lines); keep the node-count row distinct. */
|
|
272
|
+
export function fitCollapsedGroupLabel(label, width, theme) {
|
|
273
|
+
const [name = '', ...summary] = label.split('\n');
|
|
274
|
+
const context = graphTextContext();
|
|
275
|
+
if (context)
|
|
276
|
+
context.font = theme.fontSize + 'px ' + theme.fontFamily;
|
|
277
|
+
const measure = (text) => context?.measureText(text).width ?? [...text].length * theme.fontSize * .62;
|
|
278
|
+
const chars = [...name];
|
|
279
|
+
let split = 0;
|
|
280
|
+
while (split < chars.length && measure(chars.slice(0, split + 1).join('')) <= width)
|
|
281
|
+
split++;
|
|
282
|
+
if (split === chars.length)
|
|
283
|
+
return fitGraphLabel(label, width, theme);
|
|
284
|
+
// Prefer a word/path boundary without losing characters, including Unicode.
|
|
285
|
+
const prefix = chars.slice(0, split).join('');
|
|
286
|
+
const boundary = Math.max(prefix.lastIndexOf(' '), prefix.lastIndexOf('.'), prefix.lastIndexOf('/'));
|
|
287
|
+
if (boundary > prefix.length / 2)
|
|
288
|
+
split = [...prefix.slice(0, boundary + 1)].length;
|
|
289
|
+
return fitGraphLabel([
|
|
290
|
+
chars.slice(0, split).join('').trimEnd(),
|
|
291
|
+
chars.slice(split).join('').trimStart(),
|
|
292
|
+
...summary,
|
|
293
|
+
].join('\n'), width, theme);
|
|
294
|
+
}
|
|
295
|
+
/** Fit the already semantic label to its available width after font changes. */
|
|
296
|
+
export function fitGraphLabel(label, width, theme) {
|
|
297
|
+
const context = graphTextContext();
|
|
298
|
+
if (context)
|
|
299
|
+
context.font = theme.fontSize + 'px ' + theme.fontFamily;
|
|
300
|
+
const measure = (text) => context?.measureText(text).width ?? [...text].length * theme.fontSize * .62;
|
|
301
|
+
return label.split('\n').map(line => {
|
|
302
|
+
if (measure(line) <= width)
|
|
303
|
+
return line;
|
|
304
|
+
const chars = [...line];
|
|
305
|
+
while (chars.length && measure(chars.join('') + '…') > width)
|
|
306
|
+
chars.pop();
|
|
307
|
+
return chars.join('') + '…';
|
|
308
|
+
}).join('\n');
|
|
309
|
+
}
|
|
310
|
+
let textContext;
|
|
311
|
+
function graphTextContext() {
|
|
312
|
+
if (typeof document === 'undefined')
|
|
313
|
+
return null;
|
|
314
|
+
if (textContext === undefined)
|
|
315
|
+
textContext = document.createElement('canvas').getContext('2d');
|
|
316
|
+
return textContext;
|
|
317
|
+
}
|
|
244
318
|
export function graphLayoutGeometryKey(scene) {
|
|
245
319
|
return JSON.stringify({
|
|
246
320
|
topology: scene.topologyKey,
|
|
@@ -256,8 +330,8 @@ export function graphEdgeDisplayLabel(_edge) {
|
|
|
256
330
|
export function expandedGroupLabelMaxWidth(outerWidth) {
|
|
257
331
|
return Math.max(80, Math.floor(outerWidth - GRAPH_GEOMETRY.groupTitleInset * 2));
|
|
258
332
|
}
|
|
259
|
-
export function isOverviewGraphScale(zoom) {
|
|
260
|
-
return
|
|
333
|
+
export function isOverviewGraphScale(zoom, theme = GRAPH_VISUAL_THEME) {
|
|
334
|
+
return theme.fontSize * zoom < GRAPH_GEOMETRY.overviewFontThreshold;
|
|
261
335
|
}
|
|
262
336
|
function nodeLegend(key, label, color) {
|
|
263
337
|
return { group: 'Execution', key, label, color, shape: 'box' };
|
|
@@ -271,15 +345,16 @@ function passStyle(kind, colors) {
|
|
|
271
345
|
style: { 'background-color': colors.fill, 'border-color': colors.stroke },
|
|
272
346
|
};
|
|
273
347
|
}
|
|
274
|
-
function expandedGroupStyle(backgroundColor) {
|
|
348
|
+
function expandedGroupStyle(backgroundColor, theme) {
|
|
275
349
|
const geometry = GRAPH_GEOMETRY;
|
|
276
350
|
return {
|
|
277
351
|
'background-color': backgroundColor,
|
|
278
|
-
'background-opacity':
|
|
279
|
-
'border-color':
|
|
280
|
-
'border-width':
|
|
352
|
+
'background-opacity': theme.groupOpacity,
|
|
353
|
+
'border-color': theme.group.stroke,
|
|
354
|
+
'border-width': theme.groupBorderWidth,
|
|
281
355
|
'padding': `${geometry.groupPadding}px`,
|
|
282
|
-
'compound-sizing-wrt-labels': '
|
|
356
|
+
'compound-sizing-wrt-labels': 'exclude',
|
|
357
|
+
'text-wrap': 'ellipsis',
|
|
283
358
|
'min-width': '120px',
|
|
284
359
|
'min-height': '80px',
|
|
285
360
|
'text-valign': 'top-inside',
|
|
@@ -288,7 +363,7 @@ function expandedGroupStyle(backgroundColor) {
|
|
|
288
363
|
'text-margin-x': geometry.groupTitleInset - geometry.groupPadding * 2,
|
|
289
364
|
'text-margin-y': geometry.groupTitleInset - geometry.groupPadding * 2,
|
|
290
365
|
'line-height': geometry.groupTitleLineHeight,
|
|
291
|
-
'color':
|
|
366
|
+
'color': theme.text,
|
|
292
367
|
'font-weight': 600,
|
|
293
368
|
};
|
|
294
369
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelGraphVisuals.js","sourceRoot":"","sources":["../src/panelGraphVisuals.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAiC,MAAM,wBAAwB,CAAC;AAE7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,EAAE;IAChB,qBAAqB,EAAE,CAAC;IACxB,qBAAqB,EAAE,CAAC;IACxB,eAAe,EAAE,CAAC;IAClB,oBAAoB,EAAE,GAAG;IACzB,YAAY,EAAE,EAAE;IAChB,eAAe,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IAC7D,gBAAgB,EAAE,CAAC;IACnB,WAAW,EAAE,GAAG;IAChB,gBAAgB,EAAE,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aAAa,EAAE,QAAQ,CAAC,oBAAoB;QAC5C,OAAO,EAAE,kBAAkB,CAAC,IAAI;QAChC,aAAa,EAAE,GAAG;KACrB,CAAC;AACN,CAAC","sourcesContent":["import type cytoscape from 'cytoscape';\n\nimport type { GraphScene, GraphSceneEdge, GraphSceneNode } from './panelGraphScene.ts';\nimport { GRAPH_VISUAL_THEME } from './panelVisualTheme.ts';\nimport { declarationEntrances, type FrameGraphDebugViewModel } from './debugCaptureModel.ts';\n\nexport { GRAPH_VISUAL_THEME } from './panelVisualTheme.ts';\n\n\nexport const GRAPH_GEOMETRY = {\n fitPadding: 28,\n baseFontSize: 13,\n overviewFontThreshold: 9,\n minimumZoomedFontSize: 5,\n groupTitleInset: 8,\n groupTitleLineHeight: 1.2,\n groupPadding: 32,\n elkGroupPadding: { top: 46, right: 24, bottom: 24, left: 24 },\n edgeCornerRadius: 6,\n outputWidth: 256,\n outputLabelWidth: 144,\n} as const;\n\nconst ENDPOINT_EDGE_DISTANCES = 'endpoints' as unknown as cytoscape.Css.Edge['edge-distances'];\nconst EDGE_SEGMENT_RADII = `${GRAPH_GEOMETRY.edgeCornerRadius}px` as unknown as cytoscape.Css.Edge['segment-radii'];\n\nexport type GraphLegendEntry = {\n readonly group: 'Execution' | 'Resources' | 'Relationships';\n readonly key: string;\n readonly label: string;\n readonly color: string;\n readonly shape: 'box' | 'cut-rectangle' | 'tag' | 'ellipse' | 'group' | 'line';\n readonly lineStyle?: 'solid' | 'dotted' | 'dashed';\n readonly hollowArrow?: boolean;\n};\n\nconst NODE_LEGEND_ENTRIES = {\n render: nodeLegend('render', 'Render', GRAPH_VISUAL_THEME.render.stroke),\n compute: nodeLegend('compute', 'Compute', GRAPH_VISUAL_THEME.compute.stroke),\n copy: nodeLegend('copy', 'Copy', GRAPH_VISUAL_THEME.copy.stroke),\n 'clear-buffer': nodeLegend('clear', 'Clear', GRAPH_VISUAL_THEME.clear.stroke),\n command: nodeLegend('command', 'Command', GRAPH_VISUAL_THEME.command.stroke),\n 'external-submission': { ...nodeLegend('external', 'External', GRAPH_VISUAL_THEME.external.stroke), shape: 'cut-rectangle' as const },\n} as const;\n\nexport function createGraphLegend(snapshot: FrameGraphDebugViewModel): readonly GraphLegendEntry[] {\n const entries: GraphLegendEntry[] = [];\n const passKinds = new Set(snapshot.nodes.map((node) => node.kind));\n for (const kind of ['render', 'compute', 'copy', 'clear-buffer', 'command', 'external-submission'] as const) {\n if (passKinds.has(kind)) entries.push(NODE_LEGEND_ENTRIES[kind]);\n }\n const retained = new Set(snapshot.nodes.map((node) => node.id));\n const used = new Set([\n ...snapshot.accessEdges.filter((access) => retained.has(access.nodeId)).map((access) => access.resource.id),\n ...snapshot.roots.flatMap((root) => root.resource ? [root.resource.id] : []),\n ]);\n const resources = snapshot.resources.filter((resource) => used.has(resource.id));\n if (resources.length) entries.push({ group: 'Resources', key: 'declaration', label: 'Declaration', color: GRAPH_VISUAL_THEME.declaration.stroke, shape: 'ellipse' });\n if (snapshot.roots.some((root) => root.resource)) entries.push({ group: 'Resources', key: 'output', label: 'Output', color: GRAPH_VISUAL_THEME.output.stroke, shape: 'tag' });\n if ([...snapshot.nodes, ...resources].some((item) => item.debugGroupId !== undefined)) {\n entries.push({ group: 'Relationships', key: 'group', label: 'Group', color: GRAPH_VISUAL_THEME.group.stroke, shape: 'group' });\n }\n if (snapshot.edges.some((edge) => edge.kind === 'value')\n || declarationEntrances(snapshot.nodes, snapshot.accessEdges, snapshot.edges).length\n || snapshot.roots.some((root) => root.resource && root.resolution && (root.resolution.usesInitialContents || root.resolution.producerNodeIds.length))) {\n entries.push(edgeLegend('flow', 'Resource Flow', GRAPH_VISUAL_THEME.dependency.value, 'solid'));\n }\n if (snapshot.edges.some((edge) => edge.kind === 'ordering')) {\n entries.push({\n ...edgeLegend('ordering', 'Order', GRAPH_VISUAL_THEME.dependency.ordering, 'dotted'),\n hollowArrow: true,\n });\n }\n return entries;\n}\n\nexport function createGraphStyles(): cytoscape.StylesheetJson {\n const theme = GRAPH_VISUAL_THEME;\n return [\n {\n selector: 'node',\n style: {\n 'shape': 'round-rectangle',\n 'width': 'data(width)',\n 'height': 'data(height)',\n 'label': 'data(displayLabel)',\n 'text-wrap': 'wrap',\n 'text-max-width': '160px',\n 'font-family': 'ui-monospace, SFMono-Regular, Consolas, Liberation Mono, monospace',\n 'font-size': GRAPH_GEOMETRY.baseFontSize,\n 'min-zoomed-font-size': GRAPH_GEOMETRY.minimumZoomedFontSize,\n 'color': theme.text,\n 'background-color': theme.surfaceRaised,\n 'border-color': theme.group.stroke,\n 'border-width': 1.25,\n 'border-style': 'solid',\n 'text-valign': 'center',\n 'text-halign': 'center',\n 'overlay-opacity': 0,\n 'underlay-opacity': 0,\n },\n },\n passStyle('render', theme.render),\n passStyle('compute', theme.compute),\n passStyle('copy', theme.copy),\n passStyle('clear-buffer', theme.clear),\n passStyle('command', theme.command),\n {\n selector: 'node[passKind = \"external-submission\"]',\n style: {\n 'background-color': theme.external.fill,\n 'border-color': theme.external.stroke,\n 'shape': 'cut-rectangle',\n 'corner-radius': '10px',\n },\n },\n {\n selector: 'node[kind = \"resource\"]',\n style: {\n 'shape': 'ellipse',\n 'background-color': theme.declaration.fill,\n 'border-color': theme.declaration.stroke,\n },\n },\n {\n selector: 'node[kind = \"root\"]',\n style: {\n 'shape': 'tag',\n 'background-color': theme.output.fill,\n 'border-color': theme.output.stroke,\n 'text-max-width': `${GRAPH_GEOMETRY.outputLabelWidth}px`,\n // Native tag shoulders sit at 5/8 of its width. Center text in the rectangular body.\n 'text-margin-x': -GRAPH_GEOMETRY.outputWidth * 3 / 16,\n },\n },\n {\n selector: 'node[kind = \"group\"]',\n style: {\n 'text-max-width': (element: cytoscape.SingularElementArgument) => `${element.data('labelMaxWidth') as number}px`,\n },\n },\n {\n selector: 'node[kind = \"group\"][collapsed = 1]',\n style: {\n 'background-color': theme.group.fill,\n 'border-color': theme.group.stroke,\n 'border-width': 2,\n 'color': theme.text,\n },\n },\n {\n selector: 'node[kind = \"group\"][collapsed = 0]',\n style: expandedGroupStyle(theme.group.fill),\n },\n {\n selector: 'node[kind = \"group\"][collapsed = 0][depthBand = 1]',\n style: { 'background-color': theme.group.alternateFill },\n },\n {\n selector: 'edge',\n style: {\n 'width': 1.5,\n 'line-color': theme.dependency.value,\n 'line-opacity': 0.82,\n 'target-arrow-color': theme.dependency.value,\n 'target-arrow-shape': 'triangle',\n 'target-arrow-fill': 'filled',\n 'arrow-scale': 0.8,\n 'curve-style': 'straight',\n 'label': 'data(displayLabel)',\n 'font-family': 'ui-monospace, SFMono-Regular, Consolas, Liberation Mono, monospace',\n 'font-size': 10,\n 'min-zoomed-font-size': GRAPH_GEOMETRY.minimumZoomedFontSize,\n 'color': theme.text,\n 'text-background-color': theme.canvas,\n 'text-background-opacity': 0.82,\n 'text-background-padding': '2px',\n 'text-rotation': 'autorotate',\n 'overlay-opacity': 0,\n 'underlay-opacity': 0,\n },\n },\n {\n selector: 'edge[kind = \"ordering\"]',\n style: {\n 'line-color': theme.dependency.ordering,\n 'target-arrow-color': theme.dependency.ordering,\n 'line-style': 'dotted',\n 'target-arrow-fill': 'hollow',\n 'line-opacity': 0.72,\n },\n },\n {\n selector: 'edge.elk-route',\n style: {\n 'source-endpoint': 'data(sourceEndpoint)',\n 'target-endpoint': 'data(targetEndpoint)',\n 'edge-distances': ENDPOINT_EDGE_DISTANCES,\n },\n },\n {\n selector: 'edge.elk-segments',\n style: {\n 'curve-style': 'round-segments',\n 'segment-distances': 'data(segmentDistances)',\n 'segment-weights': 'data(segmentWeights)',\n 'segment-radii': EDGE_SEGMENT_RADII,\n },\n },\n {\n selector: 'node.semantic-hover',\n style: {\n 'border-color': theme.hover,\n 'border-width': 2,\n 'z-index': 15,\n },\n },\n {\n selector: 'edge.semantic-hover',\n style: {\n 'line-color': theme.hover,\n 'target-arrow-color': theme.hover,\n 'line-opacity': 1,\n 'width': 2.5,\n 'z-index': 15,\n },\n },\n {\n selector: 'node.semantic-selected',\n style: {\n 'border-color': theme.selected,\n 'border-width': 3,\n 'opacity': 1,\n 'z-index': 20,\n },\n },\n {\n selector: 'edge.semantic-selected',\n style: {\n 'line-color': theme.selected,\n 'target-arrow-color': theme.selected,\n 'line-opacity': 1,\n 'width': 3,\n 'z-index': 20,\n },\n },\n ];\n}\n\nexport function nodeDimensions(node: GraphSceneNode): { readonly width: number; readonly height: number } {\n switch (node.kind) {\n case 'pass':\n return { width: 184, height: node.label.includes('\\n') ? 62 : 48 };\n case 'root':\n return { width: GRAPH_GEOMETRY.outputWidth, height: Math.max(58, node.label.split('\\n').length * 17 + 24) };\n case 'resource':\n return { width: 184, height: Math.max(58, node.label.split('\\n').length * 17 + 24) };\n case 'group':\n return node.collapsed ? { width: 224, height: 68 } : { width: 120, height: 80 };\n }\n}\n\nexport function graphLayoutGeometryKey(scene: GraphScene): string {\n return JSON.stringify({\n topology: scene.topologyKey,\n dimensions: scene.nodes.map((node) => {\n const dimensions = nodeDimensions(node);\n return [node.id, dimensions.width, dimensions.height, node.kind === 'pass' && node.passKind === 'external-submission'];\n }),\n });\n}\n\nexport function graphEdgeDisplayLabel(_edge: GraphSceneEdge): string {\n return '';\n}\n\nexport function expandedGroupLabelMaxWidth(outerWidth: number): number {\n return Math.max(80, Math.floor(outerWidth - GRAPH_GEOMETRY.groupTitleInset * 2));\n}\n\nexport function isOverviewGraphScale(zoom: number): boolean {\n return GRAPH_GEOMETRY.baseFontSize * zoom < GRAPH_GEOMETRY.overviewFontThreshold;\n}\n\nfunction nodeLegend(key: string, label: string, color: string): GraphLegendEntry {\n return { group: 'Execution', key, label, color, shape: 'box' };\n}\n\nfunction edgeLegend(\n key: string,\n label: string,\n color: string,\n lineStyle: NonNullable<GraphLegendEntry['lineStyle']>,\n): GraphLegendEntry {\n return { group: 'Relationships', key, label, color, shape: 'line', lineStyle };\n}\n\nfunction passStyle(\n kind: string,\n colors: { readonly stroke: string; readonly fill: string },\n): cytoscape.StylesheetStyle {\n return {\n selector: `node[passKind = \"${kind}\"]`,\n style: { 'background-color': colors.fill, 'border-color': colors.stroke },\n };\n}\n\nfunction expandedGroupStyle(backgroundColor: string): cytoscape.Css.Node {\n const geometry = GRAPH_GEOMETRY;\n return {\n 'background-color': backgroundColor,\n 'background-opacity': 0.34,\n 'border-color': GRAPH_VISUAL_THEME.group.stroke,\n 'border-width': 1.5,\n 'padding': `${geometry.groupPadding}px`,\n 'compound-sizing-wrt-labels': 'include',\n 'min-width': '120px',\n 'min-height': '80px',\n 'text-valign': 'top-inside',\n 'text-halign': 'left-inside',\n 'text-justification': 'left',\n 'text-margin-x': geometry.groupTitleInset - geometry.groupPadding * 2,\n 'text-margin-y': geometry.groupTitleInset - geometry.groupPadding * 2,\n 'line-height': geometry.groupTitleLineHeight,\n 'color': GRAPH_VISUAL_THEME.text,\n 'font-weight': 600,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"panelGraphVisuals.js","sourceRoot":"","sources":["../src/panelGraphVisuals.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAyB,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAiC,MAAM,wBAAwB,CAAC;AAE7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,EAAE;IAChB,qBAAqB,EAAE,CAAC;IACxB,qBAAqB,EAAE,CAAC;IACxB,eAAe,EAAE,CAAC;IAClB,oBAAoB,EAAE,GAAG;IACzB,YAAY,EAAE,EAAE;IAChB,eAAe,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IAC7D,gBAAgB,EAAE,CAAC;IACnB,WAAW,EAAE,GAAG;IAChB,cAAc,EAAE,EAAE;IAClB,gBAAgB,EAAE,GAAG;CACf,CAAC;AAEX,MAAM,uBAAuB,GA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e,EAAE,QAAQ,CAAC,eAAe,GAAG,QAAQ,CAAC,YAAY,GAAG,CAAC;QACrE,aAAa,EAAE,QAAQ,CAAC,oBAAoB;QAC5C,OAAO,EAAE,KAAK,CAAC,IAAI;QACnB,aAAa,EAAE,GAAG;KACrB,CAAC;AACN,CAAC","sourcesContent":["import type cytoscape from 'cytoscape';\n\nimport type { GraphScene, GraphSceneEdge, GraphSceneNode } from './panelGraphScene.ts';\nimport { GRAPH_VISUAL_THEME, type GraphVisualTheme } from './panelVisualTheme.ts';\nimport { declarationEntrances, type FrameGraphDebugViewModel } from './debugCaptureModel.ts';\n\nexport { GRAPH_VISUAL_THEME } from './panelVisualTheme.ts';\n\n\nexport const GRAPH_GEOMETRY = {\n fitPadding: 28,\n baseFontSize: 13,\n overviewFontThreshold: 9,\n minimumZoomedFontSize: 5,\n groupTitleInset: 8,\n groupTitleLineHeight: 1.2,\n groupPadding: 32,\n elkGroupPadding: { top: 46, right: 24, bottom: 24, left: 24 },\n edgeCornerRadius: 6,\n outputWidth: 208,\n outputTipWidth: 24,\n outputLabelWidth: 160,\n} as const;\n\nconst ENDPOINT_EDGE_DISTANCES = 'endpoints' as unknown as cytoscape.Css.Edge['edge-distances'];\nconst EDGE_SEGMENT_RADII = `${GRAPH_GEOMETRY.edgeCornerRadius}px` as unknown as cytoscape.Css.Edge['segment-radii'];\n\nexport type GraphLegendEntry = {\n readonly group: 'Execution' | 'Resources' | 'Relationships';\n readonly key: string;\n readonly label: string;\n readonly color: string;\n readonly shape: 'box' | 'cut-rectangle' | 'tag' | 'ellipse' | 'group' | 'line';\n readonly lineStyle?: 'solid' | 'dotted' | 'dashed';\n readonly hollowArrow?: boolean;\n};\n\nexport function createGraphLegend(snapshot: FrameGraphDebugViewModel, theme: GraphVisualTheme = GRAPH_VISUAL_THEME, showResourceDeclarations = true): readonly GraphLegendEntry[] {\n const nodeEntries = {\n render: nodeLegend('render', 'Render', theme.render.stroke),\n compute: nodeLegend('compute', 'Compute', theme.compute.stroke),\n copy: nodeLegend('copy', 'Copy', theme.copy.stroke),\n 'clear-buffer': nodeLegend('clear', 'Clear', theme.clear.stroke),\n command: nodeLegend('command', 'Command', theme.command.stroke),\n 'external-submission': { ...nodeLegend('external', 'External', theme.external.stroke), shape: 'cut-rectangle' as const },\n } as const;\n\n const entries: GraphLegendEntry[] = [];\n const passKinds = new Set(snapshot.nodes.map((node) => node.kind));\n for (const kind of ['render', 'compute', 'copy', 'clear-buffer', 'command', 'external-submission'] as const) {\n if (passKinds.has(kind)) entries.push(nodeEntries[kind]);\n }\n const retained = new Set(snapshot.nodes.map((node) => node.id));\n const used = new Set([\n ...snapshot.accessEdges.filter((access) => retained.has(access.nodeId)).map((access) => access.resource.id),\n ...snapshot.roots.flatMap((root) => root.resource ? [root.resource.id] : []),\n ]);\n const resources = showResourceDeclarations ? snapshot.resources.filter((resource) => used.has(resource.id)) : [];\n if (resources.length) entries.push({ group: 'Resources', key: 'declaration', label: 'Declaration', color: theme.declaration.stroke, shape: 'ellipse' });\n if (snapshot.roots.some((root) => root.resource)) entries.push({ group: 'Resources', key: 'output', label: 'Output', color: theme.output.stroke, shape: 'tag' });\n if ([...snapshot.nodes, ...resources].some((item) => item.debugGroupId !== undefined)) {\n entries.push({ group: 'Relationships', key: 'group', label: 'Group', color: theme.group.stroke, shape: 'group' });\n }\n if (snapshot.edges.some((edge) => edge.kind === 'value')\n || (showResourceDeclarations && declarationEntrances(snapshot.nodes, snapshot.accessEdges, snapshot.edges).length)\n || snapshot.roots.some((root) => root.resource && root.resolution && ((showResourceDeclarations && root.resolution.usesInitialContents) || root.resolution.producerNodeIds.length))) {\n entries.push(edgeLegend('flow', 'Resource Flow', theme.dependency.value, 'solid'));\n }\n if (snapshot.edges.some((edge) => edge.kind === 'ordering')) {\n entries.push({\n ...edgeLegend('ordering', 'Order', theme.dependency.ordering, 'dotted'),\n hollowArrow: true,\n });\n }\n return entries;\n}\n\nexport function createGraphStyles(theme: GraphVisualTheme = GRAPH_VISUAL_THEME): cytoscape.StylesheetJson {\n return [\n {\n selector: 'core',\n style: {\n 'active-bg-color': theme.activeBackground.color,\n 'active-bg-opacity': theme.activeBackground.opacity,\n 'active-bg-size': theme.activeBackground.size,\n // Cytoscape accepts partial core styles; its Core type marks every property required.\n } satisfies Partial<cytoscape.Css.Core> as cytoscape.Css.Core,\n },\n {\n selector: 'node',\n style: {\n 'shape': 'round-rectangle',\n 'width': 'data(width)',\n 'height': 'data(height)',\n 'label': 'data(displayLabel)',\n 'text-wrap': 'wrap',\n 'text-max-width': 'data(labelMaxWidth)',\n 'font-family': theme.fontFamily,\n 'font-size': (element: cytoscape.SingularElementArgument) => (element.data('labelFontSize') as number | undefined) ?? theme.fontSize,\n 'line-height': 1.2,\n 'min-zoomed-font-size': GRAPH_GEOMETRY.minimumZoomedFontSize,\n 'color': theme.text,\n 'background-color': theme.surfaceRaised,\n 'border-color': theme.group.stroke,\n 'border-width': theme.nodeBorderWidth,\n 'border-style': 'solid',\n 'text-valign': 'center',\n 'text-halign': 'center',\n 'overlay-opacity': 0,\n 'underlay-opacity': 0,\n },\n },\n passStyle('render', theme.render),\n passStyle('compute', theme.compute),\n passStyle('copy', theme.copy),\n passStyle('clear-buffer', theme.clear),\n passStyle('command', theme.command),\n {\n selector: 'node[passKind = \"external-submission\"]',\n style: {\n 'background-color': theme.external.fill,\n 'border-color': theme.external.stroke,\n 'shape': 'cut-rectangle',\n 'corner-radius': '10px',\n },\n },\n {\n selector: 'node[kind = \"resource\"]',\n style: {\n 'shape': 'ellipse',\n 'background-color': theme.declaration.fill,\n 'border-color': theme.declaration.stroke,\n },\n },\n {\n selector: 'node[kind = \"root\"]',\n style: {\n 'shape': 'polygon',\n 'shape-polygon-points': `-1 -1 ${1 - 2 * GRAPH_GEOMETRY.outputTipWidth / GRAPH_GEOMETRY.outputWidth} -1 1 0 ${1 - 2 * GRAPH_GEOMETRY.outputTipWidth / GRAPH_GEOMETRY.outputWidth} 1 -1 1`,\n 'background-color': theme.output.fill,\n 'border-color': theme.output.stroke,\n 'text-max-width': 'data(labelMaxWidth)',\n // Keep a short tip and center the label in the rectangular body.\n 'text-margin-x': -GRAPH_GEOMETRY.outputTipWidth / 2 * theme.fontSize / GRAPH_GEOMETRY.baseFontSize,\n },\n },\n {\n selector: 'node[kind = \"group\"]',\n style: {\n 'text-max-width': (element: cytoscape.SingularElementArgument) => `${element.data('labelMaxWidth') as number}px`,\n },\n },\n {\n selector: 'node[kind = \"group\"][collapsed = 1]',\n style: {\n 'background-color': theme.group.fill,\n 'border-color': theme.group.stroke,\n 'border-width': theme.groupBorderWidth,\n 'color': theme.text,\n },\n },\n {\n selector: 'node[kind = \"group\"][collapsed = 0]',\n style: expandedGroupStyle(theme.group.fill, theme),\n },\n {\n selector: 'node[kind = \"group\"][collapsed = 0][depthBand = 1]',\n style: { 'background-color': theme.group.alternateFill },\n },\n {\n selector: 'edge',\n style: {\n 'width': theme.edgeWidth,\n 'line-color': theme.dependency.value,\n 'line-opacity': theme.edgeOpacity,\n 'target-arrow-color': theme.dependency.value,\n 'target-arrow-shape': 'triangle',\n 'target-arrow-fill': 'filled',\n 'arrow-scale': theme.arrowScale,\n 'curve-style': 'straight',\n 'label': 'data(displayLabel)',\n 'font-family': theme.fontFamily,\n 'font-size': 10,\n 'min-zoomed-font-size': GRAPH_GEOMETRY.minimumZoomedFontSize,\n 'color': theme.text,\n 'text-background-color': theme.canvas,\n 'text-background-opacity': 0.82,\n 'text-background-padding': '2px',\n 'text-rotation': 'autorotate',\n 'overlay-opacity': 0,\n 'underlay-opacity': 0,\n },\n },\n {\n selector: 'edge[kind = \"ordering\"]',\n style: {\n 'line-color': theme.dependency.ordering,\n 'target-arrow-color': theme.dependency.ordering,\n 'line-style': 'dotted',\n 'target-arrow-fill': 'hollow',\n 'line-opacity': theme.orderingOpacity,\n },\n },\n {\n selector: 'edge.elk-route',\n style: {\n 'source-endpoint': 'data(sourceEndpoint)',\n 'target-endpoint': 'data(targetEndpoint)',\n 'edge-distances': ENDPOINT_EDGE_DISTANCES,\n },\n },\n {\n selector: 'edge.elk-segments',\n style: {\n 'curve-style': 'round-segments',\n 'segment-distances': 'data(segmentDistances)',\n 'segment-weights': 'data(segmentWeights)',\n 'segment-radii': EDGE_SEGMENT_RADII,\n },\n },\n {\n selector: 'node.semantic-hover',\n style: {\n 'border-color': theme.hover,\n 'border-width': theme.hoverWidth,\n 'z-index': 15,\n },\n },\n {\n selector: 'edge.semantic-hover',\n style: {\n 'line-color': theme.hover,\n 'target-arrow-color': theme.hover,\n 'line-opacity': 1,\n 'width': theme.hoverWidth,\n 'z-index': 15,\n },\n },\n {\n selector: 'node.semantic-selected',\n style: {\n 'border-color': theme.selected,\n 'border-width': theme.selectedWidth,\n 'opacity': 1,\n 'z-index': 20,\n },\n },\n {\n selector: 'edge.semantic-selected',\n style: {\n 'line-color': theme.selected,\n 'target-arrow-color': theme.selected,\n 'line-opacity': 1,\n 'width': theme.selectedWidth,\n 'z-index': 20,\n },\n },\n ];\n}\n\nfunction baseNodeDimensions(node: GraphSceneNode): { readonly width: number; readonly height: number } {\n switch (node.kind) {\n case 'pass':\n return { width: 184, height: node.label.includes('\\n') ? 62 : 48 };\n case 'root':\n return { width: GRAPH_GEOMETRY.outputWidth, height: Math.max(58, node.label.split('\\n').length * 17 + 24) };\n case 'resource':\n return { width: 184, height: Math.max(58, node.label.split('\\n').length * 17 + 24) };\n case 'group':\n return node.collapsed ? { width: 240, height: 80 } : { width: 120, height: 80 };\n }\n}\n\nexport function nodeDimensions(node: GraphSceneNode, theme: GraphVisualTheme = GRAPH_VISUAL_THEME): { readonly width: number; readonly height: number } {\n const base = baseNodeDimensions(node);\n const scale = theme.fontSize / GRAPH_GEOMETRY.baseFontSize;\n return { width: base.width * scale, height: base.height * scale };\n}\n\n/** Enlarge short labels within the existing box; retain the theme size for dense text. */\nexport function graphLabelFontSize(label: string, width: number, height: number, theme: GraphVisualTheme): number {\n const context = graphTextContext();\n if (context) context.font = theme.fontSize + 'px ' + theme.fontFamily;\n const lines = label.split('\\n');\n const widest = Math.max(1, ...lines.map(line => context?.measureText(line).width ?? [...line].length * theme.fontSize * .62));\n const widthScale = width / widest;\n const heightScale = height / (lines.length * theme.fontSize * 1.2);\n return Math.max(theme.fontSize, Math.floor(theme.fontSize * Math.min(1.25, widthScale, heightScale) * 4) / 4);\n}\n\n/** Wrap only the group name (up to two lines); keep the node-count row distinct. */\nexport function fitCollapsedGroupLabel(label: string, width: number, theme: GraphVisualTheme): string {\n const [name = '', ...summary] = label.split('\\n');\n const context = graphTextContext();\n if (context) context.font = theme.fontSize + 'px ' + theme.fontFamily;\n const measure = (text: string) => context?.measureText(text).width ?? [...text].length * theme.fontSize * .62;\n const chars = [...name];\n let split = 0;\n while (split < chars.length && measure(chars.slice(0, split + 1).join('')) <= width) split++;\n if (split === chars.length) return fitGraphLabel(label, width, theme);\n // Prefer a word/path boundary without losing characters, including Unicode.\n const prefix = chars.slice(0, split).join('');\n const boundary = Math.max(prefix.lastIndexOf(' '), prefix.lastIndexOf('.'), prefix.lastIndexOf('/'));\n if (boundary > prefix.length / 2) split = [...prefix.slice(0, boundary + 1)].length;\n return fitGraphLabel([\n chars.slice(0, split).join('').trimEnd(),\n chars.slice(split).join('').trimStart(),\n ...summary,\n ].join('\\n'), width, theme);\n}\n\n/** Fit the already semantic label to its available width after font changes. */\nexport function fitGraphLabel(label: string, width: number, theme: GraphVisualTheme): string {\n const context = graphTextContext();\n if (context) context.font = theme.fontSize + 'px ' + theme.fontFamily;\n const measure = (text: string) => context?.measureText(text).width ?? [...text].length * theme.fontSize * .62;\n return label.split('\\n').map(line => {\n if (measure(line) <= width) return line;\n const chars = [...line];\n while (chars.length && measure(chars.join('') + '…') > width) chars.pop();\n return chars.join('') + '…';\n }).join('\\n');\n}\n\nlet textContext: CanvasRenderingContext2D | null | undefined;\nfunction graphTextContext(): CanvasRenderingContext2D | null {\n if (typeof document === 'undefined') return null;\n if (textContext === undefined) textContext = document.createElement('canvas').getContext('2d');\n return textContext;\n}\n\nexport function graphLayoutGeometryKey(scene: GraphScene): string {\n return JSON.stringify({\n topology: scene.topologyKey,\n dimensions: scene.nodes.map((node) => {\n const dimensions = nodeDimensions(node);\n return [node.id, dimensions.width, dimensions.height, node.kind === 'pass' && node.passKind === 'external-submission'];\n }),\n });\n}\n\nexport function graphEdgeDisplayLabel(_edge: GraphSceneEdge): string {\n return '';\n}\n\nexport function expandedGroupLabelMaxWidth(outerWidth: number): number {\n return Math.max(80, Math.floor(outerWidth - GRAPH_GEOMETRY.groupTitleInset * 2));\n}\n\nexport function isOverviewGraphScale(zoom: number, theme: GraphVisualTheme = GRAPH_VISUAL_THEME): boolean {\n return theme.fontSize * zoom < GRAPH_GEOMETRY.overviewFontThreshold;\n}\n\nfunction nodeLegend(key: string, label: string, color: string): GraphLegendEntry {\n return { group: 'Execution', key, label, color, shape: 'box' };\n}\n\nfunction edgeLegend(\n key: string,\n label: string,\n color: string,\n lineStyle: NonNullable<GraphLegendEntry['lineStyle']>,\n): GraphLegendEntry {\n return { group: 'Relationships', key, label, color, shape: 'line', lineStyle };\n}\n\nfunction passStyle(\n kind: string,\n colors: { readonly stroke: string; readonly fill: string },\n): cytoscape.StylesheetStyle {\n return {\n selector: `node[passKind = \"${kind}\"]`,\n style: { 'background-color': colors.fill, 'border-color': colors.stroke },\n };\n}\n\nfunction expandedGroupStyle(backgroundColor: string, theme: GraphVisualTheme): cytoscape.Css.Node {\n const geometry = GRAPH_GEOMETRY;\n return {\n 'background-color': backgroundColor,\n 'background-opacity': theme.groupOpacity,\n 'border-color': theme.group.stroke,\n 'border-width': theme.groupBorderWidth,\n 'padding': `${geometry.groupPadding}px`,\n 'compound-sizing-wrt-labels': 'exclude',\n 'text-wrap': 'ellipsis',\n 'min-width': '120px',\n 'min-height': '80px',\n 'text-valign': 'top-inside',\n 'text-halign': 'left-inside',\n 'text-justification': 'left',\n 'text-margin-x': geometry.groupTitleInset - geometry.groupPadding * 2,\n 'text-margin-y': geometry.groupTitleInset - geometry.groupPadding * 2,\n 'line-height': geometry.groupTitleLineHeight,\n 'color': theme.text,\n 'font-weight': 600,\n };\n}\n"]}
|
|
@@ -14,6 +14,7 @@ export declare class InspectorView {
|
|
|
14
14
|
private activeTab;
|
|
15
15
|
private open;
|
|
16
16
|
private hoveredLink;
|
|
17
|
+
private rawCache;
|
|
17
18
|
constructor(callbacks: WorkbenchCallbacks, onOpenChange: (open: boolean) => void, idPrefix: string);
|
|
18
19
|
setSnapshot(snapshot: FrameGraphDebugViewModel): void;
|
|
19
20
|
setSelection(selected: Selection | undefined, reveal?: boolean): void;
|
|
@@ -34,5 +35,12 @@ export declare class InspectorView {
|
|
|
34
35
|
private summary;
|
|
35
36
|
private accessNodeLabel;
|
|
36
37
|
private accessNodeSelection;
|
|
38
|
+
private nodeLink;
|
|
39
|
+
private primaryPage;
|
|
40
|
+
private revealButton;
|
|
41
|
+
private createLocationActions;
|
|
42
|
+
private selectionId;
|
|
43
|
+
private copyId;
|
|
44
|
+
private createDiagnostics;
|
|
37
45
|
}
|
|
38
46
|
//# sourceMappingURL=panelInspectorView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelInspectorView.d.ts","sourceRoot":"","sources":["../src/panelInspectorView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIX,wBAAwB,EACxB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"panelInspectorView.d.ts","sourceRoot":"","sources":["../src/panelInspectorView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIX,wBAAwB,EACxB,MAAM,wBAAwB,CAAC;AAKhC,OAAO,KAAK,EAAgB,SAAS,EAAgB,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAUN,KAAK,kBAAkB,EACvB,MAAM,4BAA4B,CAAC;AA2BpC,qBAAa,aAAa;IAcxB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAd9B,QAAQ,CA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