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

Method viewSelection

deps/v8/tools/turbolizer/src/views/graph-view.ts:584–605  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

582 }
583
584 private viewSelection(): void {
585 let minX;
586 let maxX;
587 let minY;
588 let maxY;
589 let hasSelection = false;
590 this.visibleNodes.selectAll<SVGGElement, GraphNode>("g").each((node: GraphNode) => {
591 if (this.state.selection.isSelected(node)) {
592 hasSelection = true;
593 minX = minX ? Math.min(minX, node.x) : node.x;
594 maxX = maxX ? Math.max(maxX, node.x + node.getWidth()) : node.x + node.getWidth();
595 minY = minY ? Math.min(minY, node.y) : node.y;
596 maxY = maxY
597 ? Math.max(maxY, node.y + node.getHeight(this.state.showTypes))
598 : node.y + node.getHeight(this.state.showTypes);
599 }
600 });
601 if (hasSelection) {
602 this.viewGraphRegion(minX - C.NODE_INPUT_WIDTH, minY - 60,
603 maxX + C.NODE_INPUT_WIDTH, maxY + 60);
604 }
605 }
606
607 // Actions (handlers of toolbox menu and hotkeys events)
608 private layoutAction(view: GraphView): void {

Callers 3

initializeContentMethod · 0.95
searchInputActionMethod · 0.95
zoomSelectionActionMethod · 0.45

Calls 5

isSelectedMethod · 0.80
minMethod · 0.45
maxMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected