From 8e304fc6eb04393a6172d376d8f2fa8703175bd6 Mon Sep 17 00:00:00 2001 From: Mark van der Wal Date: Thu, 23 Nov 2023 21:13:44 +0100 Subject: [PATCH] also use scale for histogram --- .../histogram-details.component.html | 10 +++++----- .../histogram-details/histogram-details.component.ts | 11 +++++++++++ .../fm-map/components/legend/legend.component.html | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/projects/common-map/src/fm-map/components/legend/histogram-details/histogram-details.component.html b/projects/common-map/src/fm-map/components/legend/histogram-details/histogram-details.component.html index 210a026..16bc3d0 100644 --- a/projects/common-map/src/fm-map/components/legend/histogram-details/histogram-details.component.html +++ b/projects/common-map/src/fm-map/components/legend/histogram-details/histogram-details.component.html @@ -1,15 +1,15 @@
Average:
-
{{histogram.mean| number:'1.0-2'}}
+
{{ getScaledValue(histogram.mean| number:'1.0-2')}}
Standard deviation:
-
{{histogram.stddev| number:'1.0-2'}}
+
{{ getScaledValue(histogram.stddev| number:'1.0-2')}}
Min:
-
{{histogram.min| number:'1.0-2'}}
+
{{ getScaledValue(histogram.min| number:'1.0-2')}}
Max:
-
{{histogram.max| number:'1.0-2'}}
+
{{ getScaledValue(histogram.max| number:'1.0-2')}}
Confidence interval:
-
{{histogram.confidence * 100| number:'1.0-0'}}%
+
{{ getScaledValue(histogram.confidence * 100)| number:'1.0-0'}}%
diff --git a/projects/common-map/src/fm-map/components/legend/histogram-details/histogram-details.component.ts b/projects/common-map/src/fm-map/components/legend/histogram-details/histogram-details.component.ts index e02a0cf..29cfa8e 100644 --- a/projects/common-map/src/fm-map/components/legend/histogram-details/histogram-details.component.ts +++ b/projects/common-map/src/fm-map/components/legend/histogram-details/histogram-details.component.ts @@ -14,6 +14,17 @@ export class HistogramDetailsComponent { @Input() histogram: IHistogram; + @Input() + scale: number | null; + + public getScaledValue(value: number): number { + let v = value; + if (this.scale && this.scale != 0) { + v = this.scale * value; + } + return v; + } + showConfidenceInterval(): boolean { return this.histogram.confidence != null && this.histogram.confidence !== 1; } diff --git a/projects/common-map/src/fm-map/components/legend/legend.component.html b/projects/common-map/src/fm-map/components/legend/legend.component.html index e30e66a..f81496d 100644 --- a/projects/common-map/src/fm-map/components/legend/legend.component.html +++ b/projects/common-map/src/fm-map/components/legend/legend.component.html @@ -35,7 +35,7 @@ - +