aboutsummaryrefslogtreecommitdiff
path: root/src/client/northstar/dash-nodes/HistogramBox.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-05-14 20:01:11 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-05-14 20:01:11 -0400
commitb7fc5faed0fc999d9c093357f94b97d611c02af3 (patch)
tree8e988cb937c19a781928859b1a019138caab25c4 /src/client/northstar/dash-nodes/HistogramBox.tsx
parent1ae0370e6a116404085f6864c8b644fcde80f460 (diff)
parent8d03f27dc28e3d0ed8bb0a86339fec18ee56ef38 (diff)
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/northstar/dash-nodes/HistogramBox.tsx')
-rw-r--r--src/client/northstar/dash-nodes/HistogramBox.tsx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/client/northstar/dash-nodes/HistogramBox.tsx b/src/client/northstar/dash-nodes/HistogramBox.tsx
index ed556cf45..eb1ad69b7 100644
--- a/src/client/northstar/dash-nodes/HistogramBox.tsx
+++ b/src/client/northstar/dash-nodes/HistogramBox.tsx
@@ -17,9 +17,8 @@ import "./HistogramBox.scss";
import { HistogramBoxPrimitives } from './HistogramBoxPrimitives';
import { HistogramLabelPrimitives } from "./HistogramLabelPrimitives";
import { StyleConstants } from "../utils/StyleContants";
-import { NumCast, Cast } from "../../../new_fields/Types";
-import { listSpec } from "../../../new_fields/Schema";
-import { Doc, DocListCast } from "../../../new_fields/Doc";
+import { Cast } from "../../../new_fields/Types";
+import { Doc, DocListCast, DocListCastAsync } from "../../../new_fields/Doc";
import { Id } from "../../../new_fields/RefField";
@@ -119,15 +118,16 @@ export class HistogramBox extends React.Component<FieldViewProps> {
if (this.HistoOp !== HistogramOperation.Empty) {
reaction(() => DocListCast(this.props.Document.linkedFromDocs), (docs) => this.HistoOp.Links.splice(0, this.HistoOp.Links.length, ...docs), { fireImmediately: true });
reaction(() => DocListCast(this.props.Document.brushingDocs).length,
- () => {
- let brushingDocs = DocListCast(this.props.Document.brushingDocs);
+ async () => {
+ let brushingDocs = await DocListCastAsync(this.props.Document.brushingDocs);
const proto = this.props.Document.proto;
- if (proto) {
- this.HistoOp.BrushLinks.splice(0, this.HistoOp.BrushLinks.length, ...brushingDocs.map((brush, i) => {
+ if (proto && brushingDocs) {
+ let mapped = brushingDocs.map((brush, i) => {
brush.backgroundColor = StyleConstants.BRUSH_COLORS[i % StyleConstants.BRUSH_COLORS.length];
let brushed = DocListCast(brush.brushingDocs);
return { l: brush, b: brushed[0][Id] === proto[Id] ? brushed[1] : brushed[0] };
- }));
+ });
+ this.HistoOp.BrushLinks.splice(0, this.HistoOp.BrushLinks.length, ...mapped);
}
}, { fireImmediately: true });
reaction(() => this.createOperationParamsCache, () => this.HistoOp.Update(), { fireImmediately: true });