diff options
| author | bob <bcz@cs.brown.edu> | 2019-03-20 18:00:39 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-03-20 18:00:39 -0400 |
| commit | a16e6592caafb601b59c3d9f7609e8c1af231eba (patch) | |
| tree | e732e34c5a9fc371bf328fdd35a08ddd196bf6af /src/client/northstar/model/binRanges/VisualBinRange.ts | |
| parent | 208a57b15e6b415659311873431dbe9d5b8d8021 (diff) | |
initial
Diffstat (limited to 'src/client/northstar/model/binRanges/VisualBinRange.ts')
| -rw-r--r-- | src/client/northstar/model/binRanges/VisualBinRange.ts | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/client/northstar/model/binRanges/VisualBinRange.ts b/src/client/northstar/model/binRanges/VisualBinRange.ts new file mode 100644 index 000000000..f53008f9a --- /dev/null +++ b/src/client/northstar/model/binRanges/VisualBinRange.ts @@ -0,0 +1,36 @@ +import { BinLabel } from '../../model/idea/idea' + +export abstract class VisualBinRange { + + constructor() { + + } + + public abstract AddStep(value: number): number; + + public abstract GetValueFromIndex(index: number): number; + + public abstract GetBins(): Array<number>; + + public GetLabel(value: number): string { + return value.toString(); + } + + public GetLabels(): Array<BinLabel> { + var labels = new Array<BinLabel>(); + var bins = this.GetBins(); + bins.forEach(b => { + labels.push(new BinLabel({ + value: b, + minValue: b, + maxValue: this.AddStep(b), + label: this.GetLabel(b) + })); + }); + return labels; + } +} + +export enum ChartType { + HorizontalBar = 0, VerticalBar = 1, HeatMap = 2, SinglePoint = 3 +}
\ No newline at end of file |
