components/plot-settings-panel/plot-settings-panel.component.ts
Plot settings panel.
selector | app-plot-settings-panel |
imports |
NshmpPlotSettingsExpansionPanelComponent
|
templateUrl | ./plot-settings-panel.component.html |
styleUrl | ./plot-settings-panel.component.scss |
Properties |
service |
Default value : inject(AppService)
|
import {Component, computed, inject} from '@angular/core';
import {hazardUtils} from '@ghsc/nshmp-lib-ng/hazard';
import {NshmpPlotSettingsExpansionPanelComponent, PlotSettingsPlots} from '@ghsc/nshmp-lib-ng/plot';
import {AppService} from '../../services/app.service';
/**
* Plot settings panel.
*/
@Component({
imports: [NshmpPlotSettingsExpansionPanelComponent],
selector: 'app-plot-settings-panel',
styleUrl: './plot-settings-panel.component.scss',
templateUrl: './plot-settings-panel.component.html',
})
export class PlotSettingsPanelComponent {
service = inject(AppService);
plots = computed<PlotSettingsPlots[]>(() => {
const hazardPlot = this.service.hazardPlotState();
const spectrumPlot = this.service.spectrumPlotState();
const defaultPlots = hazardUtils.hazardDefaultPlots();
return [
{
defaultPlotSetting: defaultPlots.hazard.settingsForm.getRawValue(),
plot: hazardPlot,
},
{
defaultPlotSetting: defaultPlots.spectrum.settingsForm.getRawValue(),
plot: spectrumPlot,
},
];
});
}
<nshmp-plot-settings-expansion-panel [plots]="plots()" />