aboutsummaryrefslogtreecommitdiff
path: root/src/client/northstar/dash-fields/HistogramField.ts
diff options
context:
space:
mode:
authorlaurawilsonri <laura_wilson@brown.edu>2019-04-15 20:20:46 -0400
committerlaurawilsonri <laura_wilson@brown.edu>2019-04-15 20:20:46 -0400
commitb7a766aa5d53686e032b34d7213ad543108f12c3 (patch)
treed71854e091fa24997a30856d9ac9c937a6cd45d2 /src/client/northstar/dash-fields/HistogramField.ts
parent8b1026d357dd40fc4a00010739d99ffc9db08641 (diff)
parentff6ba4107aa33e021803399180b0d2844fc19d84 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into richTextEditor
Diffstat (limited to 'src/client/northstar/dash-fields/HistogramField.ts')
-rw-r--r--src/client/northstar/dash-fields/HistogramField.ts17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/client/northstar/dash-fields/HistogramField.ts b/src/client/northstar/dash-fields/HistogramField.ts
index 6abde4677..c699691a4 100644
--- a/src/client/northstar/dash-fields/HistogramField.ts
+++ b/src/client/northstar/dash-fields/HistogramField.ts
@@ -6,6 +6,7 @@ import { BasicField } from "../../../fields/BasicField";
import { Field, FieldId } from "../../../fields/Field";
import { CurrentUserUtils } from "../../../server/authentication/models/current_user_utils";
import { Types } from "../../../server/Message";
+import { OmitKeys } from "../../../Utils";
export class HistogramField extends BasicField<HistogramOperation> {
@@ -13,17 +14,8 @@ export class HistogramField extends BasicField<HistogramOperation> {
super(data ? data : HistogramOperation.Empty, save, id);
}
- omitKeys(obj: any, keys: any) {
- var dup: any = {};
- for (var key in obj) {
- if (keys.indexOf(key) === -1) {
- dup[key] = obj[key];
- }
- }
- return dup;
- }
toString(): string {
- return JSON.stringify(this.omitKeys(this.Data, ['Links', 'BrushLinks', 'Result', 'BrushColors', 'FilterModels', 'FilterOperand']));
+ return JSON.stringify(OmitKeys(this.Data, ['Links', 'BrushLinks', 'Result', 'BrushColors', 'FilterModels', 'FilterOperand']));
}
Copy(): Field {
@@ -35,12 +27,11 @@ export class HistogramField extends BasicField<HistogramOperation> {
}
- ToJson(): { type: Types, data: string, _id: string } {
+ ToJson() {
return {
type: Types.HistogramOp,
-
data: this.toString(),
- _id: this.Id
+ id: this.Id
};
}