@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":"panelGraphLayout.js","sourceRoot":"","sources":["../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port type { GraphScene, GraphSceneElementId, GraphSceneNode } from './panelGraphScene.ts';\nimport { expandedGroupLabelMaxWidth, GRAPH_GEOMETRY, nodeDimensions } from './panelGraphVisuals.ts';\n\nexport type GraphPosition = { readonly x: number; readonly y: number };\nexport type GraphEdgeRoute = {\n readonly startPoint: GraphPosition;\n readonly bendPoints: readonly GraphPosition[];\n readonly endPoint: GraphPosition;\n};\nexport type GraphLayoutResult = {\n readonly positions: ReadonlyMap<GraphSceneElementId, GraphPosition>;\n readonly routes: ReadonlyMap<GraphSceneElementId, GraphEdgeRoute>;\n};\n\nexport type CytoscapeEdgeRouteData = {\n readonly sourceEndpoint: string;\n readonly targetEndpoint: string;\n readonly segmentWeights: string;\n readonly segmentDistances: string;\n};\n\nexport async function layoutGraphScene(elk: ELK, scene: GraphScene): Promise<GraphLayoutResult> {\n const graph = createElkLayoutGraph(scene);\n const layout = await elk.layout(graph);\n const positions = new Map<GraphSceneElementId, GraphPosition>();\n collectLayoutPositions(layout, 0, 0, positions);\n const nodeOffsets = new Map<GraphSceneElementId, GraphPosition>();\n collectLayoutOffsets(layout, 0, 0, nodeOffsets);\n const routes = new Map<GraphSceneElementId, GraphEdgeRoute>();\n collectEdgeRoutes(layout, 0, 0, nodeOffsets, routes);\n return { positions, routes };\n}\n\nfunction usesCenterPorts(node: GraphSceneNode): boolean {\n return node.kind === 'resource' || node.kind === 'root'\n || (node.kind === 'pass' && node.passKind === 'external-submission');\n}\n\nexport function createElkLayoutGraph(scene: GraphScene): ElkNode {\n const childrenByParent = new Map<GraphSceneElementId | undefined, GraphSceneNode[]>();\n const portsByNode = new Map<GraphSceneElementId, ElkPort[]>();\n const nodesById = new Map(scene.nodes.map((node) => [node.id, node]));\n const boundaryPort = (id: string, source: boolean) => {\n const node = nodesById.get(id)!;\n if (!usesCenterPorts(node)) return {};\n const dimensions = nodeDimensions(node);\n return { x: source ? dimensions.width : 0, y: dimensions.height / 2 };\n };\n const elkEdges = scene.edges.map((edge): ElkExtendedEdge => {\n const sourcePortId = `${edge.id}:source`;\n const targetPortId = `${edge.id}:target`;\n appendPort(portsByNode, edge.from, {\n id: sourcePortId,\n ...boundaryPort(edge.from, true),\n width: 1,\n height: 1,\n layoutOptions: { 'elk.port.side': 'EAST' },\n });\n appendPort(portsByNode, edge.to, {\n id: targetPortId,\n ...boundaryPort(edge.to, false),\n width: 1,\n height: 1,\n layoutOptions: { 'elk.port.side': 'WEST' },\n });\n return {\n id: edge.id,\n sources: [sourcePortId],\n targets: [targetPortId],\n };\n });\n for (const node of scene.nodes) {\n const children = childrenByParent.get(node.parentId) ?? [];\n children.push(node);\n childrenByParent.set(node.parentId, children);\n }\n const createNode = (node: GraphSceneNode): ElkNode => {\n const children = childrenByParent.get(node.id)?.map(createNode);\n const dimensions = nodeDimensions(node);\n return {\n id: node.id,\n width: dimensions.width,\n height: dimensions.height,\n children,\n ports: portsByNode.get(node.id),\n layoutOptions: children?.length ? {\n 'elk.algorithm': 'layered',\n 'elk.direction': 'RIGHT',\n 'elk.edgeRouting': 'ORTHOGONAL',\n 'elk.hierarchyHandling': 'INCLUDE_CHILDREN',\n 'elk.portConstraints': 'FIXED_SIDE',\n 'elk.layered.mergeEdges': 'false',\n 'elk.layered.mergeHierarchyEdges': 'false',\n 'elk.padding': elkPadding(),\n 'elk.spacing.nodeNode': '36',\n 'elk.layered.spacing.nodeNodeBetweenLayers': '72',\n 'elk.spacing.edgeEdge': '10',\n 'elk.layered.spacing.edgeEdgeBetweenLayers': '10',\n } : {\n 'elk.portConstraints': usesCenterPorts(node) ? 'FIXED_POS' : 'FIXED_SIDE',\n },\n };\n };\n return {\n id: 'root',\n children: (childrenByParent.get(undefined) ?? []).map(createNode),\n edges: elkEdges,\n layoutOptions: {\n 'elk.algorithm': 'layered',\n 'elk.direction': 'RIGHT',\n 'elk.edgeRouting': 'ORTHOGONAL',\n 'elk.hierarchyHandling': 'INCLUDE_CHILDREN',\n 'elk.layered.mergeEdges': 'false',\n 'elk.layered.mergeHierarchyEdges': 'false',\n 'elk.spacing.nodeNode': '42',\n 'elk.layered.spacing.nodeNodeBetweenLayers': '88',\n 'elk.spacing.edgeNode': '20',\n 'elk.spacing.edgeEdge': '10',\n 'elk.layered.spacing.edgeEdgeBetweenLayers': '10',\n 'elk.layered.considerModelOrder.strategy': 'NODES_AND_EDGES',\n },\n };\n}\n\nexport function applyGraphLayout(core: cytoscape.Core, scene: GraphScene, layout: GraphLayoutResult): void {\n applyPositions(core, layout.positions);\n core.batch(() => {\n for (const edge of scene.edges) {\n const route = layout.routes.get(edge.id);\n const cytoscapeEdge = core.getElementById(edge.id);\n if (cytoscapeEdge.empty()) continue;\n const sourceNode = core.getElementById(edge.from);\n const targetNode = core.getElementById(edge.to);\n const routeData = sourceNode.nonempty() && targetNode.nonempty()\n ? createCytoscapeEdgeRouteData(route, sourceNode.position(), targetNode.position())\n : undefined;\n cytoscapeEdge\n .removeClass('elk-route elk-segments')\n .removeData('sourceEndpoint', 'targetEndpoint', 'segmentWeights', 'segmentDistances');\n if (!routeData) continue;\n cytoscapeEdge.data(routeData).addClass('elk-route');\n if (route!.bendPoints.length > 0) cytoscapeEdge.addClass('elk-segments');\n }\n });\n}\n\nexport function syncExpandedGroupLabelGeometry(core: cytoscape.Core): void {\n const groups = core.nodes('node[kind = \"group\"][collapsed = 0]');\n for (let iteration = 0; iteration < 2; iteration++) {\n const updates = groups.map((node) => ({\n node,\n labelMaxWidth: expandedGroupLabelMaxWidth(node.outerWidth()),\n }));\n core.batch(() => {\n for (const update of updates) update.node.data('labelMaxWidth', update.labelMaxWidth);\n });\n }\n}\n\nexport function createCytoscapeEdgeRouteData(\n route: GraphEdgeRoute | undefined,\n sourceCenter: GraphPosition,\n targetCenter: GraphPosition,\n): CytoscapeEdgeRouteData | undefined {\n if (!route || !isValidRoute(route)) return undefined;\n const segments = route.bendPoints.map((point) => segmentFromPoint(route.startPoint, route.endPoint, point));\n return {\n sourceEndpoint: endpointOffset(route.startPoint, sourceCenter),\n targetEndpoint: endpointOffset(route.endPoint, targetCenter),\n segmentWeights: segments.map((segment) => segment.weight).join(' '),\n segmentDistances: segments.map((segment) => segment.distance).join(' '),\n };\n}\n\nfunction elkPadding(): string {\n const padding = GRAPH_GEOMETRY.elkGroupPadding;\n return `[top=${padding.top},left=${padding.left},bottom=${padding.bottom},right=${padding.right}]`;\n}\n\nfunction appendPort(\n portsByNode: Map<GraphSceneElementId, ElkPort[]>,\n nodeId: GraphSceneElementId,\n port: ElkPort,\n): void {\n const ports = portsByNode.get(nodeId) ?? [];\n ports.push(port);\n portsByNode.set(nodeId, ports);\n}\n\nfunction collectLayoutPositions(\n node: ElkNode,\n offsetX: number,\n offsetY: number,\n positions: Map<GraphSceneElementId, GraphPosition>,\n): void {\n for (const child of node.children ?? []) {\n const x = offsetX + (child.x ?? 0);\n const y = offsetY + (child.y ?? 0);\n positions.set(child.id, {\n x: x + (child.width ?? 0) / 2,\n y: y + (child.height ?? 0) / 2,\n });\n collectLayoutPositions(child, x, y, positions);\n }\n}\n\nfunction collectLayoutOffsets(\n node: ElkNode,\n offsetX: number,\n offsetY: number,\n offsets: Map<GraphSceneElementId, GraphPosition>,\n): void {\n offsets.set(node.id, { x: offsetX, y: offsetY });\n for (const child of node.children ?? []) {\n collectLayoutOffsets(child, offsetX + (child.x ?? 0), offsetY + (child.y ?? 0), offsets);\n }\n}\n\nfunction collectEdgeRoutes(\n node: ElkNode,\n offsetX: number,\n offsetY: number,\n nodeOffsets: ReadonlyMap<GraphSceneElementId, GraphPosition>,\n routes: Map<GraphSceneElementId, GraphEdgeRoute>,\n): void {\n for (const edge of node.edges ?? []) {\n if (edge.sections?.length !== 1) continue;\n const section = edge.sections[0];\n if (!section) continue;\n // ELK may keep hierarchy edges on an ancestor while expressing their sections in container-local coordinates.\n const containerOffset = edge.container === undefined ? undefined : nodeOffsets.get(edge.container);\n const routeOffsetX = containerOffset?.x ?? offsetX;\n const routeOffsetY = containerOffset?.y ?? offsetY;\n routes.set(edge.id, {\n startPoint: offsetPoint(section.startPoint, routeOffsetX, routeOffsetY),\n bendPoints: (section.bendPoints ?? []).map((point) => offsetPoint(point, routeOffsetX, routeOffsetY)),\n endPoint: offsetPoint(section.endPoint, routeOffsetX, routeOffsetY),\n });\n }\n for (const child of node.children ?? []) {\n collectEdgeRoutes(\n child,\n offsetX + (child.x ?? 0),\n offsetY + (child.y ?? 0),\n nodeOffsets,\n routes,\n );\n }\n}\n\nfunction offsetPoint(point: GraphPosition, offsetX: number, offsetY: number): GraphPosition {\n return { x: point.x + offsetX, y: point.y + offsetY };\n}\n\nfunction isValidRoute(route: GraphEdgeRoute): boolean {\n const dx = route.endPoint.x - route.startPoint.x;\n const dy = route.endPoint.y - route.startPoint.y;\n return isFinitePoint(route.startPoint)\n && isFinitePoint(route.endPoint)\n && dx * dx + dy * dy > Number.EPSILON\n && route.bendPoints.every(isFinitePoint);\n}\n\nfunction isFinitePoint(point: GraphPosition): boolean {\n return Number.isFinite(point.x) && Number.isFinite(point.y);\n}\n\nfunction endpointOffset(point: GraphPosition, center: GraphPosition): string {\n return `${point.x - center.x}px ${point.y - center.y}px`;\n}\n\nfunction applyPositions(core: cytoscape.Core, positions: ReadonlyMap<GraphSceneElementId, GraphPosition>): void {\n core.batch(() => {\n for (const [id, position] of positions) {\n const node = core.getElementById(id);\n if (node.nonempty() && node.isNode() && !node.isParent()) node.position(position);\n }\n });\n}\n\nfunction segmentFromPoint(source: GraphPosition, target: GraphPosition, point: GraphPosition) {\n const dx = target.x - source.x;\n const dy = target.y - source.y;\n const lengthSquared = dx * dx + dy * dy;\n if (lengthSquared === 0) return { weight: 0.5, distance: 0 };\n const weight = ((point.x - source.x) * dx + (point.y - source.y) * dy) / lengthSquared;\n const projectedX = source.x + weight * dx;\n const projectedY = source.y + weight * dy;\n const length = Math.sqrt(lengthSquared);\n const distance = ((point.x - projectedX) * -dy + (point.y - projectedY) * dx) / length;\n return { weight, distance };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"panelGraphLayout.js","sourceRoot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O,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAChC,CAAC","sourcesContent":["import { GRAPH_VISUAL_THEME, type GraphVisualTheme } from './panelVisualTheme.ts';\nimport type cytoscape from 'cytoscape';\nimport type { ELK, ElkExtendedEdge, ElkNode, ElkPort } from 'elkjs/lib/elk-api';\n\nimport type { GraphScene, GraphSceneElementId, GraphSceneNode } from './panelGraphScene.ts';\nimport { expandedGroupLabelMaxWidth, GRAPH_GEOMETRY, nodeDimensions } from './panelGraphVisuals.ts';\n\nexport type GraphPosition = { readonly x: number; readonly y: number };\nexport type GraphEdgeRoute = {\n readonly startPoint: GraphPosition;\n readonly bendPoints: readonly GraphPosition[];\n readonly endPoint: GraphPosition;\n};\nexport type GraphLayoutResult = {\n readonly positions: ReadonlyMap<GraphSceneElementId, GraphPosition>;\n readonly routes: ReadonlyMap<GraphSceneElementId, GraphEdgeRoute>;\n};\n\nexport type CytoscapeEdgeRouteData = {\n readonly sourceEndpoint: string;\n readonly targetEndpoint: string;\n readonly segmentWeights: string;\n readonly segmentDistances: string;\n};\n\nexport async function layoutGraphScene(elk: ELK, scene: GraphScene, theme: GraphVisualTheme = GRAPH_VISUAL_THEME): Promise<GraphLayoutResult> {\n const graph = createElkLayoutGraph(scene, theme);\n const layout = await elk.layout(graph);\n const positions = new Map<GraphSceneElementId, GraphPosition>();\n collectLayoutPositions(layout, 0, 0, positions);\n const nodeOffsets = new Map<GraphSceneElementId, GraphPosition>();\n collectLayoutOffsets(layout, 0, 0, nodeOffsets);\n const routes = new Map<GraphSceneElementId, GraphEdgeRoute>();\n collectEdgeRoutes(layout, 0, 0, nodeOffsets, routes);\n return { positions, routes };\n}\n\nfunction usesCenterPorts(node: GraphSceneNode): boolean {\n return node.kind === 'resource' || node.kind === 'root'\n || (node.kind === 'pass' && node.passKind === 'external-submission');\n}\n\nexport function createElkLayoutGraph(scene: GraphScene, theme: GraphVisualTheme = GRAPH_VISUAL_THEME): ElkNode {\n const childrenByParent = new Map<GraphSceneElementId | undefined, GraphSceneNode[]>();\n const portsByNode = new Map<GraphSceneElementId, ElkPort[]>();\n const nodesById = new Map(scene.nodes.map((node) => [node.id, node]));\n const boundaryPort = (id: string, source: boolean) => {\n const node = nodesById.get(id)!;\n if (!usesCenterPorts(node)) return {};\n const dimensions = nodeDimensions(node, theme);\n return { x: source ? dimensions.width : 0, y: dimensions.height / 2 };\n };\n const elkEdges = scene.edges.map((edge): ElkExtendedEdge => {\n const sourcePortId = `${edge.id}:source`;\n const targetPortId = `${edge.id}:target`;\n appendPort(portsByNode, edge.from, {\n id: sourcePortId,\n ...boundaryPort(edge.from, true),\n width: 1,\n height: 1,\n layoutOptions: { 'elk.port.side': 'EAST' },\n });\n appendPort(portsByNode, edge.to, {\n id: targetPortId,\n ...boundaryPort(edge.to, false),\n width: 1,\n height: 1,\n layoutOptions: { 'elk.port.side': 'WEST' },\n });\n return {\n id: edge.id,\n sources: [sourcePortId],\n targets: [targetPortId],\n };\n });\n for (const node of scene.nodes) {\n const children = childrenByParent.get(node.parentId) ?? [];\n children.push(node);\n childrenByParent.set(node.parentId, children);\n }\n const createNode = (node: GraphSceneNode): ElkNode => {\n const children = childrenByParent.get(node.id)?.map(createNode);\n const dimensions = nodeDimensions(node, theme);\n return {\n id: node.id,\n width: dimensions.width,\n height: dimensions.height,\n children,\n ports: portsByNode.get(node.id),\n layoutOptions: children?.length ? {\n 'elk.algorithm': 'layered',\n 'elk.direction': 'RIGHT',\n 'elk.edgeRouting': 'ORTHOGONAL',\n 'elk.hierarchyHandling': 'INCLUDE_CHILDREN',\n 'elk.portConstraints': 'FIXED_SIDE',\n 'elk.layered.mergeEdges': 'false',\n 'elk.layered.mergeHierarchyEdges': 'false',\n 'elk.padding': elkPadding(),\n 'elk.spacing.nodeNode': '36',\n 'elk.layered.spacing.nodeNodeBetweenLayers': '72',\n 'elk.spacing.edgeEdge': '10',\n 'elk.layered.spacing.edgeEdgeBetweenLayers': '10',\n } : {\n 'elk.portConstraints': usesCenterPorts(node) ? 'FIXED_POS' : 'FIXED_SIDE',\n },\n };\n };\n return {\n id: 'root',\n children: (childrenByParent.get(undefined) ?? []).map(createNode),\n edges: elkEdges,\n layoutOptions: {\n 'elk.algorithm': 'layered',\n 'elk.direction': 'RIGHT',\n 'elk.edgeRouting': 'ORTHOGONAL',\n 'elk.hierarchyHandling': 'INCLUDE_CHILDREN',\n 'elk.layered.mergeEdges': 'false',\n 'elk.layered.mergeHierarchyEdges': 'false',\n 'elk.spacing.nodeNode': '42',\n 'elk.layered.spacing.nodeNodeBetweenLayers': '88',\n 'elk.spacing.edgeNode': '20',\n 'elk.spacing.edgeEdge': '10',\n 'elk.layered.spacing.edgeEdgeBetweenLayers': '10',\n 'elk.layered.considerModelOrder.strategy': 'NODES_AND_EDGES',\n },\n };\n}\n\nexport function applyGraphLayout(core: cytoscape.Core, scene: GraphScene, layout: GraphLayoutResult): void {\n applyPositions(core, layout.positions);\n core.batch(() => {\n for (const edge of scene.edges) {\n const route = layout.routes.get(edge.id);\n const cytoscapeEdge = core.getElementById(edge.id);\n if (cytoscapeEdge.empty()) continue;\n const sourceNode = core.getElementById(edge.from);\n const targetNode = core.getElementById(edge.to);\n const routeData = sourceNode.nonempty() && targetNode.nonempty()\n ? createCytoscapeEdgeRouteData(route, sourceNode.position(), targetNode.position())\n : undefined;\n cytoscapeEdge\n .removeClass('elk-route elk-segments')\n .removeData('sourceEndpoint', 'targetEndpoint', 'segmentWeights', 'segmentDistances');\n if (!routeData) continue;\n cytoscapeEdge.data(routeData).addClass('elk-route');\n if (route!.bendPoints.length > 0) cytoscapeEdge.addClass('elk-segments');\n }\n });\n}\n\nexport function syncExpandedGroupLabelGeometry(core: cytoscape.Core): void {\n const groups = core.nodes('node[kind = \"group\"][collapsed = 0]');\n for (let iteration = 0; iteration < 2; iteration++) {\n const updates = groups.map((node) => ({\n node,\n labelMaxWidth: expandedGroupLabelMaxWidth(node.outerWidth()),\n }));\n core.batch(() => {\n for (const update of updates) update.node.data('labelMaxWidth', update.labelMaxWidth);\n });\n }\n}\n\nexport function createCytoscapeEdgeRouteData(\n route: GraphEdgeRoute | undefined,\n sourceCenter: GraphPosition,\n targetCenter: GraphPosition,\n): CytoscapeEdgeRouteData | undefined {\n if (!route || !isValidRoute(route)) return undefined;\n const segments = route.bendPoints.map((point) => segmentFromPoint(route.startPoint, route.endPoint, point));\n return {\n sourceEndpoint: endpointOffset(route.startPoint, sourceCenter),\n targetEndpoint: endpointOffset(route.endPoint, targetCenter),\n segmentWeights: segments.map((segment) => segment.weight).join(' '),\n segmentDistances: segments.map((segment) => segment.distance).join(' '),\n };\n}\n\nfunction elkPadding(): string {\n const padding = GRAPH_GEOMETRY.elkGroupPadding;\n return `[top=${padding.top},left=${padding.left},bottom=${padding.bottom},right=${padding.right}]`;\n}\n\nfunction appendPort(\n portsByNode: Map<GraphSceneElementId, ElkPort[]>,\n nodeId: GraphSceneElementId,\n port: ElkPort,\n): void {\n const ports = portsByNode.get(nodeId) ?? [];\n ports.push(port);\n portsByNode.set(nodeId, ports);\n}\n\nfunction collectLayoutPositions(\n node: ElkNode,\n offsetX: number,\n offsetY: number,\n positions: Map<GraphSceneElementId, GraphPosition>,\n): void {\n for (const child of node.children ?? []) {\n const x = offsetX + (child.x ?? 0);\n const y = offsetY + (child.y ?? 0);\n positions.set(child.id, {\n x: x + (child.width ?? 0) / 2,\n y: y + (child.height ?? 0) / 2,\n });\n collectLayoutPositions(child, x, y, positions);\n }\n}\n\nfunction collectLayoutOffsets(\n node: ElkNode,\n offsetX: number,\n offsetY: number,\n offsets: Map<GraphSceneElementId, GraphPosition>,\n): void {\n offsets.set(node.id, { x: offsetX, y: offsetY });\n for (const child of node.children ?? []) {\n collectLayoutOffsets(child, offsetX + (child.x ?? 0), offsetY + (child.y ?? 0), offsets);\n }\n}\n\nfunction collectEdgeRoutes(\n node: ElkNode,\n offsetX: number,\n offsetY: number,\n nodeOffsets: ReadonlyMap<GraphSceneElementId, GraphPosition>,\n routes: Map<GraphSceneElementId, GraphEdgeRoute>,\n): void {\n for (const edge of node.edges ?? []) {\n if (edge.sections?.length !== 1) continue;\n const section = edge.sections[0];\n if (!section) continue;\n // ELK may keep hierarchy edges on an ancestor while expressing their sections in container-local coordinates.\n const containerOffset = edge.container === undefined ? undefined : nodeOffsets.get(edge.container);\n const routeOffsetX = containerOffset?.x ?? offsetX;\n const routeOffsetY = containerOffset?.y ?? offsetY;\n routes.set(edge.id, {\n startPoint: offsetPoint(section.startPoint, routeOffsetX, routeOffsetY),\n bendPoints: (section.bendPoints ?? []).map((point) => offsetPoint(point, routeOffsetX, routeOffsetY)),\n endPoint: offsetPoint(section.endPoint, routeOffsetX, routeOffsetY),\n });\n }\n for (const child of node.children ?? []) {\n collectEdgeRoutes(\n child,\n offsetX + (child.x ?? 0),\n offsetY + (child.y ?? 0),\n nodeOffsets,\n routes,\n );\n }\n}\n\nfunction offsetPoint(point: GraphPosition, offsetX: number, offsetY: number): GraphPosition {\n return { x: point.x + offsetX, y: point.y + offsetY };\n}\n\nfunction isValidRoute(route: GraphEdgeRoute): boolean {\n const dx = route.endPoint.x - route.startPoint.x;\n const dy = route.endPoint.y - route.startPoint.y;\n return isFinitePoint(route.startPoint)\n && isFinitePoint(route.endPoint)\n && dx * dx + dy * dy > Number.EPSILON\n && route.bendPoints.every(isFinitePoint);\n}\n\nfunction isFinitePoint(point: GraphPosition): boolean {\n return Number.isFinite(point.x) && Number.isFinite(point.y);\n}\n\nfunction endpointOffset(point: GraphPosition, center: GraphPosition): string {\n return `${point.x - center.x}px ${point.y - center.y}px`;\n}\n\nfunction applyPositions(core: cytoscape.Core, positions: ReadonlyMap<GraphSceneElementId, GraphPosition>): void {\n core.batch(() => {\n for (const [id, position] of positions) {\n const node = core.getElementById(id);\n if (node.nonempty() && node.isNode() && !node.isParent()) node.position(position);\n }\n });\n}\n\nfunction segmentFromPoint(source: GraphPosition, target: GraphPosition, point: GraphPosition) {\n const dx = target.x - source.x;\n const dy = target.y - source.y;\n const lengthSquared = dx * dx + dy * dy;\n if (lengthSquared === 0) return { weight: 0.5, distance: 0 };\n const weight = ((point.x - source.x) * dx + (point.y - source.y) * dy) / lengthSquared;\n const projectedX = source.x + weight * dx;\n const projectedY = source.y + weight * dy;\n const length = Math.sqrt(lengthSquared);\n const distance = ((point.x - projectedX) * -dy + (point.y - projectedY) * dx) / length;\n return { weight, distance };\n}\n"]}
|
|
@@ -1,20 +1,30 @@
|
|
|
1
|
+
import type { GraphVisualTheme } from './panelVisualTheme.ts';
|
|
1
2
|
import type { GraphScene, GraphSceneElementId } from './panelGraphScene.ts';
|
|
2
3
|
import type { Selection } from './panelTypes.ts';
|
|
3
4
|
export type GraphRenderRequest = {
|
|
5
|
+
readonly theme?: GraphVisualTheme;
|
|
6
|
+
readonly onVisible?: () => void;
|
|
4
7
|
readonly scene: GraphScene;
|
|
5
8
|
readonly selected: Selection | undefined;
|
|
6
9
|
readonly hovered: Selection | undefined;
|
|
7
10
|
readonly fit: boolean;
|
|
8
11
|
readonly anchorElementId?: GraphSceneElementId;
|
|
12
|
+
readonly reveal?: {
|
|
13
|
+
readonly selection: Selection;
|
|
14
|
+
readonly revision: number;
|
|
15
|
+
};
|
|
16
|
+
readonly captureRevision?: number;
|
|
9
17
|
readonly onSelect: (selection: Selection) => void;
|
|
10
18
|
readonly onHover: (selection: Selection | undefined) => void;
|
|
11
19
|
readonly onToggleGroup: (pathKey: string) => void;
|
|
12
20
|
};
|
|
13
21
|
export interface GraphRenderer {
|
|
14
22
|
render(request: GraphRenderRequest): void;
|
|
23
|
+
setTheme?(theme: GraphVisualTheme): void;
|
|
15
24
|
resize(): void;
|
|
16
25
|
fit(): void;
|
|
17
26
|
relayout(): void;
|
|
27
|
+
cancelReveal?(): void;
|
|
18
28
|
destroy(): void;
|
|
19
29
|
}
|
|
20
30
|
//# sourceMappingURL=panelGraphRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelGraphRenderer.d.ts","sourceRoot":"","sources":["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SceneElementId } from './panelGraphScene.ts';\nimport type { Selection } from './panelTypes.ts';\n\nexport type GraphRenderRequest = {\n readonly scene: GraphScene;\n readonly selected: Selection | undefined;\n readonly hovered: Selection | undefined;\n readonly fit: boolean;\n readonly anchorElementId?: GraphSceneElementId;\n readonly onSelect: (selection: Selection) => void;\n readonly onHover: (selection: Selection | undefined) => void;\n readonly onToggleGroup: (pathKey: string) => void;\n};\n\nexport interface GraphRenderer {\n render(request: GraphRenderRequest): void;\n resize(): void;\n fit(): void;\n relayout(): void;\n destroy(): void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"panelGraphRenderer.js","sourceRoot":"","sources":["../src/panelGraphRenderer.ts"],"names":[],"mappings":"","sourcesContent":["import type { GraphVisualTheme } from './panelVisualTheme.ts';\nimport type { GraphScene, GraphSceneElementId } from './panelGraphScene.ts';\nimport type { Selection } from './panelTypes.ts';\n\nexport type GraphRenderRequest = {\n readonly theme?: GraphVisualTheme;\n readonly onVisible?: () => void;\n readonly scene: GraphScene;\n readonly selected: Selection | undefined;\n readonly hovered: Selection | undefined;\n readonly fit: boolean;\n readonly anchorElementId?: GraphSceneElementId;\n readonly reveal?: { readonly selection: Selection; readonly revision: number };\n readonly captureRevision?: number;\n readonly onSelect: (selection: Selection) => void;\n readonly onHover: (selection: Selection | undefined) => void;\n readonly onToggleGroup: (pathKey: string) => void;\n};\n\nexport interface GraphRenderer {\n render(request: GraphRenderRequest): void;\n setTheme?(theme: GraphVisualTheme): void;\n resize(): void;\n fit(): void;\n relayout(): void;\n cancelReveal?(): void;\n destroy(): void;\n}\n"]}
|
|
@@ -77,6 +77,7 @@ export type GraphScene = {
|
|
|
77
77
|
};
|
|
78
78
|
export type CreateGraphSceneOptions = {
|
|
79
79
|
readonly groupsEnabled: boolean;
|
|
80
|
+
readonly showResourceDeclarations?: boolean;
|
|
80
81
|
readonly expandedGroupPaths: ReadonlySet<string>;
|
|
81
82
|
};
|
|
82
83
|
export declare function createGraphScene(snapshot: FrameGraphDebugViewModel, options: CreateGraphSceneOptions): GraphScene;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelGraphScene.d.ts","sourceRoot":"","sources":["../src/panelGraphScene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,mBAAmB,EAEnB,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EAC3B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"panelGraphScene.d.ts","sourceRoot":"","sources":["../src/panelGraphScene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,mBAAmB,EAEnB,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EAC3B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGpE,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEzC,KAAK,kBAAkB,GAAG;IACtB,QAAQ,CAAC,EAAE,EAAE,mBAAmB,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,kBAAkB,GAAG;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC/C,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,cA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EAAE,uBAAuB,CAAC,CAAC;CACrG,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IAC1C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAClC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAC5C,QAAQ,CAAC,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACpD,CAAC;AAUF,wBAAgB,gBAAgB,CAC5B,QAAQ,EAAE,wBAAwB,EAClC,OAAO,EAAE,uBAAuB,GACjC,UAAU,CAEZ;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAExE;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAiBzD"}
|
package/dist/panelGraphScene.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { formatGpuDuration, labelNode, labelResource } from "./panelDomHelpers.js";
|
|
2
2
|
import { declarationEntrances } from "./debugCaptureModel.js";
|
|
3
|
+
import { formatMeasuredGpuWork } from "./panelWorkbenchHelpers.js";
|
|
3
4
|
export function createGraphScene(snapshot, options) {
|
|
4
|
-
return createFrameFlowScene(snapshot, options.groupsEnabled, options.expandedGroupPaths);
|
|
5
|
+
return createFrameFlowScene(snapshot, options.groupsEnabled, options.expandedGroupPaths, options.showResourceDeclarations ?? true);
|
|
5
6
|
}
|
|
6
7
|
export function graphGroupElementId(pathKey) {
|
|
7
8
|
return `group:${pathKey}`;
|
|
@@ -19,12 +20,12 @@ export function selectionKey(selection) {
|
|
|
19
20
|
case 'root':
|
|
20
21
|
return `root:${selection.key}`;
|
|
21
22
|
case 'culled':
|
|
22
|
-
return `culled:${selection.
|
|
23
|
+
return `culled:${selection.id}`;
|
|
23
24
|
case 'segment':
|
|
24
25
|
return `segment:${selection.index}`;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
|
-
function createFrameFlowScene(snapshot, groupsEnabled, expandedGroupPaths) {
|
|
28
|
+
function createFrameFlowScene(snapshot, groupsEnabled, expandedGroupPaths, showResourceDeclarations) {
|
|
28
29
|
const interaction = createMutableInteractionIndex();
|
|
29
30
|
const segmentByNodeId = executionSegmentByNodeId(snapshot);
|
|
30
31
|
const groupsById = new Map(snapshot.debugGroups.map((group) => [group.id, group]));
|
|
@@ -38,7 +39,7 @@ function createFrameFlowScene(snapshot, groupsEnabled, expandedGroupPaths) {
|
|
|
38
39
|
...snapshot.accessEdges.filter((access) => retainedIds.has(access.nodeId)).map((access) => access.resource.id),
|
|
39
40
|
...snapshot.roots.flatMap((root) => root.resource ? [root.resource.id] : []),
|
|
40
41
|
]);
|
|
41
|
-
const resources = snapshot.resources.filter((resource) => usedResourceIds.has(resource.id));
|
|
42
|
+
const resources = showResourceDeclarations ? snapshot.resources.filter((resource) => usedResourceIds.has(resource.id)) : [];
|
|
42
43
|
const populatedGroupIds = new Set();
|
|
43
44
|
for (const item of [...snapshot.nodes, ...resources]) {
|
|
44
45
|
for (const id of groupsById.get(item.debugGroupId ?? '')?.ancestorIds ?? [])
|
|
@@ -84,8 +85,8 @@ function createFrameFlowScene(snapshot, groupsEnabled, expandedGroupPaths) {
|
|
|
84
85
|
groupId: group.id,
|
|
85
86
|
groupPathKey: group.pathKey,
|
|
86
87
|
label: createGroupLabel(group, collapsed),
|
|
87
|
-
overviewLabel: `${collapsed ? '▸' : '▾'} ${group.label}`,
|
|
88
|
-
title: createGroupTitle(group),
|
|
88
|
+
overviewLabel: `${collapsed ? '▸' : '▾'} ${group.label.replace(/\s+/g, ' ').trim()}`,
|
|
89
|
+
title: createGroupTitle(group, snapshot),
|
|
89
90
|
parentId: group.parentId !== undefined && includedGroupIds.has(group.parentId)
|
|
90
91
|
? graphGroupElementId(groupsById.get(group.parentId).pathKey)
|
|
91
92
|
: undefined,
|
|
@@ -148,7 +149,7 @@ function createFrameFlowScene(snapshot, groupsEnabled, expandedGroupPaths) {
|
|
|
148
149
|
}
|
|
149
150
|
if (useGroups) {
|
|
150
151
|
for (const group of snapshot.debugGroups) {
|
|
151
|
-
if (includedGroupIds.has(group.id))
|
|
152
|
+
if (includedGroupIds.has(group.id) || !populatedGroupIds.has(group.id))
|
|
152
153
|
continue;
|
|
153
154
|
const collapsedAncestorId = group.ancestorIds.find((id) => !isExpanded(groupsById.get(id)));
|
|
154
155
|
if (collapsedAncestorId !== undefined) {
|
|
@@ -168,7 +169,7 @@ function createFrameFlowScene(snapshot, groupsEnabled, expandedGroupPaths) {
|
|
|
168
169
|
const node = {
|
|
169
170
|
id: resourceElementId(resource.id), kind: 'resource', resourceId: resource.id, resourceKind: resource.kind,
|
|
170
171
|
label: origin + ' · ' + (resource.kind === 'buffer' ? 'Buffer' : 'Texture') + '\n' + formatGraphResourceLabel(labelResource(resource)),
|
|
171
|
-
overviewLabel: origin + '\n' + formatGraphResourceLabel(shortGraphLabel(labelResource(resource))),
|
|
172
|
+
overviewLabel: origin + '\n' + formatGraphResourceLabel(shortGraphLabel(labelResource(resource)), 1),
|
|
172
173
|
title: createResourceTitle(resource, snapshot, snapshot.accessesByResourceId.get(resource.id) ?? [])
|
|
173
174
|
+ '\nDeclaration entrance, not a complete initial-content provenance graph.',
|
|
174
175
|
parentId: useGroups && resource.debugGroupId ? graphGroupElementId(groupsById.get(resource.debugGroupId).pathKey) : undefined,
|
|
@@ -190,7 +191,7 @@ function createFrameFlowScene(snapshot, groupsEnabled, expandedGroupPaths) {
|
|
|
190
191
|
for (const dependency of snapshot.edges) {
|
|
191
192
|
addRelation(representativeByNodeId.get(dependency.fromNodeId), representativeByNodeId.get(dependency.toNodeId), dependency.resource.id, { role: dependency.kind, nodeIds: [dependency.fromNodeId, dependency.toNodeId], dependency });
|
|
192
193
|
}
|
|
193
|
-
for (const access of declarationEntrances(snapshot.nodes, snapshot.accessEdges, snapshot.edges)) {
|
|
194
|
+
for (const access of showResourceDeclarations ? declarationEntrances(snapshot.nodes, snapshot.accessEdges, snapshot.edges) : []) {
|
|
194
195
|
addRelation(representativeByResourceId.get(access.resource.id), representativeByNodeId.get(access.nodeId), access.resource.id, { role: 'declaration', nodeIds: [access.nodeId] });
|
|
195
196
|
}
|
|
196
197
|
const rootOccurrences = new Map();
|
|
@@ -222,11 +223,13 @@ function createFrameFlowScene(snapshot, groupsEnabled, expandedGroupPaths) {
|
|
|
222
223
|
: rangeLabel;
|
|
223
224
|
const reasonLabel = root.reason.split('-').map((word) => word[0].toUpperCase() + word.slice(1)).join(' ');
|
|
224
225
|
const disambiguate = rangesByRootFamily.get(JSON.stringify([resource.id, root.reason])).size > 1;
|
|
226
|
+
const initialLabel = !showResourceDeclarations && root.resolution?.usesInitialContents
|
|
227
|
+
? '\n' + (root.resolution.producerNodeIds.length ? 'With initial contents' : 'Initial contents only') : '';
|
|
225
228
|
rootNodes.push({
|
|
226
229
|
id, kind: 'root', rootKey: root.key, resourceId: resource.id, resourceKind: resource.kind,
|
|
227
230
|
label: reasonLabel + '\n' + formatGraphResourceLabel(labelResource(resource))
|
|
228
|
-
+ (disambiguate ? '\n' + formatGraphResourceLabel(rangeSummary) : ''),
|
|
229
|
-
overviewLabel: reasonLabel + '\n' + formatGraphResourceLabel(shortGraphLabel(labelResource(resource))),
|
|
231
|
+
+ (disambiguate ? '\n' + formatGraphResourceLabel(rangeSummary, 1) : '') + initialLabel,
|
|
232
|
+
overviewLabel: reasonLabel + '\n' + formatGraphResourceLabel(shortGraphLabel(labelResource(resource)), 1) + initialLabel,
|
|
230
233
|
title: labelResource(resource) + '\n' + root.reason + '\n' + rangeLabel
|
|
231
234
|
+ (root.resolution ? '\nProducers: ' + (root.resolution.producerNodeIds.join(', ') || 'none') + '\nInitial contents: ' + root.resolution.usesInitialContents : '\nOutput sources unavailable in Legacy capture.'),
|
|
232
235
|
});
|
|
@@ -234,7 +237,7 @@ function createFrameFlowScene(snapshot, groupsEnabled, expandedGroupPaths) {
|
|
|
234
237
|
for (const nodeId of root.resolution?.producerNodeIds ?? []) {
|
|
235
238
|
addRelation(representativeByNodeId.get(nodeId), id, resource.id, { role: 'output-producer', nodeIds: [nodeId], rootKey: root.key });
|
|
236
239
|
}
|
|
237
|
-
if (root.resolution?.usesInitialContents)
|
|
240
|
+
if (showResourceDeclarations && root.resolution?.usesInitialContents)
|
|
238
241
|
addRelation(representativeByResourceId.get(resource.id), id, resource.id, { role: 'output-initial', nodeIds: [], rootKey: root.key });
|
|
239
242
|
}
|
|
240
243
|
const edges = [...aggregates.entries()].map(([key, entry]) => {
|
|
@@ -335,22 +338,50 @@ function resourceElementId(resourceId) {
|
|
|
335
338
|
function formatGraphNodeLabel(label) {
|
|
336
339
|
return formatGraphLabel(label, 20, 3);
|
|
337
340
|
}
|
|
338
|
-
function formatGraphResourceLabel(label) {
|
|
339
|
-
|
|
341
|
+
function formatGraphResourceLabel(label, maxLines = 2) {
|
|
342
|
+
let remaining = [...label.replace(/\s+/g, ' ').trim()];
|
|
340
343
|
// Reserve conservative monospace cells for CJK/emoji fallback glyphs as well.
|
|
341
|
-
const glyphs = [...singleLine];
|
|
342
344
|
const cells = (glyph) => /\p{Mark}/u.test(glyph) ? 0 : glyph.codePointAt(0) > 255 ? 2 : 1;
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
345
|
+
const take = (limit) => {
|
|
346
|
+
let width = 0;
|
|
347
|
+
let count = 0;
|
|
348
|
+
for (const glyph of remaining) {
|
|
349
|
+
if (width + cells(glyph) > limit)
|
|
350
|
+
break;
|
|
351
|
+
width += cells(glyph);
|
|
352
|
+
count++;
|
|
353
|
+
}
|
|
354
|
+
return count;
|
|
355
|
+
};
|
|
356
|
+
const lines = [];
|
|
357
|
+
while (remaining.length) {
|
|
358
|
+
let count = take(18);
|
|
359
|
+
if (count === remaining.length) {
|
|
360
|
+
lines.push(remaining.join(''));
|
|
349
361
|
break;
|
|
350
|
-
|
|
351
|
-
|
|
362
|
+
}
|
|
363
|
+
if (lines.length === maxLines - 1) {
|
|
364
|
+
lines.push(remaining.slice(0, take(17)).join('').trimEnd() + '…');
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
// Prefer a readable namespace/path boundary over splitting a word.
|
|
368
|
+
let boundary = 0;
|
|
369
|
+
for (const separators of [/[./]/u, /[_\-\s]/u]) {
|
|
370
|
+
for (let index = count - 1; index > 0; index--) {
|
|
371
|
+
if (separators.test(remaining[index])) {
|
|
372
|
+
boundary = index + 1;
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
if (boundary)
|
|
377
|
+
break;
|
|
378
|
+
}
|
|
379
|
+
if (boundary)
|
|
380
|
+
count = boundary;
|
|
381
|
+
lines.push(remaining.slice(0, count).join('').trimEnd());
|
|
382
|
+
remaining = remaining.slice(count);
|
|
352
383
|
}
|
|
353
|
-
return
|
|
384
|
+
return lines.join('\n');
|
|
354
385
|
}
|
|
355
386
|
function formatGraphLabel(label, maxLineLength, maxLines) {
|
|
356
387
|
if (label.length <= maxLineLength)
|
|
@@ -435,23 +466,28 @@ function shortGraphLabel(label) {
|
|
|
435
466
|
}
|
|
436
467
|
function createGroupLabel(group, collapsed) {
|
|
437
468
|
const summary = group.summary;
|
|
438
|
-
const
|
|
439
|
-
? '
|
|
440
|
-
|
|
441
|
-
|
|
469
|
+
const parts = [
|
|
470
|
+
`${collapsed ? '▸' : '▾'} ${group.label.replace(/\s+/g, ' ').trim()}`,
|
|
471
|
+
`${summary.retainedNodeCount} nodes` + (summary.culledNodeCount ? ` · ${summary.culledNodeCount} culled` : ''),
|
|
472
|
+
];
|
|
473
|
+
return parts.join(collapsed ? '\n' : ' · ');
|
|
442
474
|
}
|
|
443
475
|
function createNodeTitle(node, segment, snapshot) {
|
|
476
|
+
const gpu = node.kind === 'external-submission' ? 'Opaque'
|
|
477
|
+
: node.kind !== 'render' && node.kind !== 'compute' ? 'Not applicable'
|
|
478
|
+
: node.gpuDurationMicros === undefined ? 'Not collected' : `${formatGpuDuration(node)} ms`;
|
|
444
479
|
return [
|
|
445
480
|
labelNode(node),
|
|
446
481
|
`kind: ${node.kind}`,
|
|
447
482
|
`group: ${debugGroupPathForId(node.debugGroupId, snapshot)}`,
|
|
448
483
|
`segment: ${segment ? `${segment.index}:${segment.kind}` : '-'}`,
|
|
449
|
-
`
|
|
484
|
+
`CPU duration: ${node.cpuDurationMicros === undefined ? 'Not collected' : (node.cpuDurationMicros / 1000).toFixed(3) + ' ms'}`,
|
|
485
|
+
`GPU duration: ${gpu}`,
|
|
450
486
|
`reads: ${node.reads.map((access) => labelResource(access.resource)).join(', ') || '-'}`,
|
|
451
487
|
`writes: ${node.writes.map((access) => labelResource(access.resource)).join(', ') || '-'}`,
|
|
452
488
|
].join('\n');
|
|
453
489
|
}
|
|
454
|
-
function createGroupTitle(group) {
|
|
490
|
+
function createGroupTitle(group, snapshot) {
|
|
455
491
|
const summary = group.summary;
|
|
456
492
|
return [
|
|
457
493
|
group.path.join(' / '),
|
|
@@ -460,10 +496,11 @@ function createGroupTitle(group) {
|
|
|
460
496
|
`inputs: ${summary.inputResources.map(labelResource).join(', ') || '-'}`,
|
|
461
497
|
`outputs: ${summary.outputResources.map(labelResource).join(', ') || '-'}`,
|
|
462
498
|
`transient registered/accessed: ${summary.registeredTransientResourceCount}/${summary.accessedTransientResourceCount}`,
|
|
463
|
-
`physical allocations: ${summary.physicalAllocationCount}`,
|
|
499
|
+
`physical allocations: ${snapshot.protocol.memory.allocationReport.status === 'available' ? summary.physicalAllocationCount : 'Not collected'}`,
|
|
464
500
|
`segments: ${summary.executionSegmentCount}`,
|
|
465
501
|
`opaque: ${summary.externalSubmissionCount}`,
|
|
466
|
-
|
|
502
|
+
`CPU pass sum: ${summary.cpuTimedNodeCount ? (summary.cpuWorkDurationMicros / 1000).toFixed(3) + ' ms' : 'Not collected'} (${summary.cpuTimedNodeCount}/${summary.retainedNodeCount})`,
|
|
503
|
+
`GPU pass sum: ${formatMeasuredGpuWork(summary.gpuWorkDurationMicros, summary.timedNodeCount, summary.timingEligibleNodeCount)}`,
|
|
467
504
|
].join('\n');
|
|
468
505
|
}
|
|
469
506
|
function createResourceTitle(resource, snapshot, accesses) {
|