Skip to content

Commit

Permalink
Code cleanup to remove warnings
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 689418687
  • Loading branch information
Google AI Edge authored and copybara-github committed Oct 24, 2024
1 parent c2bbd1c commit 09d32f7
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 38 deletions.
9 changes: 1 addition & 8 deletions src/ui/src/components/visualizer/complex_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import {
SearchMatchType,
SearchNodeType,
} from './common/types';
import {IoTree} from './io_tree';

interface SearchMatchTypeOption {
type: SearchMatchType;
Expand All @@ -57,13 +56,7 @@ interface SearchNodeTypeOption {
@Component({
standalone: true,
selector: 'complex-queries',
imports: [
CommonModule,
IoTree,
MatIconModule,
MatMenuModule,
MatTooltipModule,
],
imports: [CommonModule, MatIconModule, MatMenuModule, MatTooltipModule],
templateUrl: './complex_queries.ng.html',
styleUrls: ['./complex_queries.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
10 changes: 5 additions & 5 deletions src/ui/src/components/visualizer/info_panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* ==============================================================================
*/

@import 'variables';
@use 'variables';

:host {
position: relative;
Expand Down Expand Up @@ -67,7 +67,7 @@
align-items: center;

&.search-match {
background-color: $search-match-color;
background-color: variables.$search-match-color;
}

.index {
Expand Down Expand Up @@ -197,7 +197,7 @@
vertical-align: text-top;

&.search-match {
background-color: $search-match-color;
background-color: variables.$search-match-color;
}

&:hover.has-hover-values {
Expand Down Expand Up @@ -258,7 +258,7 @@
}

&.search-match {
background-color: $search-match-color;
background-color: variables.$search-match-color;
}
}

Expand Down Expand Up @@ -290,7 +290,7 @@
padding: 0 12px;

&.search-match {
background-color: $search-match-color;
background-color: variables.$search-match-color;
}

.label-row {
Expand Down
6 changes: 3 additions & 3 deletions src/ui/src/components/visualizer/io_tree.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* ==============================================================================
*/

@import 'variables';
@use 'variables';

.io-tree {
background-color: transparent;
Expand Down Expand Up @@ -94,7 +94,7 @@
}

.node-label.search-match {
background-color: $search-match-color;
background-color: variables.$search-match-color;
}
}

Expand All @@ -116,7 +116,7 @@
vertical-align: text-top;

&.search-match {
background-color: $search-match-color;
background-color: variables.$search-match-color;
}

mat-icon.bullet {
Expand Down
10 changes: 5 additions & 5 deletions src/ui/src/components/visualizer/legends_panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* ==============================================================================
*/

@import 'variables';
@use 'variables';

$block_width: 30px;
$block_height: 14px;
Expand Down Expand Up @@ -54,7 +54,7 @@ $block_height: 14px;
}

.artificial-layer-key {
border: 1px solid $artificial-layer;
border: 1px solid variables.$artificial-layer;
width: $block_width;
height: $block_height;
background-color: #f1f1f1;
Expand All @@ -63,7 +63,7 @@ $block_height: 14px;
.selected-node-key {
width: $block_width;
height: $block_height;
border: 2px solid $selection-color;
border: 2px solid variables.$selection-color;
border-radius: 5px;
background-color: #c2e7ff;
}
Expand All @@ -79,14 +79,14 @@ $block_height: 14px;
width: $block_width;
height: $block_height;
border-radius: 5px;
border: 2px solid $incoming-edge-color;
border: 2px solid variables.$incoming-edge-color;
}

.output-key {
width: $block_width;
height: $block_height;
border-radius: 5px;
border: 2px solid $outgoing-edge-color;
border: 2px solid variables.$outgoing-edge-color;
}

.shortcut {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* ==============================================================================
*/

@import 'variables';
@use 'variables';

.container {
padding-top: 12px;
Expand Down Expand Up @@ -305,12 +305,12 @@
}

td.input {
color: $incoming-edge-color;
color: variables.$incoming-edge-color;
font-weight: 500;
}

td.output {
color: $outgoing-edge-color;
color: variables.$outgoing-edge-color;
font-weight: 500;
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/ui/src/components/visualizer/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ import {

import {MatIconModule} from '@angular/material/icon';

import {IoTree} from './io_tree';

/**
* A paginator for navigating through pages.
*/
@Component({
standalone: true,
selector: 'paginator',
imports: [CommonModule, IoTree, MatIconModule],
imports: [CommonModule, MatIconModule],
templateUrl: './paginator.ng.html',
styleUrls: ['./paginator.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
4 changes: 0 additions & 4 deletions src/ui/src/components/visualizer/renderer_wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ import {MatButtonModule} from '@angular/material/button';
import {MatIconModule} from '@angular/material/icon';
import {MatMenuModule} from '@angular/material/menu';
import {MatTooltipModule} from '@angular/material/tooltip';

import {Bubble} from '../bubble/bubble';
import {BubbleClick} from '../bubble/bubble_click';

import {AppService} from './app_service';
import {type ModelGraph} from './common/model_graph';
import {
Expand All @@ -59,7 +56,6 @@ import {WebglRenderer} from './webgl_renderer';
selector: 'renderer-wrapper',
imports: [
Bubble,
BubbleClick,
CommonModule,
EdgeOverlaysDropdown,
MatButtonModule,
Expand Down
6 changes: 0 additions & 6 deletions src/ui/src/components/visualizer/split_panes_container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
import {MatTooltipModule} from '@angular/material/tooltip';
import {combineLatest, fromEvent} from 'rxjs';
import {takeUntil} from 'rxjs/operators';

import {Bubble} from '../bubble/bubble';

import {AppService} from './app_service';
import {Pane} from './common/types';
import {
Expand All @@ -49,8 +47,6 @@ import {
WorkerEvent,
WorkerEventType,
} from './common/worker_events';
import {GraphPanel} from './graph_panel';
import {InfoPanel} from './info_panel';
import {SplitPane} from './split_pane';
import {SyncNavigationButton} from './sync_navigation_button';
import {SyncNavigationService} from './sync_navigation_service';
Expand All @@ -69,8 +65,6 @@ interface ProcessingTask {
imports: [
Bubble,
CommonModule,
GraphPanel,
InfoPanel,
MatIconModule,
MatProgressSpinnerModule,
MatTooltipModule,
Expand Down
15 changes: 14 additions & 1 deletion src/ui/src/components/visualizer/webgl_renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ type RenderElement = RenderElementNode | RenderElementEdge;
MatIconModule,
MatMenuModule,
MatTooltipModule,
IoTree,
],
providers: [
WebglRendererAttrsTableService,
Expand Down Expand Up @@ -886,6 +885,20 @@ export class WebglRenderer implements OnInit, OnDestroy {
);
deepestExpandedGroupNodeIds = groupNodeIds;
}
// Add the parent node of the selected node if it is not set in
// deepestExpandedGroupNodeIds.
else {
const selectedNode =
this.curModelGraph.nodesById[paneState.selectedNodeId];
const nsParentId = selectedNode?.nsParentId || '';
if (
selectedNode &&
nsParentId &&
!deepestExpandedGroupNodeIds.includes(nsParentId)
) {
deepestExpandedGroupNodeIds.push(nsParentId);
}
}
if (
paneState.selectedNodeId !== '' ||
deepestExpandedGroupNodeIds.length > 0
Expand Down

0 comments on commit 09d32f7

Please sign in to comment.