MCPcopy Create free account
hub / github.com/nodejs/node / initializeContent

Method initializeContent

deps/v8/tools/turbolizer/src/views/graph-view.ts:53–93  ·  view source on GitHub ↗
(data: GraphPhase, rememberedSelection: SelectionStorage)

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 8

createGraphMethod · 0.95
attachSelectionMethod · 0.95
updateGraphVisibilityMethod · 0.95
viewSelectionMethod · 0.95
partialFunction · 0.90
addNodeHandlerMethod · 0.80
isAdaptedMethod · 0.80
showMethod · 0.45

Tested by

no test coverage detected