(data: GraphPhase, rememberedSelection: SelectionStorage)
| 51 | } |
| 52 | |
| 53 | public initializeContent(data: GraphPhase, rememberedSelection: SelectionStorage): void { |
| 54 | this.show(); |
| 55 | this.addImgInput("layout", "layout graph", |
| 56 | partial(this.layoutAction, this)); |
| 57 | this.addImgInput("show-all", "show all nodes", |
| 58 | partial(this.showAllAction, this)); |
| 59 | this.addImgInput("show-control", "show only control nodes", |
| 60 | partial(this.showControlAction, this)); |
| 61 | this.addImgInput("hide-unselected", "hide unselected", |
| 62 | partial(this.hideUnselectedAction, this)); |
| 63 | this.addImgInput("hide-selected", "hide selected", |
| 64 | partial(this.hideSelectedAction, this)); |
| 65 | this.addImgInput("zoom-selection", "zoom selection", |
| 66 | partial(this.zoomSelectionAction, this)); |
| 67 | this.addToggleImgInput("toggle-hide-dead", "toggle hide dead nodes", |
| 68 | this.state.hideDead, partial(this.toggleHideDeadAction, this)); |
| 69 | this.addToggleImgInput("toggle-types", "toggle types", |
| 70 | this.state.showTypes, partial(this.toggleTypesAction, this)); |
| 71 | this.addToggleImgInput("toggle-cache-layout", "toggle saving graph layout", |
| 72 | this.state.cacheLayout, partial(this.toggleLayoutCachingAction, this)); |
| 73 | |
| 74 | this.phaseName = data.name; |
| 75 | const adaptedSelection = this.createGraph(data, rememberedSelection); |
| 76 | this.broker.addNodeHandler(this.nodeSelectionHandler); |
| 77 | |
| 78 | const selectedNodes = adaptedSelection.isAdapted() |
| 79 | ? this.attachSelection(adaptedSelection.adaptedNodes) |
| 80 | : null; |
| 81 | |
| 82 | if (selectedNodes?.length > 0) { |
| 83 | this.connectVisibleSelectedElements(this.state.selection); |
| 84 | this.updateGraphVisibility(); |
| 85 | this.viewSelection(); |
| 86 | } else { |
| 87 | if (this.state.cacheLayout && data.transform) { |
| 88 | this.viewTransformMatrix(data.transform); |
| 89 | } else { |
| 90 | this.viewWholeGraph(); |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | public updateGraphVisibility(): void { |
| 96 | const view = this; |
nothing calls this directly
no test coverage detected