@zenfg/inspector 0.1.0-beta.2 → 0.1.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -1
- package/dist/FrameGraphInspector.d.ts +2 -5
- package/dist/FrameGraphInspector.d.ts.map +1 -1
- package/dist/FrameGraphInspector.js +16 -38
- package/dist/FrameGraphInspector.js.map +1 -1
- package/dist/debugCaptureModel.d.ts +9 -4
- package/dist/debugCaptureModel.d.ts.map +1 -1
- package/dist/debugCaptureModel.js +36 -14
- package/dist/debugCaptureModel.js.map +1 -1
- package/dist/panelCytoscapeGraphRenderer.d.ts +3 -1
- package/dist/panelCytoscapeGraphRenderer.d.ts.map +1 -1
- package/dist/panelCytoscapeGraphRenderer.js +39 -19
- package/dist/panelCytoscapeGraphRenderer.js.map +1 -1
- package/dist/panelDiagnosticsView.js +2 -2
- package/dist/panelDiagnosticsView.js.map +1 -1
- package/dist/panelGraphLayout.d.ts.map +1 -1
- package/dist/panelGraphLayout.js +15 -1
- package/dist/panelGraphLayout.js.map +1 -1
- package/dist/panelGraphScene.d.ts +14 -26
- package/dist/panelGraphScene.d.ts.map +1 -1
- package/dist/panelGraphScene.js +141 -195
- package/dist/panelGraphScene.js.map +1 -1
- package/dist/panelGraphView.d.ts.map +1 -1
- package/dist/panelGraphView.js +31 -9
- package/dist/panelGraphView.js.map +1 -1
- package/dist/panelGraphVisuals.d.ts +7 -3
- package/dist/panelGraphVisuals.d.ts.map +1 -1
- package/dist/panelGraphVisuals.js +45 -80
- package/dist/panelGraphVisuals.js.map +1 -1
- package/dist/panelInspectorView.d.ts +5 -0
- package/dist/panelInspectorView.d.ts.map +1 -1
- package/dist/panelInspectorView.js +99 -13
- package/dist/panelInspectorView.js.map +1 -1
- package/dist/panelSelection.js +2 -2
- package/dist/panelSelection.js.map +1 -1
- package/dist/panelTypes.d.ts +8 -3
- package/dist/panelTypes.d.ts.map +1 -1
- package/dist/panelTypes.js.map +1 -1
- package/dist/panelVisualTheme.d.ts +21 -13
- package/dist/panelVisualTheme.d.ts.map +1 -1
- package/dist/panelVisualTheme.js +15 -7
- package/dist/panelVisualTheme.js.map +1 -1
- package/dist/panelWorkbenchHelpers.js +1 -1
- package/dist/panelWorkbenchHelpers.js.map +1 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +16 -12
- package/dist/styles.js.map +1 -1
- package/package.json +2 -2
- package/src/FrameGraphInspector.ts +17 -39
- package/src/debugCaptureModel.ts +44 -19
- package/src/panelCytoscapeGraphRenderer.ts +38 -18
- package/src/panelDiagnosticsView.ts +3 -3
- package/src/panelGraphLayout.ts +15 -1
- package/src/panelGraphScene.ts +153 -279
- package/src/panelGraphView.ts +31 -9
- package/src/panelGraphVisuals.ts +46 -82
- package/src/panelInspectorView.ts +104 -16
- package/src/panelSelection.ts +2 -2
- package/src/panelTypes.ts +9 -3
- package/src/panelVisualTheme.ts +18 -7
- package/src/panelWorkbenchHelpers.ts +2 -2
- package/src/styles.ts +16 -12
package/src/panelGraphLayout.ts
CHANGED
|
@@ -34,20 +34,34 @@ export async function layoutGraphScene(elk: ELK, scene: GraphScene): Promise<Gra
|
|
|
34
34
|
return { positions, routes };
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
function usesCenterPorts(node: GraphSceneNode): boolean {
|
|
38
|
+
return node.kind === 'resource' || node.kind === 'root'
|
|
39
|
+
|| (node.kind === 'pass' && node.passKind === 'external-submission');
|
|
40
|
+
}
|
|
41
|
+
|
|
37
42
|
export function createElkLayoutGraph(scene: GraphScene): ElkNode {
|
|
38
43
|
const childrenByParent = new Map<GraphSceneElementId | undefined, GraphSceneNode[]>();
|
|
39
44
|
const portsByNode = new Map<GraphSceneElementId, ElkPort[]>();
|
|
45
|
+
const nodesById = new Map(scene.nodes.map((node) => [node.id, node]));
|
|
46
|
+
const boundaryPort = (id: string, source: boolean) => {
|
|
47
|
+
const node = nodesById.get(id)!;
|
|
48
|
+
if (!usesCenterPorts(node)) return {};
|
|
49
|
+
const dimensions = nodeDimensions(node);
|
|
50
|
+
return { x: source ? dimensions.width : 0, y: dimensions.height / 2 };
|
|
51
|
+
};
|
|
40
52
|
const elkEdges = scene.edges.map((edge): ElkExtendedEdge => {
|
|
41
53
|
const sourcePortId = `${edge.id}:source`;
|
|
42
54
|
const targetPortId = `${edge.id}:target`;
|
|
43
55
|
appendPort(portsByNode, edge.from, {
|
|
44
56
|
id: sourcePortId,
|
|
57
|
+
...boundaryPort(edge.from, true),
|
|
45
58
|
width: 1,
|
|
46
59
|
height: 1,
|
|
47
60
|
layoutOptions: { 'elk.port.side': 'EAST' },
|
|
48
61
|
});
|
|
49
62
|
appendPort(portsByNode, edge.to, {
|
|
50
63
|
id: targetPortId,
|
|
64
|
+
...boundaryPort(edge.to, false),
|
|
51
65
|
width: 1,
|
|
52
66
|
height: 1,
|
|
53
67
|
layoutOptions: { 'elk.port.side': 'WEST' },
|
|
@@ -86,7 +100,7 @@ export function createElkLayoutGraph(scene: GraphScene): ElkNode {
|
|
|
86
100
|
'elk.spacing.edgeEdge': '10',
|
|
87
101
|
'elk.layered.spacing.edgeEdgeBetweenLayers': '10',
|
|
88
102
|
} : {
|
|
89
|
-
'elk.portConstraints': 'FIXED_SIDE',
|
|
103
|
+
'elk.portConstraints': usesCenterPorts(node) ? 'FIXED_POS' : 'FIXED_SIDE',
|
|
90
104
|
},
|
|
91
105
|
};
|
|
92
106
|
};
|