Skip to content

Commit 0e1a219

Browse files
committed
Update to put the Track Kinematics under the More Info menu
1 parent 2eb8171 commit 0e1a219

5 files changed

Lines changed: 35 additions & 11 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
<app-menu-toggle
2-
tooltip="Track kinematics"
3-
icon="kinematics"
4-
[active]="showKinematics"
5-
(click)="toggleOverlay()"
6-
>
7-
</app-menu-toggle>

packages/phoenix-ng/projects/phoenix-ui-components/lib/components/ui-menu/more-info/more-info.component.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
#geometryBrowser
1818
*ngIf="uiConfig?.showGeometryBrowser"
1919
></app-geometry-browser>
20+
<app-kinematics-panel
21+
#kinematicsPanel
22+
*ngIf="uiConfig?.showKinematicsPanel"
23+
[config]="kinematicsConfig"
24+
></app-kinematics-panel>
2025
</div>
2126

2227
<mat-menu #moreInfo>
@@ -90,6 +95,20 @@
9095
</span>
9196
</mat-checkbox>
9297
</button>
98+
<button mat-menu-item *ngIf="uiConfig?.showKinematicsPanel">
99+
<mat-checkbox
100+
[checked]="showKinematicsPanel"
101+
(click)="$event.stopPropagation()"
102+
(change)="toggleKinematicsPanel()"
103+
>
104+
<span class="item-content">
105+
<svg class="item-icon">
106+
<use href="assets/icons/kinematics.svg#kinematics"></use>
107+
</svg>
108+
Track Kinematics
109+
</span>
110+
</mat-checkbox>
111+
</button>
93112
</mat-menu>
94113

95114
<app-menu-toggle

packages/phoenix-ng/projects/phoenix-ui-components/lib/components/ui-menu/more-info/more-info.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { EventBrowserComponent } from '../event-browser/event-browser.component'
55
import { CollectionsInfoComponent } from '../collections-info/collections-info.component';
66
import { EtaPhiPanelComponent } from '../eta-phi-panel/eta-phi-panel.component';
77
import { GeometryBrowserComponent } from '../geometry-browser/geometry-browser.component';
8+
import { KinematicsPanelComponent } from '../kinematics-panel/kinematics-panel.component';
9+
import type { KinematicsConfig } from 'phoenix-event-display';
810

911
@Component({
1012
standalone: false,
@@ -14,18 +16,21 @@ import { GeometryBrowserComponent } from '../geometry-browser/geometry-browser.c
1416
})
1517
export class MoreInfoComponent {
1618
@Input() uiConfig: UIMenuConfig = defaultUIMenuConfig;
19+
@Input() kinematicsConfig?: KinematicsConfig;
1720

1821
@ViewChild('infoPanel') infoPanel: InfoPanelComponent;
1922
@ViewChild('eventBrowser') eventBrowser: EventBrowserComponent;
2023
@ViewChild('collectionsInfo') collectionsInfo: CollectionsInfoComponent;
2124
@ViewChild('etaPhiPanel') etaPhiPanel: EtaPhiPanelComponent;
2225
@ViewChild('geometryBrowser') geometryBrowser: GeometryBrowserComponent;
26+
@ViewChild('kinematicsPanel') kinematicsPanel!: KinematicsPanelComponent;
2327

2428
showInfoPanel = false;
2529
showEventBrowser = false;
2630
showCollectionsInfo = false;
2731
showEtaPhiPanel = false;
2832
showGeometryBrowser = false;
33+
showKinematicsPanel = false;
2934

3035
toggleInfoPanel() {
3136
this.showInfoPanel = !this.showInfoPanel;
@@ -51,4 +56,9 @@ export class MoreInfoComponent {
5156
this.showGeometryBrowser = !this.showGeometryBrowser;
5257
this.geometryBrowser?.toggleOverlay();
5358
}
59+
60+
toggleKinematicsPanel() {
61+
this.showKinematicsPanel = !this.showKinematicsPanel;
62+
this.kinematicsPanel?.toggleOverlay();
63+
}
5464
}

packages/phoenix-ng/projects/phoenix-ui-components/lib/components/ui-menu/ui-menu.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@
3838
></app-animate-camera>
3939

4040
<!-- More information panels -->
41-
<app-more-info [uiConfig]="uiConfig"></app-more-info>
41+
<app-more-info
42+
[uiConfig]="uiConfig"
43+
[kinematicsConfig]="kinematicsConfig"
44+
></app-more-info>
4245

4346
<!-- Toggle for performance -->
4447
<app-performance-toggle
@@ -62,9 +65,6 @@
6265
<!-- Toggle for shareable link constructor modal-->
6366
<app-share-link *ngIf="uiConfig.showShareLink"></app-share-link>
6467

65-
<!-- Kinematics panel -->
66-
<app-kinematics-panel [config]="kinematicsConfig"></app-kinematics-panel>
67-
6868
<!-- Extra options -->
6969
<ng-content></ng-content>
7070
</app-ui-menu-wrapper>

packages/phoenix-ng/projects/phoenix-ui-components/lib/components/ui-menu/ui-menu.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export interface UIMenuConfig {
2222
showInfoPanel?: boolean;
2323
showEventBrowser?: boolean;
2424
showEtaPhiPanel?: boolean;
25+
showKinematicsPanel?: boolean;
2526
}
2627

2728
export const defaultUIMenuConfig: UIMenuConfig = {
@@ -40,6 +41,7 @@ export const defaultUIMenuConfig: UIMenuConfig = {
4041
showInfoPanel: true,
4142
showEventBrowser: true,
4243
showEtaPhiPanel: true,
44+
showKinematicsPanel: true,
4345
};
4446

4547
@Component({

0 commit comments

Comments
 (0)