Oops remember to test it next time..
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
This commit is contained in:
parent
0948bacaaf
commit
5d7fd63adc
@ -1,5 +1,5 @@
|
|||||||
import { Component, OnInit, Input,AfterViewInit } from '@angular/core';
|
import { Component, OnInit, Input,AfterViewInit } from '@angular/core';
|
||||||
import { IColorMap, IColor, IColorEntry,ILayer, IRenderer } from '../../models';
|
import { IColorMap, IColor, IColorEntry,ILayer, IRenderer } from '../../models/color.map';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -48,7 +48,7 @@ export class LegendComponent implements OnInit,AfterViewInit {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
private getHex(color: IColor): string {
|
public getHex(color: IColor): string {
|
||||||
return '#' + this.componentToHex(color.red) + this.componentToHex(color.green) + this.componentToHex(color.blue);
|
return '#' + this.componentToHex(color.red) + this.componentToHex(color.green) + this.componentToHex(color.blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ export class LegendComponent implements OnInit,AfterViewInit {
|
|||||||
return hex.length === 1 ? `0${hex}` : hex;
|
return hex.length === 1 ? `0${hex}` : hex;
|
||||||
}
|
}
|
||||||
|
|
||||||
private getPart(renderer: IRenderer, index: number): string {
|
public getPart(renderer: IRenderer, index: number): string {
|
||||||
let max = renderer.band.histogram.entries.reduce((max, entry) => entry.freqency > max ? entry.freqency : max, 0);
|
let max = renderer.band.histogram.entries.reduce((max, entry) => entry.freqency > max ? entry.freqency : max, 0);
|
||||||
let scale = 75 / max;
|
let scale = 75 / max;
|
||||||
let part = (renderer.band.histogram.entries[index].freqency * scale) + "%";
|
let part = (renderer.band.histogram.entries[index].freqency * scale) + "%";
|
||||||
@ -65,7 +65,7 @@ export class LegendComponent implements OnInit,AfterViewInit {
|
|||||||
return part;
|
return part;
|
||||||
}
|
}
|
||||||
|
|
||||||
private getLabel(renderer: IRenderer, index: number): string {
|
public getLabel(renderer: IRenderer, index: number): string {
|
||||||
let scale = 100 / renderer.band.histogram.entries.reduce((sum, entry) => sum + entry.freqency, 0);
|
let scale = 100 / renderer.band.histogram.entries.reduce((sum, entry) => sum + entry.freqency, 0);
|
||||||
let percent = renderer.band.histogram.entries[index].freqency * scale;
|
let percent = renderer.band.histogram.entries[index].freqency * scale;
|
||||||
return percent < 0.1 ? "" : percent.toFixed(1) + " %";
|
return percent < 0.1 ? "" : percent.toFixed(1) + " %";
|
||||||
|
@ -30,9 +30,10 @@ export interface IGradientstop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IColorMap {
|
export interface IColorMap {
|
||||||
gradient: IGradientstop[],
|
gradient: IGradientstop[],
|
||||||
noValue: IColorEntry,
|
noValue: IColorEntry,
|
||||||
entries: IColorEntry[]
|
entries: IColorEntry[],
|
||||||
|
colormapType: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IBand {
|
export interface IBand {
|
||||||
|
Loading…
Reference in New Issue
Block a user