components/content/content.component.ts
Main content for application with:
selector | app-content |
imports |
MatExpansionModule
PlotsComponent
MatDivider
GeoDisaggComponent
ParameterSummaryComponent
NshmpLibNgAppMetadataComponent
DisaggSummaryComponent
DisaggContributorsComponent
DisaggDataComponent
|
templateUrl | ./content.component.html |
styleUrl | ./content.component.scss |
Properties |
constructor(service: AppService)
|
||||||
Defined in components/content/content.component.ts:65
|
||||||
Parameters :
|
componentData |
Default value : this.service.componentData
|
Defined in components/content/content.component.ts:38
|
disaggData |
Default value : this.service.disaggData
|
Defined in components/content/content.component.ts:40
|
Disaggregation data |
formGroup |
Default value : this.service.formGroup
|
Defined in components/content/content.component.ts:41
|
hasData |
Default value : computed(() => this.service.serviceResponse() !== null)
|
Defined in components/content/content.component.ts:43
|
hasLayers |
Default value : computed(() => {
const serviceResponse = this.service.serviceResponse();
if (serviceResponse === null || serviceResponse === undefined) {
return false;
}
const layers = serviceResponse.response.disaggs.find(disaggs =>
disaggs.data.find(data =>
data.sources.find(
source => source.latitude !== null && source.longitude !== null,
),
),
);
return layers !== undefined;
})
|
Defined in components/content/content.component.ts:46
|
Has geo disagg layers |
repositories |
Default value : computed(() => this.service.usage()?.metadata.repositories)
|
Defined in components/content/content.component.ts:65
|
Repo metadata |
import {Component, computed} from '@angular/core';
import {MatDivider} from '@angular/material/divider';
import {MatExpansionModule} from '@angular/material/expansion';
import {NshmpLibNgAppMetadataComponent} from '@ghsc/nshmp-lib-ng/nshmp';
import {AppService} from '../../services/app.service';
import {DisaggContributorsComponent} from '../disagg-contributors/disagg-contributors.component';
import {DisaggDataComponent} from '../disagg-data/disagg-data.component';
import {DisaggSummaryComponent} from '../disagg-summary/disagg-summary.component';
import {GeoDisaggComponent} from '../geo-disagg/geo-disagg.component';
import {ParameterSummaryComponent} from '../parameter-summary/parameter-summary.component';
import {PlotsComponent} from '../plots/plots.component';
/**
* Main content for application with:
* - disagg plot: {@link ../plots/plots.component.ts}
* - parameter summary: {@link ../parameter-summary/parameter-summary.component.ts}
* - disagg summary: {@link ../disagg-summary/disagg-summary.component.ts}
* - disagg contributions: {@link ../disagg-contributions/disagg-contributions.component.ts}
*/
@Component({
imports: [
MatExpansionModule,
PlotsComponent,
MatDivider,
GeoDisaggComponent,
ParameterSummaryComponent,
NshmpLibNgAppMetadataComponent,
DisaggSummaryComponent,
DisaggContributorsComponent,
DisaggDataComponent,
],
selector: 'app-content',
styleUrl: './content.component.scss',
templateUrl: './content.component.html',
})
export class ContentComponent {
componentData = this.service.componentData;
/** Disaggregation data */
disaggData = this.service.disaggData;
formGroup = this.service.formGroup;
hasData = computed(() => this.service.serviceResponse() !== null);
/** Has geo disagg layers */
hasLayers = computed(() => {
const serviceResponse = this.service.serviceResponse();
if (serviceResponse === null || serviceResponse === undefined) {
return false;
}
const layers = serviceResponse.response.disaggs.find(disaggs =>
disaggs.data.find(data =>
data.sources.find(
source => source.latitude !== null && source.longitude !== null,
),
),
);
return layers !== undefined;
});
/** Repo metadata */
repositories = computed(() => this.service.usage()?.metadata.repositories);
constructor(private service: AppService) {}
}
<div class="height-full overflow-auto report">
<div class="grid-container-widescreen">
<!-- Report title, show only on print -->
<div class="print-content-only">
<h2>Disaggregation Report</h2>
</div>
<div class="padding-y-4">
<mat-accordion multi>
<!-- Disagg plot panel -->
<mat-expansion-panel expanded class="disagg-panel">
<mat-expansion-panel-header>
<mat-panel-title>Disaggregation</mat-panel-title>
</mat-expansion-panel-header>
<app-plots />
</mat-expansion-panel>
<!-- Geographical disagg panel -->
<mat-expansion-panel
[expanded]="hasLayers()"
[disabled]="hasLayers() === false"
class="geo-disagg-panel print-page-break"
>
<mat-expansion-panel-header>
<mat-panel-title>Geographical Disaggregation</mat-panel-title>
</mat-expansion-panel-header>
<mat-divider />
<app-geo-disagg />
</mat-expansion-panel>
<!-- Parameter summary panel -->
<mat-expansion-panel expanded>
<mat-expansion-panel-header>
<mat-panel-title>Parameter Summary</mat-panel-title>
</mat-expansion-panel-header>
<app-parameter-summary />
</mat-expansion-panel>
<!-- Summary report -->
<mat-expansion-panel
class="summary-report print-full-page print-page-break"
[expanded]="disaggData()"
[disabled]="disaggData() === null"
>
<mat-expansion-panel-header>
<mat-panel-title
>Disaggregation Summary:
{{ formGroup.getRawValue().disaggComponent }}</mat-panel-title
>
</mat-expansion-panel-header>
<app-disagg-summary [componentData]="componentData()" />
</mat-expansion-panel>
<!-- Contributions -->
<mat-expansion-panel
class="contributions print-full-page print-page-break"
[expanded]="componentData()?.sources.length > 0"
[disabled]="componentData()?.sources.length === 0"
>
<mat-expansion-panel-header>
<mat-panel-title
>Disaggregation Contributions:
{{ formGroup.getRawValue().disaggComponent }}</mat-panel-title
>
</mat-expansion-panel-header>
<app-disagg-contributors [componentData]="componentData()" />
</mat-expansion-panel>
<!-- Data -->
<mat-expansion-panel
class="print-display-none"
[expanded]="componentData()?.data.length > 0"
[disabled]="componentData()?.data.length === 0"
>
<mat-expansion-panel-header>
<mat-panel-title
>Disaggregation Data:
{{ formGroup.getRawValue().disaggComponent }}</mat-panel-title
>
</mat-expansion-panel-header>
<app-disagg-data [componentData]="componentData()" />
</mat-expansion-panel>
<!-- App metadata -->
<mat-expansion-panel class="print-page-break" expanded>
<mat-expansion-panel-header>
<mat-panel-title>Application Metadata</mat-panel-title>
</mat-expansion-panel-header>
<mat-divider />
<nshmp-lib-ng-app-metadata [repositories]="repositories()" />
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</div>