@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.
Files changed (62) hide show
  1. package/README.md +63 -1
  2. package/dist/FrameGraphInspector.d.ts +2 -5
  3. package/dist/FrameGraphInspector.d.ts.map +1 -1
  4. package/dist/FrameGraphInspector.js +16 -38
  5. package/dist/FrameGraphInspector.js.map +1 -1
  6. package/dist/debugCaptureModel.d.ts +9 -4
  7. package/dist/debugCaptureModel.d.ts.map +1 -1
  8. package/dist/debugCaptureModel.js +36 -14
  9. package/dist/debugCaptureModel.js.map +1 -1
  10. package/dist/panelCytoscapeGraphRenderer.d.ts +3 -1
  11. package/dist/panelCytoscapeGraphRenderer.d.ts.map +1 -1
  12. package/dist/panelCytoscapeGraphRenderer.js +39 -19
  13. package/dist/panelCytoscapeGraphRenderer.js.map +1 -1
  14. package/dist/panelDiagnosticsView.js +2 -2
  15. package/dist/panelDiagnosticsView.js.map +1 -1
  16. package/dist/panelGraphLayout.d.ts.map +1 -1
  17. package/dist/panelGraphLayout.js +15 -1
  18. package/dist/panelGraphLayout.js.map +1 -1
  19. package/dist/panelGraphScene.d.ts +14 -26
  20. package/dist/panelGraphScene.d.ts.map +1 -1
  21. package/dist/panelGraphScene.js +141 -195
  22. package/dist/panelGraphScene.js.map +1 -1
  23. package/dist/panelGraphView.d.ts.map +1 -1
  24. package/dist/panelGraphView.js +31 -9
  25. package/dist/panelGraphView.js.map +1 -1
  26. package/dist/panelGraphVisuals.d.ts +7 -3
  27. package/dist/panelGraphVisuals.d.ts.map +1 -1
  28. package/dist/panelGraphVisuals.js +45 -80
  29. package/dist/panelGraphVisuals.js.map +1 -1
  30. package/dist/panelInspectorView.d.ts +5 -0
  31. package/dist/panelInspectorView.d.ts.map +1 -1
  32. package/dist/panelInspectorView.js +99 -13
  33. package/dist/panelInspectorView.js.map +1 -1
  34. package/dist/panelSelection.js +2 -2
  35. package/dist/panelSelection.js.map +1 -1
  36. package/dist/panelTypes.d.ts +8 -3
  37. package/dist/panelTypes.d.ts.map +1 -1
  38. package/dist/panelTypes.js.map +1 -1
  39. package/dist/panelVisualTheme.d.ts +21 -13
  40. package/dist/panelVisualTheme.d.ts.map +1 -1
  41. package/dist/panelVisualTheme.js +15 -7
  42. package/dist/panelVisualTheme.js.map +1 -1
  43. package/dist/panelWorkbenchHelpers.js +1 -1
  44. package/dist/panelWorkbenchHelpers.js.map +1 -1
  45. package/dist/styles.d.ts.map +1 -1
  46. package/dist/styles.js +16 -12
  47. package/dist/styles.js.map +1 -1
  48. package/package.json +2 -2
  49. package/src/FrameGraphInspector.ts +17 -39
  50. package/src/debugCaptureModel.ts +44 -19
  51. package/src/panelCytoscapeGraphRenderer.ts +38 -18
  52. package/src/panelDiagnosticsView.ts +3 -3
  53. package/src/panelGraphLayout.ts +15 -1
  54. package/src/panelGraphScene.ts +153 -279
  55. package/src/panelGraphView.ts +31 -9
  56. package/src/panelGraphVisuals.ts +46 -82
  57. package/src/panelInspectorView.ts +104 -16
  58. package/src/panelSelection.ts +2 -2
  59. package/src/panelTypes.ts +9 -3
  60. package/src/panelVisualTheme.ts +18 -7
  61. package/src/panelWorkbenchHelpers.ts +2 -2
  62. package/src/styles.ts +16 -12
@@ -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
  };