aboutsummaryrefslogtreecommitdiff
path: root/src/client/northstar/dash-nodes/HistogramBinPrimitiveCollection.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-05-14 18:59:32 -0400
committerbob <bcz@cs.brown.edu>2019-05-14 18:59:32 -0400
commit281bfa589bd1ca66823003ca91cc11ce895fe5e2 (patch)
tree9380004d6bd4b7f8c6dbd497b9100b4142b869e4 /src/client/northstar/dash-nodes/HistogramBinPrimitiveCollection.ts
parent39e0f933fc446e70ae14006f8d9952822d798fe3 (diff)
fixes for northstar
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,