diff --git a/projects/common-map/src/fm-map/common-map.module.ts b/projects/common-map/src/fm-map/common-map.module.ts index f051ae5..588732c 100644 --- a/projects/common-map/src/fm-map/common-map.module.ts +++ b/projects/common-map/src/fm-map/common-map.module.ts @@ -67,6 +67,8 @@ import { ForSourceTask} from './components/for-item/for-sourcetask.decorator'; import { ForPackage } from './components/for-item/for-package.decorator'; import { PanToLocation} from './components/aol/pan-to-location/pan-to-location.component'; import {LayerSwitcher} from './components/layer-switcher/layer-switcher.component'; +import {HistogramDetailsComponent} from './components/legend/histogram-details/histogram-details.component'; +import {StatisticsDetailsComponent} from './components/legend/statistics-details/statistics-details.component'; export function LocalStorageSync(reducer: ActionReducer): ActionReducer { const r = function(state, action) { @@ -148,7 +150,7 @@ export { ForPackage } -@NgModule({ +@NgModule({ imports: [ CommonModule, AngularOpenlayersModule, @@ -195,7 +197,9 @@ export { WidgetStatusComponent, GpsLocation, PanToLocation, - LayerSwitcher + LayerSwitcher, + HistogramDetailsComponent, + StatisticsDetailsComponent ], entryComponents: [ FeatureListComponent, @@ -255,7 +259,7 @@ export { export class AppCommonMapModule { static forRoot(): ModuleWithProviders { return { - ngModule: AppCommonMapModule, + ngModule: AppCommonMapModule, providers: [ FeatureIconService, GeolocationService, 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 new file mode 100644 index 0000000..e9e618c --- /dev/null +++ b/projects/common-map/src/fm-map/components/legend/histogram-details/histogram-details.component.html @@ -0,0 +1,15 @@ +
+
Average:
+
{{histogram.mean| number:'1.0-2'}}
+
Standard deviation:
+
{{histogram.stddev| number:'1.0-2'}}
+
Min:
+
{{histogram.min| number:'1.0-2'}}
+
Max:
+
{{histogram.max| number:'1.0-2'}}
+ + +
Confidence interval:
+
{{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 new file mode 100644 index 0000000..e02a0cf --- /dev/null +++ b/projects/common-map/src/fm-map/components/legend/histogram-details/histogram-details.component.ts @@ -0,0 +1,20 @@ +import {Component, Input} from '@angular/core'; +import {IHistogram, ILayer} from '../../../models/color.map'; + +@Component({ + selector: 'fm-map-histogram-details', + templateUrl: './histogram-details.component.html', + styles: ['.nopadding{\n' + + ' padding: 0 !important;\n' + + ' margin: 0 !important;\n' + + '}'] +}) +export class HistogramDetailsComponent { + + @Input() + histogram: IHistogram; + + 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 96c5748..927443c 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 @@ -30,21 +30,11 @@
-
-
Average:
-
{{layer.renderer.band.histogram.mean| number:'1.0-2'}}
-
Standard deviation:
-
{{layer.renderer.band.histogram.stddev| number:'1.0-2'}}
-
Min:
-
{{layer.renderer.band.histogram.min| number:'1.0-2'}}
-
Max:
-
{{layer.renderer.band.histogram.max| number:'1.0-2'}}
- - -
Confidence interval:
-
{{layer.renderer.band.histogram.confidence * 100| number:'1.0-0'}}%
-
-
+ + + +
diff --git a/projects/common-map/src/fm-map/components/legend/legend.component.scss b/projects/common-map/src/fm-map/components/legend/legend.component.scss index 428b21f..8ba4fd7 100644 --- a/projects/common-map/src/fm-map/components/legend/legend.component.scss +++ b/projects/common-map/src/fm-map/components/legend/legend.component.scss @@ -16,11 +16,6 @@ margin-bottom: 0; } -.nopadding{ - padding: 0 !important; - margin: 0 !important; -} - span.color { display:inline-block; width: 1.5em; diff --git a/projects/common-map/src/fm-map/components/legend/legend.component.ts b/projects/common-map/src/fm-map/components/legend/legend.component.ts index 2244a27..c3eb47b 100644 --- a/projects/common-map/src/fm-map/components/legend/legend.component.ts +++ b/projects/common-map/src/fm-map/components/legend/legend.component.ts @@ -88,8 +88,8 @@ export class LegendComponent implements OnInit,AfterViewInit { return this.histogramenabled && this.layer.renderer.band.histogram.entries && this.layer.renderer.band.histogram.entries.length > 0 && this.layer.renderer.colorMap.colormapType == "minmax"; } - showConfidenceInterval():boolean { - return this.histogramenabled && this.layer.renderer.band.histogram.confidence != null && this.layer.renderer.band.histogram.confidence != 1; + bandContainsHistogram(): boolean { + return this.layer.renderer.band.histogram != null; } } diff --git a/projects/common-map/src/fm-map/components/legend/statistics-details/statistics-details.component.html b/projects/common-map/src/fm-map/components/legend/statistics-details/statistics-details.component.html new file mode 100644 index 0000000..fbceb89 --- /dev/null +++ b/projects/common-map/src/fm-map/components/legend/statistics-details/statistics-details.component.html @@ -0,0 +1,32 @@ +
+
Population count:
+
{{statistics.populationCount| number:'1.0-0'}}
+
Min:
+
{{statistics.min| number:'1.0-2'}}
+
Max:
+
{{statistics.max| number:'1.0-2'}}
+
Min plus:
+
{{statistics.minPlus| number:'1.0-2'}}
+
Max minus:
+
{{statistics.maxMinus| number:'1.0-2'}}
+ +
Average:
+
{{statistics.mean| number:'1.0-2'}}
+
Standard deviation:
+
{{statistics.stddev| number:'1.0-2'}}
+ +
Mode:
+
{{statistics.mode| number:'1.0-2'}}
+
Median:
+
{{statistics.median| number:'1.0-2'}}
+ +
Kurtosis:
+
{{statistics.curtosis| number:'1.0-2'}}
+
Skewness:
+
{{statistics.skewness| number:'1.0-2'}}
+ +
Variance:
+
{{statistics.variance| number:'1.0-2'}}
+
Variance coefficient:
+
{{statistics.variationCoefficient| number:'1.0-2'}}
+
diff --git a/projects/common-map/src/fm-map/components/legend/statistics-details/statistics-details.component.ts b/projects/common-map/src/fm-map/components/legend/statistics-details/statistics-details.component.ts new file mode 100644 index 0000000..cfb530f --- /dev/null +++ b/projects/common-map/src/fm-map/components/legend/statistics-details/statistics-details.component.ts @@ -0,0 +1,16 @@ +import {Component, Input} from '@angular/core'; +import {IStatistics} from '../../../models/color.map'; + +@Component({ + selector: 'fm-map-statistics-details', + templateUrl: './statistics-details.component.html', + styles: ['.nopadding{\n' + + ' padding: 0 !important;\n' + + ' margin: 0 !important;\n' + + '}'] +}) +export class StatisticsDetailsComponent { + + @Input() + statistics: IStatistics; +} diff --git a/projects/common-map/src/fm-map/models/color.map.ts b/projects/common-map/src/fm-map/models/color.map.ts index 64e7337..32bc9c0 100644 --- a/projects/common-map/src/fm-map/models/color.map.ts +++ b/projects/common-map/src/fm-map/models/color.map.ts @@ -28,6 +28,22 @@ export interface IHistogram { confidence?: number; } +export interface IStatistics { + min: number; + max: number; + mean: number; + stddev: number; + populationCount: number; + minPlus: number; + maxMinus: number; + mode: number; + median: number; + curtosis: number; + skewness: number; + variance: number; + variationCoefficient: number; +} + export interface IGradientstop { relativestop: number, color: IColor @@ -41,7 +57,8 @@ export interface IColorMap { } export interface IBand { - histogram: IHistogram + histogram: IHistogram; + statistics?: IStatistics; }