aboutsummaryrefslogtreecommitdiff
path: root/src/client/northstar/dash-nodes/HistogramBinPrimitiveCollection.ts
diff options
context:
space:
mode:
authorEleanor Eng <eleanor_eng@brown.edu>2019-06-04 10:29:02 -0400
committerEleanor Eng <eleanor_eng@brown.edu>2019-06-04 10:29:02 -0400
commit376ebd44a16dfa04aacd3582e87767aed1a01f36 (patch)
tree3a9e623cf6689e1ea6975954596bf5bda6303249 /src/client/northstar/dash-nodes/HistogramBinPrimitiveCollection.ts
parent8f14e688220096ccecfd1aa0dd54b00e48f92270 (diff)
parent6f49d067b58caf6297f7ae7687cf05b627c27a1d (diff)
merge with master
Diffstat (limited to 'src/client/northstar/dash-nodes/HistogramBinPrimitiveCollection.ts')
-rw-r--r--src/client/northstar/dash-nodes/HistogramBinPrimitiveCollection.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/northstar/dash-nodes/HistogramBinPrimitiveCollection.ts b/src/client/northstar/dash-nodes/HistogramBinPrimitiveCollection.ts
index 6291ec1fc..3e9145a1b 100644
--- a/src/client/northstar/dash-nodes/HistogramBinPrimitiveCollection.ts
+++ b/src/client/northstar/dash-nodes/HistogramBinPrimitiveCollection.ts
@@ -198,8 +198,8 @@ export class HistogramBinPrimitiveCollection {
var marginParams = new MarginAggregateParameters();
marginParams.aggregateFunction = axis.AggregateFunction;
var marginAggregateKey = ModelHelpers.CreateAggregateKey(this.histoOp.Schema!.distinctAttributeParameters, axis, this.histoResult, brush.brushIndex!, marginParams);
- var marginResult = ModelHelpers.GetAggregateResult(bin, marginAggregateKey) as MarginAggregateResult;
- return !marginResult ? 0 : marginResult.absolutMargin!;
+ let aggResult = ModelHelpers.GetAggregateResult(bin, marginAggregateKey);
+ return aggResult instanceof MarginAggregateResult && aggResult.absolutMargin ? aggResult.absolutMargin : 0;
}
private createBinPrimitive(barAxis: number, brush: Brush, marginRect: PIXIRectangle,