From 991924427b7ba65f027493cbd23bb6aa3028a661 Mon Sep 17 00:00:00 2001 From: Tyler Schicke Date: Sat, 16 Mar 2019 17:27:46 -0400 Subject: Set up ink and image webpack entries --- deploy/mobile/image.html | 13 +++++++++++++ deploy/mobile/ink.html | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 deploy/mobile/image.html create mode 100644 deploy/mobile/ink.html (limited to 'deploy') diff --git a/deploy/mobile/image.html b/deploy/mobile/image.html new file mode 100644 index 000000000..0a5f90d79 --- /dev/null +++ b/deploy/mobile/image.html @@ -0,0 +1,13 @@ + + + + Test view + + + + +
+ + + + \ No newline at end of file diff --git a/deploy/mobile/ink.html b/deploy/mobile/ink.html new file mode 100644 index 000000000..938d85794 --- /dev/null +++ b/deploy/mobile/ink.html @@ -0,0 +1,13 @@ + + + + Test view + + + + +
+ + + + \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 1b75c63e8de0a09adb4243b9c797224da7c157eb Mon Sep 17 00:00:00 2001 From: Andrew Kim Date: Sat, 16 Mar 2019 18:27:11 -0400 Subject: testing --- deploy/mobile/image.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deploy') diff --git a/deploy/mobile/image.html b/deploy/mobile/image.html index 0a5f90d79..07fba8cc5 100644 --- a/deploy/mobile/image.html +++ b/deploy/mobile/image.html @@ -7,7 +7,7 @@
- + \ No newline at end of file -- cgit v1.2.3-70-g09d2 From bf14eaa1331eb21807c883f9b0b8ed7f03a9f73b Mon Sep 17 00:00:00 2001 From: Andrew Kim Date: Sat, 16 Mar 2019 18:56:36 -0400 Subject: test --- deploy/mobile/image.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'deploy') diff --git a/deploy/mobile/image.html b/deploy/mobile/image.html index 07fba8cc5..80f23acb8 100644 --- a/deploy/mobile/image.html +++ b/deploy/mobile/image.html @@ -6,7 +6,9 @@ -
+
+ +
-- cgit v1.2.3-70-g09d2 From f923179ec2531d17630065988cae22ce96fa6d7e Mon Sep 17 00:00:00 2001 From: Andrew Kim Date: Sat, 16 Mar 2019 18:57:35 -0400 Subject: test --- deploy/mobile/image.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deploy') diff --git a/deploy/mobile/image.html b/deploy/mobile/image.html index 80f23acb8..52fad97b0 100644 --- a/deploy/mobile/image.html +++ b/deploy/mobile/image.html @@ -9,7 +9,7 @@
- + \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 0a1b68e534aebf6f5fa6af31fd6a1e3d63f299d1 Mon Sep 17 00:00:00 2001 From: Tyler Schicke Date: Sat, 16 Mar 2019 20:38:24 -0400 Subject: Added context menu option to copy document id Added route to handle going to any doc id --- deploy/index.html | 2 +- src/client/views/Main.tsx | 4 ++-- src/client/views/nodes/DocumentView.tsx | 7 +++++++ src/server/index.ts | 7 ++++++- 4 files changed, 16 insertions(+), 4 deletions(-) (limited to 'deploy') diff --git a/deploy/index.html b/deploy/index.html index 130da1cb9..acb085214 100644 --- a/deploy/index.html +++ b/deploy/index.html @@ -7,7 +7,7 @@
- + \ No newline at end of file diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx index 3a68b98ce..f938e83b9 100644 --- a/src/client/views/Main.tsx +++ b/src/client/views/Main.tsx @@ -41,8 +41,8 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) { ContextMenu.Instance.clearItems() } }), true) - -const mainDocId = "mainDoc"; +const pathname = window.location.pathname.split("/"); +const mainDocId = pathname[pathname.length - 1]; let mainContainer: Document; let mainfreeform: Document; diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 4b50e40a3..6b305fb96 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -17,6 +17,7 @@ import { ContextMenu } from "../ContextMenu"; import "./DocumentView.scss"; import React = require("react"); import { DocumentContentsView } from "./DocumentContentsView"; +import { Utils } from "../../../Utils"; const JsxParser = require('react-jsx-parser').default; //TODO Why does this need to be imported like this? @@ -253,6 +254,12 @@ export class DocumentView extends React.Component { ContextMenu.Instance.addItem({ description: "Fields", event: this.fieldsClicked }) ContextMenu.Instance.addItem({ description: "Center", event: () => this.props.focus(this.props.Document) }) ContextMenu.Instance.addItem({ description: "Open Right", event: () => CollectionDockingView.Instance.AddRightSplit(this.props.Document) }) + ContextMenu.Instance.addItem({ + description: "Copy ID", + event: () => { + Utils.CopyText(this.props.Document.Id); + } + }); //ContextMenu.Instance.addItem({ description: "Docking", event: () => this.props.Document.SetNumber(KeyStore.ViewType, CollectionViewType.Docking) }) ContextMenu.Instance.displayMenu(e.pageX - 15, e.pageY - 15) if (!this.topMost) { diff --git a/src/server/index.ts b/src/server/index.ts index 83fa84746..7f1e95964 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -100,9 +100,14 @@ let FieldStore: ObservableMap = new ObservableMap(); // define a route handler for the default home page app.get("/", (req, res) => { - res.sendFile(path.join(__dirname, '../../deploy/index.html')); + res.redirect("/doc/mainDoc"); + // res.sendFile(path.join(__dirname, '../../deploy/index.html')); }); +app.get("/doc/:docId", (req, res) => { + res.sendFile(path.join(__dirname, '../../deploy/index.html')); +}) + app.get("/hello", (req, res) => { res.send("

Hello

"); }) -- cgit v1.2.3-70-g09d2 From a4fa90e0d376a993392c0eff143a5c387e387980 Mon Sep 17 00:00:00 2001 From: Andrew Kim Date: Sun, 17 Mar 2019 00:15:40 -0400 Subject: testing mobile image --- deploy/index.html | 1 - deploy/mobile/image.html | 2 +- package-lock.json | 132 +++---- src/.DS_Store | Bin 6148 -> 6148 bytes src/client/documents/Documents.ts | 12 +- src/client/util/TooltipTextMenu.scss | 7 +- src/client/util/TooltipTextMenu.tsx | 2 +- src/client/views/.DS_Store | Bin 6148 -> 8196 bytes src/client/views/ContextMenu.scss | 77 +++-- src/client/views/ContextMenu.tsx | 16 +- src/client/views/DocumentDecorations.scss | 85 ++++- src/client/views/DocumentDecorations.tsx | 17 +- src/client/views/EditableView.scss | 6 + src/client/views/EditableView.tsx | 3 +- src/client/views/InkingCanvas.scss | 131 ++++++- src/client/views/InkingCanvas.tsx | 28 +- src/client/views/InkingControl.tsx | 66 +++- src/client/views/InkingStroke.tsx | 2 - src/client/views/Main.scss | 139 +++++++- src/client/views/Main.tsx | 96 ++++-- src/client/views/_global_variables.scss | 17 + src/client/views/_nodeModuleOverrides.scss | 23 ++ .../views/collections/CollectionFreeFormView.scss | 104 ++++-- .../views/collections/CollectionFreeFormView.tsx | 20 +- .../views/collections/CollectionPDFView.scss | 27 ++ src/client/views/collections/CollectionPDFView.tsx | 26 +- .../views/collections/CollectionSchemaView.scss | 383 +++++++++++---------- .../views/collections/CollectionSchemaView.tsx | 32 +- .../views/collections/CollectionTreeView.scss | 32 +- .../views/collections/CollectionTreeView.tsx | 25 +- .../views/collections/CollectionVideoView.scss | 40 +++ .../views/collections/CollectionVideoView.tsx | 86 ++++- src/client/views/collections/CollectionView.tsx | 9 +- src/client/views/collections/MarqueeView.tsx | 49 ++- src/client/views/collections/PreviewCursor.tsx | 8 +- src/client/views/nodes/AudioBox.tsx | 12 +- src/client/views/nodes/DocumentContentsView.tsx | 35 ++ src/client/views/nodes/DocumentView.scss | 44 +-- src/client/views/nodes/DocumentView.tsx | 22 +- src/client/views/nodes/FieldTextBox.scss | 14 +- src/client/views/nodes/FormattedTextBox.scss | 64 ++-- src/client/views/nodes/FormattedTextBox.tsx | 2 +- src/client/views/nodes/ImageBox.scss | 25 +- src/client/views/nodes/ImageBox.tsx | 2 +- src/client/views/nodes/KeyValueBox.scss | 42 +-- src/client/views/nodes/LinkBox.scss | 42 ++- src/client/views/nodes/LinkBox.tsx | 19 +- src/client/views/nodes/LinkEditor.scss | 22 +- src/client/views/nodes/LinkMenu.scss | 1 + src/client/views/nodes/LinkMenu.tsx | 4 +- src/client/views/nodes/PDFBox.scss | 2 +- src/client/views/nodes/PDFBox.tsx | 2 +- src/client/views/nodes/VideoBox.tsx | 18 +- src/fields/KeyStore.ts | 3 +- 54 files changed, 1453 insertions(+), 625 deletions(-) create mode 100644 src/client/views/EditableView.scss create mode 100644 src/client/views/_global_variables.scss create mode 100644 src/client/views/_nodeModuleOverrides.scss create mode 100644 src/client/views/collections/CollectionPDFView.scss create mode 100644 src/client/views/collections/CollectionVideoView.scss create mode 100644 src/client/views/nodes/DocumentContentsView.tsx (limited to 'deploy') diff --git a/deploy/index.html b/deploy/index.html index e0892662a..130da1cb9 100644 --- a/deploy/index.html +++ b/deploy/index.html @@ -2,7 +2,6 @@ Dash Web - diff --git a/deploy/mobile/image.html b/deploy/mobile/image.html index 52fad97b0..ae39a5217 100644 --- a/deploy/mobile/image.html +++ b/deploy/mobile/image.html @@ -7,7 +7,7 @@
- +

Capture Image:

diff --git a/package-lock.json b/package-lock.json index 9169ae4e9..da562298b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3707,24 +3707,24 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, "aproba": { "version": "1.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "optional": true }, "are-we-there-yet": { "version": "1.1.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "optional": true, "requires": { @@ -3734,12 +3734,12 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "brace-expansion": { "version": "1.1.11", - "resolved": false, + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { "balanced-match": "^1.0.0", @@ -3748,34 +3748,34 @@ }, "chownr": { "version": "1.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "concat-map": { "version": "0.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "console-control-strings": { "version": "1.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, "core-util-is": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "optional": true }, "debug": { "version": "2.6.9", - "resolved": false, + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "optional": true, "requires": { @@ -3784,25 +3784,25 @@ }, "deep-extend": { "version": "0.6.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "optional": true }, "delegates": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "optional": true }, "fs-minipass": { "version": "1.2.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "optional": true, "requires": { @@ -3811,13 +3811,13 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "optional": true }, "gauge": { "version": "2.7.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "optional": true, "requires": { @@ -3833,7 +3833,7 @@ }, "glob": { "version": "7.1.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "optional": true, "requires": { @@ -3847,13 +3847,13 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "optional": true }, "iconv-lite": { "version": "0.4.24", - "resolved": false, + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "optional": true, "requires": { @@ -3862,7 +3862,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "optional": true, "requires": { @@ -3871,7 +3871,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": false, + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "optional": true, "requires": { @@ -3881,18 +3881,18 @@ }, "inherits": { "version": "2.0.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { "version": "1.3.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "requires": { "number-is-nan": "^1.0.0" @@ -3900,13 +3900,13 @@ }, "isarray": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { "brace-expansion": "^1.1.7" @@ -3914,12 +3914,12 @@ }, "minimist": { "version": "0.0.8", - "resolved": false, + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "minipass": { "version": "2.3.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "requires": { "safe-buffer": "^5.1.2", @@ -3928,7 +3928,7 @@ }, "minizlib": { "version": "1.2.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "optional": true, "requires": { @@ -3937,7 +3937,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -3945,13 +3945,13 @@ }, "ms": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "optional": true }, "needle": { "version": "2.2.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.4.tgz", "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", "optional": true, "requires": { @@ -3962,7 +3962,7 @@ }, "node-pre-gyp": { "version": "0.10.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz", "integrity": "sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A==", "optional": true, "requires": { @@ -3980,7 +3980,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "optional": true, "requires": { @@ -3990,13 +3990,13 @@ }, "npm-bundled": { "version": "1.0.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz", "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==", "optional": true }, "npm-packlist": { "version": "1.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.2.0.tgz", "integrity": "sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ==", "optional": true, "requires": { @@ -4006,7 +4006,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "optional": true, "requires": { @@ -4018,18 +4018,18 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "object-assign": { "version": "4.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "optional": true }, "once": { "version": "1.4.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { "wrappy": "1" @@ -4037,19 +4037,19 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "optional": true }, "osenv": { "version": "0.1.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "optional": true, "requires": { @@ -4059,19 +4059,19 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "optional": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "optional": true }, "rc": { "version": "1.2.8", - "resolved": false, + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "optional": true, "requires": { @@ -4083,7 +4083,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "optional": true } @@ -4091,7 +4091,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": false, + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "optional": true, "requires": { @@ -4106,7 +4106,7 @@ }, "rimraf": { "version": "2.6.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "optional": true, "requires": { @@ -4115,42 +4115,42 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "safer-buffer": { "version": "2.1.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "optional": true }, "sax": { "version": "1.2.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "optional": true }, "semver": { "version": "5.6.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "optional": true }, "string-width": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "requires": { "code-point-at": "^1.0.0", @@ -4160,7 +4160,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "optional": true, "requires": { @@ -4169,7 +4169,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { "ansi-regex": "^2.0.0" @@ -4177,13 +4177,13 @@ }, "strip-json-comments": { "version": "2.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "optional": true }, "tar": { "version": "4.4.8", - "resolved": false, + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "optional": true, "requires": { @@ -4198,13 +4198,13 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "optional": true }, "wide-align": { "version": "1.1.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "optional": true, "requires": { @@ -4213,12 +4213,12 @@ }, "wrappy": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "yallist": { "version": "3.0.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" } } diff --git a/src/.DS_Store b/src/.DS_Store index f20f36d63..90213270f 100644 Binary files a/src/.DS_Store and b/src/.DS_Store differ diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index f35d553b1..05bc743be 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -23,10 +23,13 @@ import { PDFField } from "../../fields/PDFField"; import { PDFBox } from "../views/nodes/PDFBox"; import { CollectionPDFView } from "../views/collections/CollectionPDFView"; import { RichTextField } from "../../fields/RichTextField"; +import { CollectionVideoView } from "../views/collections/CollectionVideoView"; +import { StrokeData, InkField } from "../../fields/InkField"; export interface DocumentOptions { x?: number; y?: number; + ink?: Map; width?: number; height?: number; nativeWidth?: number; @@ -39,6 +42,7 @@ export interface DocumentOptions { layout?: string; layoutKeys?: Key[]; viewType?: number; + backgroundColor?: string; } export namespace Documents { @@ -82,8 +86,10 @@ export namespace Documents { if (options.page !== undefined) { doc.SetNumber(KeyStore.Page, options.page); } if (options.scale !== undefined) { doc.SetNumber(KeyStore.Scale, options.scale); } if (options.viewType !== undefined) { doc.SetNumber(KeyStore.ViewType, options.viewType); } + if (options.backgroundColor !== undefined) { doc.SetText(KeyStore.BackgroundColor, options.backgroundColor); } if (options.layout !== undefined) { doc.SetText(KeyStore.Layout, options.layout); } if (options.layoutKeys !== undefined) { doc.Set(KeyStore.LayoutKeys, new ListField(options.layoutKeys)); } + if (options.ink !== undefined) { doc.Set(KeyStore.Ink, new InkField(options.ink)); } return doc; } function setupPrototypeOptions(protoId: string, title: string, layout: string, options: DocumentOptions): Document { @@ -128,7 +134,7 @@ export namespace Documents { function GetCollectionPrototype(): Document { return collProto ? collProto : collProto = setupPrototypeOptions(collProtoId, "COLLECTION_PROTO", CollectionView.LayoutString("DataKey"), - { panx: 0, pany: 0, scale: 1, layoutKeys: [KeyStore.Data] }); + { panx: 0, pany: 0, scale: 1, width: 500, height: 500, layoutKeys: [KeyStore.Data] }); } function GetKVPPrototype(): Document { @@ -138,9 +144,9 @@ export namespace Documents { } function GetVideoPrototype(): Document { if (!videoProto) { - videoProto = setupPrototypeOptions(videoProtoId, "VIDEO_PROTO", CollectionView.LayoutString("AnnotationsKey"), + videoProto = setupPrototypeOptions(videoProtoId, "VIDEO_PROTO", CollectionVideoView.LayoutString("AnnotationsKey"), { x: 0, y: 0, nativeWidth: 600, width: 300, layoutKeys: [KeyStore.Data, KeyStore.Annotations] }); - videoProto.SetNumber(KeyStore.CurFrame, 1); + videoProto.SetNumber(KeyStore.CurPage, 0); videoProto.SetText(KeyStore.BackgroundLayout, VideoBox.LayoutString()); } return videoProto; diff --git a/src/client/util/TooltipTextMenu.scss b/src/client/util/TooltipTextMenu.scss index fa43f5326..ea580d104 100644 --- a/src/client/util/TooltipTextMenu.scss +++ b/src/client/util/TooltipTextMenu.scss @@ -1,8 +1,9 @@ +@import "../views/global_variables"; .tooltipMenu { position: absolute; z-index: 20; - background: rgb(19, 18, 18); + background: $dark-color; border: 1px solid silver; border-radius: 4px; padding: 2px 10px; @@ -31,14 +32,14 @@ bottom: -4.5px; border: 5px solid transparent; border-bottom-width: 0; - border-top-color: black; + border-top-color: $dark-color; } .menuicon { display: inline-block; border-right: 1px solid rgba(0, 0, 0, 0.2); //color: rgb(19, 18, 18); - color: white; + color: $light-color; line-height: 1; padding: 0px 2px; margin: 1px; diff --git a/src/client/util/TooltipTextMenu.tsx b/src/client/util/TooltipTextMenu.tsx index 3b87fe9de..8cc653bf2 100644 --- a/src/client/util/TooltipTextMenu.tsx +++ b/src/client/util/TooltipTextMenu.tsx @@ -117,7 +117,7 @@ export class TooltipTextMenu { let width = Math.abs(start.left - end.left) / 2; let mid = Math.min(start.left, end.left) + width; //THIS WIDTH IS 15 * NUMBER OF ICONS + 15 - this.tooltip.style.width = 120 + "px"; + this.tooltip.style.width = 122 + "px"; this.tooltip.style.bottom = (box.bottom - start.top) + "px"; } diff --git a/src/client/views/.DS_Store b/src/client/views/.DS_Store index 6bd614c8b..0964d5ff3 100644 Binary files a/src/client/views/.DS_Store and b/src/client/views/.DS_Store differ diff --git a/src/client/views/ContextMenu.scss b/src/client/views/ContextMenu.scss index 41994ef79..f6830d9cd 100644 --- a/src/client/views/ContextMenu.scss +++ b/src/client/views/ContextMenu.scss @@ -1,42 +1,55 @@ +@import "global_variables"; .contextMenu-cont { - position: absolute; - display: flex; - z-index: 1000; - box-shadow: #AAAAAA .2vw .2vw .4vw; - flex-direction: column; + position: absolute; + display: flex; + z-index: 1000; + box-shadow: $intermediate-color 0.2vw 0.2vw 0.4vw; + flex-direction: column; +} + +.contextMenu-item:first-child { + background: $intermediate-color; + color: $light-color; +} + +.contextMenu-item:first-child::placeholder { + color: $light-color; +} + +.contextMenu-item:first-child:hover { + background: $intermediate-color; + color: $light-color; } .contextMenu-item { - width: auto; - height: auto; - background: #F0F8FF; - display: flex; - justify-content: left; - align-items: center; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - transition: all .1s; - border-width: .11px; - border-style: none; - border-color: rgb(187, 186, 186); - border-bottom-style: solid; - padding: 10px; - white-space: nowrap; - // font-size: 1.5vw; - font-size: 12px; + width: auto; + height: auto; + background: $light-color-secondary; + display: flex; + justify-content: left; + align-items: center; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + transition: all 0.1s; + border-width: 0.11px; + border-style: none; + border-color: $intermediate-color; + border-bottom-style: solid; + padding: 10px; + white-space: nowrap; + font-size: 13px; } .contextMenu-item:hover { - transition: all .1s; - background: #B0E0E6; + transition: all 0.1s; + background: $lighter-alt-accent; } .contextMenu-description { - // font-size: 1.5vw; - text-align: left; - // width: 8vw; -} \ No newline at end of file + text-align: left; + width: 8vw; +} diff --git a/src/client/views/ContextMenu.tsx b/src/client/views/ContextMenu.tsx index 12352c667..9109b56bb 100644 --- a/src/client/views/ContextMenu.tsx +++ b/src/client/views/ContextMenu.tsx @@ -13,6 +13,8 @@ export class ContextMenu extends React.Component { @observable private _pageY: number = 0; @observable private _display: string = "none"; @observable private _searchString: string = ""; + // afaik displaymenu can be called before all the items are added to the menu, so can't determine in displayMenu what the height of the menu will be + @observable private _yRelativeToTop: boolean = true; private ref: React.RefObject; @@ -59,8 +61,13 @@ export class ContextMenu extends React.Component { intersects = (x: number, y: number): boolean => { if (this.ref.current && this._display !== "none") { - if (x >= this._pageX && x <= this._pageX + this.ref.current.getBoundingClientRect().width) { - if (y >= this._pageY && y <= this._pageY + this.ref.current.getBoundingClientRect().height) { + let menuSize = { width: this.ref.current.getBoundingClientRect().width, height: this.ref.current.getBoundingClientRect().height }; + + let upperLeft = { x: this._pageX, y: this._yRelativeToTop ? this._pageY : window.innerHeight - (this._pageY + menuSize.height) }; + let bottomRight = { x: this._pageX + menuSize.width, y: this._yRelativeToTop ? this._pageY + menuSize.height : window.innerHeight - this._pageY }; + + if (x >= upperLeft.x && x <= bottomRight.x) { + if (y >= upperLeft.y && y <= bottomRight.y) { return true; } } @@ -69,9 +76,12 @@ export class ContextMenu extends React.Component { } render() { + let style = this._yRelativeToTop ? { left: this._pageX, top: this._pageY, display: this._display } : + { left: this._pageX, bottom: this._pageY, display: this._display }; + return ( -
+
{this._items.filter(prop => { return prop.description.toLowerCase().indexOf(this._searchString.toLowerCase()) !== -1; diff --git a/src/client/views/DocumentDecorations.scss b/src/client/views/DocumentDecorations.scss index fb9091dfc..11595aa01 100644 --- a/src/client/views/DocumentDecorations.scss +++ b/src/client/views/DocumentDecorations.scss @@ -1,17 +1,18 @@ +@import "global_variables"; #documentDecorations-container { position: absolute; display: grid; z-index: 1000; - grid-template-rows: 20px 1fr 20px 0px; - grid-template-columns: 20px 1fr 20px; + grid-template-rows: 8px 1fr 8px 30px; + grid-template-columns: 8px 1fr 8px; pointer-events: none; #documentDecorations-centerCont { background: none; } .documentDecorations-resizer { pointer-events: auto; - background: lightblue; - opacity: 0.4; + background: $alt-accent; + opacity: 0.8; } #documentDecorations-topLeftResizer, #documentDecorations-bottomRightResizer { @@ -29,23 +30,89 @@ #documentDecorations-rightResizer { cursor: ew-resize; } - } + +// position: absolute; +// display: grid; +// z-index: 1000; +// grid-template-rows: 20px 1fr 20px 0px; +// grid-template-columns: 20px 1fr 20px; +// pointer-events: none; +// #documentDecorations-centerCont { +// background: none; +// } +// .documentDecorations-resizer { +// pointer-events: auto; +// background: lightblue; +// opacity: 0.4; +// } +// #documentDecorations-topLeftResizer, +// #documentDecorations-bottomRightResizer { +// cursor: nwse-resize; +// } +// #documentDecorations-topRightResizer, +// #documentDecorations-bottomLeftResizer { +// cursor: nesw-resize; +// } +// #documentDecorations-topResizer, +// #documentDecorations-bottomResizer { +// cursor: ns-resize; +// } +// #documentDecorations-leftResizer, +// #documentDecorations-rightResizer { +// cursor: ew-resize; +// } +// } +.linkFlyout { + grid-column: 1/4 +} + +.linkButton-empty:hover { + background: $main-accent; + transform: scale(1.05); + cursor: pointer; +} + +.linkButton-nonempty:hover { + background: $main-accent; + transform: scale(1.05); + cursor: pointer; +} + .linkButton-empty { height: 20px; width: 20px; margin-top: 10px; border-radius: 50%; - opacity: 0.6; + opacity: 0.9; pointer-events: auto; - background-color: #2B6091; + background-color: $dark-color; + color: $light-color; + text-transform: uppercase; + letter-spacing: 2px; + font-size: 75%; + transition: transform 0.2s; + text-align: center; + display: flex; + justify-content: center; + align-items: center; } + .linkButton-nonempty { height: 20px; width: 20px; margin-top: 10px; border-radius: 50%; - opacity: 0.6; + opacity: 0.9; pointer-events: auto; - background-color: rgb(35, 165, 42); + background-color: $dark-color; + color: $light-color; + text-transform: uppercase; + letter-spacing: 2px; + font-size: 75%; + transition: transform 0.2s; + text-align: center; + display: flex; + justify-content: center; + align-items: center; } \ No newline at end of file diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index dc62f97cf..3bdb7d5b3 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -18,6 +18,8 @@ export class DocumentDecorations extends React.Component { static Instance: DocumentDecorations private _resizer = "" private _isPointerDown = false; + + private _resizeBorderWidth = 16; private _linkButton = React.createRef(); @observable private _hidden = false; @@ -206,21 +208,24 @@ export class DocumentDecorations extends React.Component { let linkButton = null; if (SelectionManager.SelectedDocuments().length > 0) { let selFirst = SelectionManager.SelectedDocuments()[0]; + let linkToSize = selFirst.props.Document.GetData(KeyStore.LinkedToDocs, ListField, []).length; + let linkFromSize = selFirst.props.Document.GetData(KeyStore.LinkedFromDocs, ListField, []).length; + let linkCount = linkToSize + linkFromSize; linkButton = ( }> -
+
{linkCount}
); } return (
e.preventDefault()}>
e.preventDefault()}>
@@ -232,7 +237,7 @@ export class DocumentDecorations extends React.Component {
e.preventDefault()}>
e.preventDefault()}>
- {linkButton} +
{linkButton}
) diff --git a/src/client/views/EditableView.scss b/src/client/views/EditableView.scss new file mode 100644 index 000000000..be3c5069a --- /dev/null +++ b/src/client/views/EditableView.scss @@ -0,0 +1,6 @@ +.editableView-container-editing { + overflow-wrap: break-word; + word-wrap: break-word; + hyphens: auto; + max-width: 300px; +} \ No newline at end of file diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx index 84b1b91c3..3b54c0dbb 100644 --- a/src/client/views/EditableView.tsx +++ b/src/client/views/EditableView.tsx @@ -1,6 +1,7 @@ import React = require('react') import { observer } from 'mobx-react'; import { observable, action } from 'mobx'; +import "./EditableView.scss" export interface EditableProps { /** @@ -49,7 +50,7 @@ export class EditableView extends React.Component { style={{ display: "inline" }}> } else { return ( -
this.editing = true)}> {this.props.contents}
diff --git a/src/client/views/InkingCanvas.scss b/src/client/views/InkingCanvas.scss index f654b194b..e79b146b9 100644 --- a/src/client/views/InkingCanvas.scss +++ b/src/client/views/InkingCanvas.scss @@ -1,8 +1,10 @@ +@import "global_variables"; .inking-canvas { - position: fixed; + position: absolute; top: -50000px; left: -50000px; // z-index: 99; //overlays ink on top of everything svg { + position:absolute; width: 100000px; height: 100000px; .highlight { @@ -13,20 +15,135 @@ .inking-control { position: absolute; - right: 0; - bottom: 75px; - text-align: right; + left: 70px; + bottom: 70px; + margin: 0; + padding: 0; + display: flex; + label, + input, + option { + font-size: 12px; + } + input[type="range"] { + -webkit-appearance: none; + background-color: transparent; + vertical-align: middle; + margin-top: 8px; + &:focus { + outline: none; + } + &::-webkit-slider-runnable-track { + width: 100%; + height: 3px; + border-radius: 1.5px; + cursor: pointer; + background: $intermediate-color; + } + &::-webkit-slider-thumb { + height: 12px; + width: 12px; + border: 1px solid $intermediate-color; + border-radius: 6px; + background: $light-color; + cursor: pointer; + -webkit-appearance: none; + margin-top: -4px; + } + &::-moz-range-track { + width: 100%; + height: 3px; + border-radius: 1.5px; + cursor: pointer; + background: $light-color; + } + &::-moz-range-thumb { + height: 12px; + width: 12px; + border: 1px solid $intermediate-color; + border-radius: 6px; + background: $light-color; + cursor: pointer; + -webkit-appearance: none; + margin-top: -4px; + } + } + input[type="text"] { + border: none; + padding: 0 0px; + background: transparent; + color: $dark-color; + font-size: 12px; + margin-top: 4px; + } .ink-panel { - margin-top: 12px; + margin: 6px 12px 6px 0; + height: 30px; + vertical-align: middle; + line-height: 36px; + padding: 0 10px; + color: $intermediate-color; &:first { margin-top: 0; } } + .ink-tools { + display: flex; + background-color: transparent; + border-radius: 0; + padding: 0; + button { + height: 36px; + padding: 0px; + padding-bottom: 3px; + margin-left: 10px; + background-color: transparent; + color: $intermediate-color; + } + button:hover { + transform: scale(1.15); + } + } .ink-size { display: flex; justify-content: space-between; - input { - width: 85%; + input[type="text"] { + width: 42px; + } + >* { + margin-right: 6px; + &:last-child { + margin-right: 0; + } + } + } + .ink-color { + display: flex; + position: relative; + padding-right: 0; + label { + margin-right: 6px; + } + .ink-color-display { + border-radius: 11px; + width: 22px; + height: 22px; + margin-top: 6px; + cursor: pointer; + text-align: center; // span { + // color: $light-color; + // font-size: 8px; + // user-select: none; + // } + } + .ink-color-picker { + background-color: $light-color; + border-radius: 5px; + padding: 12px; + position: absolute; + bottom: 36px; + left: -3px; + box-shadow: $intermediate-color 0.2vw 0.2vw 0.8vw; } } } \ No newline at end of file diff --git a/src/client/views/InkingCanvas.tsx b/src/client/views/InkingCanvas.tsx index 0d87c1239..84c47f616 100644 --- a/src/client/views/InkingCanvas.tsx +++ b/src/client/views/InkingCanvas.tsx @@ -1,4 +1,5 @@ import { observer } from "mobx-react"; +import { observable } from "mobx"; import { action, computed } from "mobx"; import { InkingControl } from "./InkingControl"; import React = require("react"); @@ -6,14 +7,10 @@ import { Transform } from "../util/Transform"; import { Document } from "../../fields/Document"; import { KeyStore } from "../../fields/KeyStore"; import { InkField, InkTool, StrokeData, StrokeMap } from "../../fields/InkField"; -import { JsxArgs } from "./nodes/DocumentView"; import { InkingStroke } from "./InkingStroke"; import "./InkingCanvas.scss" -import { CollectionDockingView } from "./collections/CollectionDockingView"; import { Utils } from "../../Utils"; import { FieldWaiting } from "../../fields/Field"; -import { getMapLikeKeys } from "mobx/lib/internal"; - interface InkCanvasProps { getScreenTransform: () => Transform; @@ -22,7 +19,16 @@ interface InkCanvasProps { @observer export class InkingCanvas extends React.Component { - + static InkOffset: number = 50000; + public static IntersectStrokeRect(stroke: StrokeData, selRect: { left: number, top: number, width: number, height: number }): boolean { + let inside = false; + stroke.pathData.map(val => { + if (selRect.left < val.x - InkingCanvas.InkOffset && selRect.left + selRect.width > val.x - InkingCanvas.InkOffset && + selRect.top < val.y - InkingCanvas.InkOffset && selRect.top + selRect.height > val.y - InkingCanvas.InkOffset) + inside = true; + }); + return inside + } private _isDrawing: boolean = false; private _idGenerator: string = ""; @@ -51,7 +57,6 @@ export class InkingCanvas extends React.Component { document.removeEventListener("mouseup", this.handleMouseUp); } - @action handleMouseDown = (e: React.PointerEvent): void => { if (e.button != 0 || @@ -62,7 +67,6 @@ export class InkingCanvas extends React.Component { if (InkingControl.Instance.selectedTool === InkTool.Eraser) { return } - e.stopPropagation() const point = this.relativeCoordinatesForEvent(e); // start the new line, saves a uuid to represent the field of the stroke @@ -74,7 +78,7 @@ export class InkingCanvas extends React.Component { color: InkingControl.Instance.selectedColor, width: InkingControl.Instance.selectedWidth, tool: InkingControl.Instance.selectedTool, - page: this.props.Document.GetNumber(KeyStore.CurPage, 0) + page: this.props.Document.GetNumber(KeyStore.CurPage, -1) }); this.inkData = data; this._isDrawing = true; @@ -110,8 +114,8 @@ export class InkingCanvas extends React.Component { relativeCoordinatesForEvent = (e: React.MouseEvent): { x: number, y: number } => { let [x, y] = this.props.getScreenTransform().transformPoint(e.clientX, e.clientY); - x += 50000 - y += 50000 + x += InkingCanvas.InkOffset; + y += InkingCanvas.InkOffset; return { x, y }; } @@ -145,11 +149,11 @@ export class InkingCanvas extends React.Component { // parse data from server let paths: Array = [] - let curPage = this.props.Document.GetNumber(KeyStore.CurPage, 0) + let curPage = this.props.Document.GetNumber(KeyStore.CurPage, -1) Array.from(lines).map(item => { let id = item[0]; let strokeData = item[1]; - if (strokeData.page == 0 || strokeData.page == curPage) + if (strokeData.page == -1 || strokeData.page == curPage) paths.push() { super(props); @@ -49,29 +58,50 @@ export class InkingControl extends React.Component { selected = (tool: InkTool) => { if (this._selectedTool === tool) { - return { backgroundColor: "black", color: "white" } + return { color: "#61aaa3" } } return {} } + @action + toggleDisplay = () => { + this._open = !this._open; + } + + @action + toggleColorPicker = () => { + this._colorPickerDisplay = !this._colorPickerDisplay; + } + render() { return ( -
-
- - - - -
-
- - +
  • +
    + + + + +
    +
  • +
  • + +
    this.toggleColorPicker()}> + {/* {this._colorPickerDisplay ? : } */} +
    +
    + +
    +
  • +
  • + + ) => this.switchWidth(e.target.value)} /> + ) => this.switchWidth(e.target.value)} /> -
  • -
    - -
    -
    + + ) } } \ No newline at end of file diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx index d724421d3..87b5c43d8 100644 --- a/src/client/views/InkingStroke.tsx +++ b/src/client/views/InkingStroke.tsx @@ -21,8 +21,6 @@ export class InkingStroke extends React.Component { @observable private _strokeColor: string = this.props.color; @observable private _strokeWidth: string = this.props.width; - private _canvasColor: string = "#cdcdcd"; - deleteStroke = (e: React.MouseEvent): void => { if (InkingControl.Instance.selectedTool === InkTool.Eraser && e.buttons === 1) { this.props.deleteCallback(this.props.id); diff --git a/src/client/views/Main.scss b/src/client/views/Main.scss index 2b1c77b74..bb42db202 100644 --- a/src/client/views/Main.scss +++ b/src/client/views/Main.scss @@ -1,22 +1,35 @@ +@import "global_variables"; +@import "nodeModuleOverrides"; html, body { width: 100%; height: 100%; overflow: hidden; - font-family: 'Hind Siliguri', sans-serif; + font-family: $sans-serif; margin: 0; } +#dash-title { + position: absolute; + right: 46.5%; + letter-spacing: 3px; + top: 9px; + font-size: 12px; + color: $alt-accent; + z-index: 9999; +} + h1 { font-size: 50px; position: fixed; top: 30px; left: 50%; transform: translateX(-50%); - color: black; + color: $dark-color; text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff; z-index: 9999; - font-family: 'Fjalla One', sans-serif; + font-family: $sans-serif; + font-weight: 700; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; @@ -33,23 +46,131 @@ p { margin: 0px; padding: 0px; } + ::-webkit-scrollbar { -webkit-appearance: none; - height:5px; - width:5px; + height: 5px; + width: 5px; } + ::-webkit-scrollbar-thumb { border-radius: 2px; - background-color: rgba(0,0,0,.5); + background-color: rgba(0, 0, 0, 0.5); +} + +// button stuff +button { + background: $dark-color; + outline: none; + border: 0px; + color: $light-color; + text-transform: uppercase; + letter-spacing: 2px; + font-size: 75%; + padding: 10px; + transition: transform 0.2s; +} + +button:hover { + background: $main-accent; + transform: scale(1.05); + cursor: pointer; } -.main-buttonDiv { +.clear-db-button { position: absolute; - width: 150px; - left: 0px; + right: 45%; + bottom: 3%; + font-size: 50%; +} + +.round-button { + width: 36px; + height: 36px; + border-radius: 18px; + font-size: 15px; +} + +.round-button:hover { + transform: scale(1.15); +} + +.add-button { + position: relative; + margin-right: 10px; } + .main-undoButtons { position: absolute; width: 150px; right: 0px; } + +//toolbar stuff +#toolbar { + position: absolute; + bottom: 62px; + left: 24px; + .toolbar-button { + display: block; + margin-bottom: 10px; + } +} + +// add nodes menu. Note that the + button is actually an input label, not an actual button. +#add-nodes-menu { + position: absolute; + bottom: 24px; + left: 24px; + label { + background: $dark-color; + color: $light-color; + display: inline-block; + border-radius: 18px; + font-size: 25px; + width: 36px; + height: 36px; + margin-right: 10px; + cursor: pointer; + transition: transform 0.2s; + } + label p { + padding-left: 10.5px; + padding-top: 3px; + } + label:hover { + background: $main-accent; + transform: scale(1.15); + } + input { + display: none; + } + input:not(:checked)~#add-options-content { + display: none; + } + input:checked~label { + transform: rotate(45deg); + transition: transform 0.5s; + cursor: pointer; + } +} + +#add-options-content { + display: table; + opacity: 1; + margin: 0; + padding: 0; + position: relative; + float: right; + bottom: 0.3em; + margin-bottom: -1.68em; +} + +ul#add-options-list { + list-style: none; + padding: 0; + li { + display: inline-block; + padding: 0; + } +} \ No newline at end of file diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx index 95bf9cad0..3a68b98ce 100644 --- a/src/client/views/Main.tsx +++ b/src/client/views/Main.tsx @@ -18,6 +18,19 @@ import { DocumentDecorations } from './DocumentDecorations'; import { DocumentView } from './nodes/DocumentView'; import "./Main.scss"; import { InkingControl } from './InkingControl'; +import { library } from '@fortawesome/fontawesome-svg-core'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faFont } from '@fortawesome/free-solid-svg-icons'; +import { faImage } from '@fortawesome/free-solid-svg-icons'; +import { faFilePdf } from '@fortawesome/free-solid-svg-icons'; +import { faObjectGroup } from '@fortawesome/free-solid-svg-icons'; +import { faTable } from '@fortawesome/free-solid-svg-icons'; +import { faGlobeAsia } from '@fortawesome/free-solid-svg-icons'; +import { faUndoAlt } from '@fortawesome/free-solid-svg-icons'; +import { faRedoAlt } from '@fortawesome/free-solid-svg-icons'; +import { faPenNib } from '@fortawesome/free-solid-svg-icons'; +import { faFilm } from '@fortawesome/free-solid-svg-icons'; +import { faMusic } from '@fortawesome/free-solid-svg-icons'; configure({ enforceActions: "observed" }); // causes errors to be generated when modifying an observable outside of an action @@ -29,10 +42,22 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) { } }), true) - const mainDocId = "mainDoc"; let mainContainer: Document; let mainfreeform: Document; + +library.add(faFont); +library.add(faImage); +library.add(faFilePdf); +library.add(faObjectGroup); +library.add(faTable); +library.add(faGlobeAsia); +library.add(faUndoAlt); +library.add(faRedoAlt); +library.add(faPenNib); +library.add(faFilm); +library.add(faMusic); + Documents.initProtos(mainDocId, (res?: Document) => { if (res instanceof Document) { mainContainer = res; @@ -80,6 +105,8 @@ Documents.initProtos(mainDocId, (res?: Document) => { ReactDOM.render((
    + {/*
    — DASH —
    */} + Transform.Identity} ContentScaling={() => 1} @@ -91,27 +118,52 @@ Documents.initProtos(mainDocId, (res?: Document) => { ContainingCollectionView={undefined} /> -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - + + + {/* @TODO this should really be moved into a moveable toolbar component, but for now let's put it here to meet the deadline */} + < div id="toolbar" > + + + +
    + + {/* for the expandable add nodes menu. Not included with the above because once it expands it expands the whole div with it, making canvas interactions limited. */} + < div id="add-nodes-menu" > + + + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    + +
    + -
    ), +
    ), document.getElementById('root')); }) diff --git a/src/client/views/_global_variables.scss b/src/client/views/_global_variables.scss new file mode 100644 index 000000000..44a819b79 --- /dev/null +++ b/src/client/views/_global_variables.scss @@ -0,0 +1,17 @@ +@import url("https://fonts.googleapis.com/css?family=Noto+Sans:400,700|Crimson+Text:400,400i,700"); +// colors +$light-color: #fcfbf7; +$light-color-secondary: rgb(241, 239, 235); +$main-accent: #61aaa3; +// $alt-accent: #cdd5ec; +// $alt-accent: #cdeceb; +$alt-accent: #59dff7; +$lighter-alt-accent: rgb(207, 220, 240); +$intermediate-color: #9c9396; +$dark-color: #121721; +// fonts +$sans-serif: "Noto Sans", sans-serif; +// $sans-serif: "Roboto Slab", sans-serif; +$serif: "Crimson Text", serif; +// misc values +$border-radius: 0.3em; diff --git a/src/client/views/_nodeModuleOverrides.scss b/src/client/views/_nodeModuleOverrides.scss new file mode 100644 index 000000000..6f97e60f8 --- /dev/null +++ b/src/client/views/_nodeModuleOverrides.scss @@ -0,0 +1,23 @@ +// this file is for overriding all the css from installed node modules + +// goldenlayout stuff +div .lm_header { + background: $dark-color; + min-height: 2em; +} + +.lm_tab { + margin-top: 0.6em !important; + padding-top: 0.5em !important; + min-height: 1.35em; + padding-bottom: 0px; + border-radius: 5px; + font-family: $sans-serif !important; +} + +.lm_header .lm_controls { + right: 1em !important; +} + +// @TODO the ril__navgiation buttons in the img gallery are a lil messed up but I can't figure out +// why. Low priority for now but it's bugging me. --Julie diff --git a/src/client/views/collections/CollectionFreeFormView.scss b/src/client/views/collections/CollectionFreeFormView.scss index d472cc5c4..9c7a03b52 100644 --- a/src/client/views/collections/CollectionFreeFormView.scss +++ b/src/client/views/collections/CollectionFreeFormView.scss @@ -1,29 +1,56 @@ +@import "../global_variables"; + .collectionfreeformview-container { + .collectionfreeformview > .jsx-parser { + position: absolute; + height: 100%; + width: 100%; + } - .collectionfreeformview > .jsx-parser{ - position:absolute; - height: 100%; - width: 100%; - } - - border-style: solid; - box-sizing: border-box; - position: relative; + //nested freeform views + .collectionfreeformview-container { + // background-image: linear-gradient(to right, $light-color-secondary 1px, transparent 1px), + // linear-gradient(to bottom, $light-color-secondary 1px, transparent 1px); + // background-size: 30px 30px; + } + + border: 0px solid $light-color-secondary; + border-radius: $border-radius; + box-sizing: border-box; + position: relative; + top: 0; + left: 0; + width: 100%; + height: 100%; + overflow: hidden; + box-shadow: $intermediate-color 0.2vw 0.2vw 0.8vw; + .collectionfreeformview { + position: absolute; top: 0; left: 0; width: 100%; height: 100%; - overflow: hidden; - .collectionfreeformview { - position: absolute; - top: 0; - left: 0; - width:100%; - height: 100%; - } + } } .collectionfreeformview-overlay { + .collectionfreeformview > .jsx-parser { + position: absolute; + height: 100%; + } + .formattedTextBox-cont { + background: $light-color-secondary; + } + position:absolute; + border: 0px solid transparent; + border-radius: $border-radius; + overflow: hidden; + box-sizing: border-box; + top: 0; + left: 0; + width: 100%; + height: 100%; + .collectionfreeformview { .collectionfreeformview > .jsx-parser{ position:absolute; height: 100%; @@ -32,26 +59,39 @@ background:yellow; } - border-style: solid; - box-sizing: border-box; + // overflow: hidden; + // border-style: solid; + // box-sizing: border-box; position: absolute; top: 0; left: 0; width: 100%; height: 100%; - overflow: hidden; - .collectionfreeformview { - position: absolute; - top: 0; - left: 0; - width:100%; - height: 100%; - } + } } +// selection border...? .border { - border-style: solid; - box-sizing: border-box; - width: 100%; - height: 100%; -} \ No newline at end of file + border-style: solid; + box-sizing: border-box; + width: 98%; + height: 98%; + border-radius: $border-radius; +} + +//this is an animation for the blinking cursor! +@keyframes blink { + 0% { + opacity: 0; + } + 49% { + opacity: 0; + } + 50% { + opacity: 1; + } +} + +#prevCursor { + animation: blink 1s infinite; +} diff --git a/src/client/views/collections/CollectionFreeFormView.tsx b/src/client/views/collections/CollectionFreeFormView.tsx index 3d5326552..5c0eab392 100644 --- a/src/client/views/collections/CollectionFreeFormView.tsx +++ b/src/client/views/collections/CollectionFreeFormView.tsx @@ -52,13 +52,13 @@ export class CollectionFreeFormView extends CollectionViewBase { } public getActiveDocuments = () => { - var curPage = this.props.Document.GetNumber(KeyStore.CurPage, 1); + var curPage = this.props.Document.GetNumber(KeyStore.CurPage, -1); const lvalue = this.props.Document.GetT>(this.props.fieldKey, ListField); let active: Document[] = []; if (lvalue && lvalue != FieldWaiting) { lvalue.Data.map(doc => { - var page = doc.GetNumber(KeyStore.Page, 0); - if (page == curPage || page == 0) { + var page = doc.GetNumber(KeyStore.Page, -1); + if (page == curPage || page == -1) { active.push(doc); } }) @@ -126,7 +126,7 @@ export class CollectionFreeFormView extends CollectionViewBase { onPointerUp = (e: PointerEvent): void => { e.stopPropagation(); - if (!this.MarqueeVisible && Math.abs(this.DownX - e.clientX) < 3 && Math.abs(this.DownY - e.clientY) < 3) { + if (Math.abs(this.DownX - e.clientX) < 4 && Math.abs(this.DownY - e.clientY) < 4) { //show preview text cursor on tap this.PreviewCursorVisible = true; //select is not already selected @@ -140,9 +140,8 @@ export class CollectionFreeFormView extends CollectionViewBase { @action onPointerMove = (e: PointerEvent): void => { if (!e.cancelBubble && this.props.active()) { - if (e.buttons != 2 && !e.altKey && !e.metaKey && !this.MarqueeVisible) { + if (e.buttons == 1 && !e.altKey && !e.metaKey) { this.MarqueeVisible = true; - this.PreviewCursorVisible = false; } if (this.MarqueeVisible) { e.stopPropagation(); @@ -152,7 +151,6 @@ export class CollectionFreeFormView extends CollectionViewBase { let x = this.props.Document.GetNumber(KeyStore.PanX, 0); let y = this.props.Document.GetNumber(KeyStore.PanY, 0); let [dx, dy] = this.getTransform().transformDirection(e.clientX - this._lastX, e.clientY - this._lastY); - this.PreviewCursorVisible = false; this.SetPan(x - dx, y - dy); this._lastX = e.pageX; this._lastY = e.pageY; @@ -272,7 +270,7 @@ export class CollectionFreeFormView extends CollectionViewBase { @computed get views() { - var curPage = this.props.Document.GetNumber(KeyStore.CurPage, 1); + var curPage = this.props.Document.GetNumber(KeyStore.CurPage, -1); const lvalue = this.props.Document.GetT>(this.props.fieldKey, ListField); if (lvalue && lvalue != FieldWaiting) { return lvalue.Data.map(doc => { @@ -343,10 +341,12 @@ export class CollectionFreeFormView extends CollectionViewBase { ref={this._canvasRef}> {this.backgroundView} - + {this.views} - + {this.overlayView} ); diff --git a/src/client/views/collections/CollectionPDFView.scss b/src/client/views/collections/CollectionPDFView.scss new file mode 100644 index 000000000..0144625c1 --- /dev/null +++ b/src/client/views/collections/CollectionPDFView.scss @@ -0,0 +1,27 @@ +.collectionPdfView-buttonTray { + top : 25px; + left : 20px; + position: relative; + transform-origin: left top; + position: absolute; +} +.collectionPdfView-cont{ + width: 100%; + height: 100%; + position: absolute; + +} +.collectionPdfView-backward { + color : white; + top :0px; + left : 0px; + position: absolute; + background-color: rgba(50, 50, 50, 0.2); +} +.collectionPdfView-forward { + color : white; + top :0px; + left : 35px; + position: absolute; + background-color: rgba(50, 50, 50, 0.2); +} \ No newline at end of file diff --git a/src/client/views/collections/CollectionPDFView.tsx b/src/client/views/collections/CollectionPDFView.tsx index f22c07060..124d82c8b 100644 --- a/src/client/views/collections/CollectionPDFView.tsx +++ b/src/client/views/collections/CollectionPDFView.tsx @@ -1,10 +1,11 @@ -import { action, computed } from "mobx"; +import { action, computed, observable } from "mobx"; import { observer } from "mobx-react"; import { Document } from "../../../fields/Document"; import { KeyStore } from "../../../fields/KeyStore"; import { ContextMenu } from "../ContextMenu"; import { CollectionView, CollectionViewType } from "./CollectionView"; import { CollectionViewProps } from "./CollectionViewBase"; +import "./CollectionPDFView.scss" import React = require("react"); import { FieldId } from "../../../fields/Field"; @@ -18,22 +19,23 @@ export class CollectionPDFView extends React.Component { isTopMost={isTopMost} SelectOnLoad={selectOnLoad} BackgroundView={BackgroundView} focus={focus}/>`; } - public SelectedDocs: FieldId[] = [] - @action onPageBack = () => this.curPage > 1 ? this.props.Document.SetNumber(KeyStore.CurPage, this.curPage - 1) : 0; - @action onPageForward = () => this.curPage < this.numPages ? this.props.Document.SetNumber(KeyStore.CurPage, this.curPage + 1) : 0; + private get curPage() { return this.props.Document.GetNumber(KeyStore.CurPage, -1); } + private get numPages() { return this.props.Document.GetNumber(KeyStore.NumPages, 0); } + @action onPageBack = () => this.curPage > 1 ? this.props.Document.SetNumber(KeyStore.CurPage, this.curPage - 1) : -1; + @action onPageForward = () => this.curPage < this.numPages ? this.props.Document.SetNumber(KeyStore.CurPage, this.curPage + 1) : -1; - @computed private get curPage() { return this.props.Document.GetNumber(KeyStore.CurPage, 0); } - @computed private get numPages() { return this.props.Document.GetNumber(KeyStore.NumPages, 0); } - @computed private get uIButtons() { + private get uIButtons() { + let scaling = Math.min(1.8, this.props.ScreenToLocalTransform().transformDirection(1, 1)[0]); return ( -
    - - +
    + +
    ); } // "inherited" CollectionView API starts here... - + @observable + public SelectedDocs: FieldId[] = [] public active: () => boolean = () => CollectionView.Active(this); addDocument = (doc: Document): void => { CollectionView.AddDocument(this.props, doc); } @@ -49,7 +51,7 @@ export class CollectionPDFView extends React.Component { get subView(): any { return CollectionView.SubView(this); } render() { - return (
    + return (
    {this.subView} {this.props.isSelected() ? this.uIButtons : (null)}
    ) diff --git a/src/client/views/collections/CollectionSchemaView.scss b/src/client/views/collections/CollectionSchemaView.scss index d40e6d314..0d615dc01 100644 --- a/src/client/views/collections/CollectionSchemaView.scss +++ b/src/client/views/collections/CollectionSchemaView.scss @@ -1,185 +1,162 @@ - +@import "../global_variables"; .collectionSchemaView-container { - border-style: solid; + border: 1px solid $intermediate-color; + border-radius: $border-radius; + box-sizing: border-box; + position: absolute; + width: 100%; + height: 100%; + overflow: hidden; + +.collectionSchemaView-content { + position: absolute; + height:100%; + width:100%; + overflow:auto; +} + .collectionSchemaView-previewRegion { + position: relative; + background: $light-color; + float: left; + height: 100%; + } + .collectionSchemaView-previewHandle { + position: absolute; + height: 37px; + width: 20px; + z-index: 20; + right: 0; + top: 0; + background: $main-accent; + } + .collectionSchemaView-dividerDragger { + position: relative; box-sizing: border-box; + border-left: 1px solid $intermediate-color; + border-right: 1px solid $intermediate-color; + float: left; + height: 100%; + } + .collectionSchemaView-tableContainer { + position: relative; + float: left; + height: 100%; + } + + .ReactTable { position: absolute; + // display: inline-block; + // overflow: auto; width: 100%; height: 100%; - .collectionSchemaView-previewRegion { - position: relative; - background: black; - float: left; - height: 100%; - } - .collectionSchemaView-previewHandle { - position: absolute; - height: 37px; - width: 20px; - z-index: 20; - right: 0; - top: 0; - background: Black ; - } - .collectionSchemaView-dividerDragger{ - position: relative; - background: black; - float: left; - height: 100%; - } - .collectionSchemaView-tableContainer { + background: $light-color; + box-sizing: border-box; + border: none !important; + .rt-table { + overflow-y: auto; + overflow-x: auto; + height: 100%; + display: -webkit-inline-box; + direction: ltr; + // direction:rtl; + // display:block; + } + .rt-tbody { + //direction: ltr; + direction: rtl; + } + .rt-tr-group { + direction: ltr; + max-height: 44px; + } + .rt-td { + border-width: 1px; + border-right-color: $intermediate-color; + .imageBox-cont { position: relative; - float: left; - height: 100%; - } - - .ReactTable { - position: absolute; - // display: inline-block; - // overflow: auto; - width: 100%; + max-height: 100%; + } + .imageBox-cont img { + object-fit: contain; + max-width: 100%; height: 100%; - background: white; - box-sizing: border-box; - .rt-table { - overflow-y: auto; - overflow-x: auto; - height: 100%; - - display: -webkit-inline-box; - direction: ltr; - // direction:rtl; - // display:block; - } - .rt-tbody { - //direction: ltr; - direction: rtl; - } - .rt-tr-group { - direction: ltr; - max-height: 44px; - } - .rt-td { - border-width: 1; - border-right-color: #aaa; - .imageBox-cont { - position:relative; - max-height:100%; - } - .imageBox-cont img { - object-fit: contain; - max-width: 100%; - height: 100% - } - } - .rt-tr-group { - border-width: 1; - border-bottom-color: #aaa - } - } - .ReactTable .rt-thead.-header { - background:grey; - } - .ReactTable .rt-th, .ReactTable .rt-td { - max-height: 44; - padding: 3px 7px; - } - .ReactTable .rt-tbody .rt-tr-group:last-child { - border-bottom: grey; - border-bottom-style: solid; - border-bottom-width: 1; - } - .documentView-node:first-child { - background: grey; - .imageBox-cont img { - object-fit: contain; - } - } + } + .videobox-cont { + object-fit: contain; + width:auto; + height: 100%; + } + } + } + .ReactTable .rt-thead.-header { + background: $intermediate-color; + color: $light-color; + text-transform: uppercase; + letter-spacing: 2px; + font-size: 12px; + height: 30px; + padding-top: 4px; + } + .ReactTable .rt-th, + .ReactTable .rt-td { + max-height: 44; + padding: 3px 7px; + font-size: 13px; + text-align: center; + } + .ReactTable .rt-tbody .rt-tr-group:last-child { + border-bottom: $intermediate-color; + border-bottom-style: solid; + border-bottom-width: 1; + } + .documentView-node:first-child { + background: $light-color; + .imageBox-cont img { + object-fit: contain; + } + } } .Resizer { - box-sizing: border-box; - background: #000; - opacity: 0.5; - z-index: 1; - background-clip: padding-box; - &.horizontal { - height: 11px; - margin: -5px 0; - border-top: 5px solid rgba(255, 255, 255, 0); - border-bottom: 5px solid rgba(255, 255, 255, 0); - cursor: row-resize; - width: 100%; - &:hover { - border-top: 5px solid rgba(0, 0, 0, 0.5); - border-bottom: 5px solid rgba(0, 0, 0, 0.5); - } - } - &.vertical { - width: 11px; - margin: 0 -5px; - border-left: 5px solid rgba(255, 255, 255, 0); - border-right: 5px solid rgba(255, 255, 255, 0); - cursor: col-resize; - &:hover { - border-left: 5px solid rgba(0, 0, 0, 0.5); - border-right: 5px solid rgba(0, 0, 0, 0.5); - } - } + box-sizing: border-box; + background: #000; + opacity: 0.5; + z-index: 1; + background-clip: padding-box; + &.horizontal { + height: 11px; + margin: -5px 0; + border-top: 5px solid rgba(255, 255, 255, 0); + border-bottom: 5px solid rgba(255, 255, 255, 0); + cursor: row-resize; + width: 100%; &:hover { - -webkit-transition: all 2s ease; - transition: all 2s ease; - } + border-top: 5px solid rgba(0, 0, 0, 0.5); + border-bottom: 5px solid rgba(0, 0, 0, 0.5); + } + } + &.vertical { + width: 11px; + margin: 0 -5px; + border-left: 5px solid rgba(255, 255, 255, 0); + border-right: 5px solid rgba(255, 255, 255, 0); + cursor: col-resize; + &:hover { + border-left: 5px solid rgba(0, 0, 0, 0.5); + border-right: 5px solid rgba(0, 0, 0, 0.5); + } + } + &:hover { + -webkit-transition: all 2s ease; + transition: all 2s ease; + } } .vertical { - section { - width: 100vh; - height: 100vh; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - } - header { - padding: 1rem; - background: #eee; - } - footer { - padding: 1rem; - background: #eee; - } -} - -.horizontal { - section { - width: 100vh; - height: 100vh; - display: flex; - flex-direction: column; - } - header { - padding: 1rem; - background: #eee; - } - footer { - padding: 1rem; - background: #eee; - } -} - -.parent { - width: 100%; - height: 100%; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; + section { + width: 100vh; + height: 100vh; display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -189,19 +166,71 @@ -webkit-flex-direction: column; -ms-flex-direction: column; flex-direction: column; + } + header { + padding: 1rem; + background: #eee; + } + footer { + padding: 1rem; + background: #eee; + } +} + +.horizontal { + section { + width: 100vh; + height: 100vh; + display: flex; + flex-direction: column; + } + header { + padding: 1rem; + background: #eee; + } + footer { + padding: 1rem; + background: #eee; + } +} + +.parent { + width: 100%; + height: 100%; + -webkit-box-flex: 1; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; } .header { - background: #aaa; - height: 3rem; - line-height: 3rem; + background: #aaa; + height: 3rem; + line-height: 3rem; } .wrapper { - background: #ffa; - margin: 5rem; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} \ No newline at end of file + background: #ffa; + margin: 5rem; + -webkit-box-flex: 1; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; +} + +.-even { + background: $light-color !important; +} + +.-odd { + background: $light-color-secondary !important; +} diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx index 04f017378..8c1aeef2c 100644 --- a/src/client/views/collections/CollectionSchemaView.tsx +++ b/src/client/views/collections/CollectionSchemaView.tsx @@ -1,5 +1,5 @@ import React = require("react") -import { action, observable } from "mobx"; +import { action, observable, computed } from "mobx"; import { observer } from "mobx-react"; import Measure from "react-measure"; import ReactTable, { CellInfo, ComponentPropsGetterR, ReactTableDefaults } from "react-table"; @@ -24,14 +24,14 @@ import { setupDrag } from "../../util/DragManager"; @observer export class CollectionSchemaView extends CollectionViewBase { private _mainCont = React.createRef(); - private DIVIDER_WIDTH = 5; + private DIVIDER_WIDTH = 4; @observable _contentScaling = 1; // used to transfer the dimensions of the content pane in the DOM to the ContentScaling prop of the DocumentView @observable _dividerX = 0; @observable _panelWidth = 0; @observable _panelHeight = 0; @observable _selectedIndex = 0; - @observable _splitPercentage: number = 50; + @computed get splitPercentage() { return this.props.Document.GetNumber(KeyStore.SchemaSplitPercentage, 0); } renderCell = (rowProps: CellInfo) => { let props: FieldViewProps = { @@ -49,7 +49,7 @@ export class CollectionSchemaView extends CollectionViewBase { let reference = React.createRef(); let onItemDown = setupDrag(reference, () => props.doc); return ( -
    +
    { let field = props.doc.Get(props.fieldKey); @@ -89,7 +89,8 @@ export class CollectionSchemaView extends CollectionViewBase { return { onClick: action((e: React.MouseEvent, handleOriginal: Function) => { that._selectedIndex = rowInfo.index; - this._splitPercentage += 0.05; // bcz - ugh - needed to force Measure to do its thing and call onResize + // bcz - ugh - needed to force Measure to do its thing and call onResize + this.props.Document.SetNumber(KeyStore.SchemaSplitPercentage, this.splitPercentage - 0.05) if (handleOriginal) { handleOriginal() @@ -106,18 +107,18 @@ export class CollectionSchemaView extends CollectionViewBase { @action onDividerMove = (e: PointerEvent): void => { let nativeWidth = this._mainCont.current!.getBoundingClientRect(); - this._splitPercentage = Math.round((e.clientX - nativeWidth.left) / nativeWidth.width * 100); + this.props.Document.SetNumber(KeyStore.SchemaSplitPercentage, 100 - Math.round((e.clientX - nativeWidth.left) / nativeWidth.width * 100)); } @action onDividerUp = (e: PointerEvent): void => { document.removeEventListener("pointermove", this.onDividerMove); document.removeEventListener('pointerup', this.onDividerUp); - if (this._startSplitPercent == this._splitPercentage) { - this._splitPercentage = this._splitPercentage == 1 ? 66 : 100; + if (this._startSplitPercent == this.splitPercentage) { + this.props.Document.SetNumber(KeyStore.SchemaSplitPercentage, this.splitPercentage == 0 ? 33 : 0); } } onDividerDown = (e: React.PointerEvent) => { - this._startSplitPercent = this._splitPercentage; + this._startSplitPercent = this.splitPercentage; e.stopPropagation(); e.preventDefault(); document.addEventListener("pointermove", this.onDividerMove); @@ -134,12 +135,12 @@ export class CollectionSchemaView extends CollectionViewBase { e.preventDefault(); document.removeEventListener("pointermove", this.onExpanderMove); document.removeEventListener('pointerup', this.onExpanderUp); - if (this._startSplitPercent == this._splitPercentage) { - this._splitPercentage = this._splitPercentage == 100 ? 66 : 100; + if (this._startSplitPercent == this.splitPercentage) { + this.props.Document.SetNumber(KeyStore.SchemaSplitPercentage, this.splitPercentage == 0 ? 33 : 0); } } onExpanderDown = (e: React.PointerEvent) => { - this._startSplitPercent = this._splitPercentage; + this._startSplitPercent = this.splitPercentage; e.stopPropagation(); e.preventDefault(); document.addEventListener("pointermove", this.onExpanderMove); @@ -203,7 +204,7 @@ export class CollectionSchemaView extends CollectionViewBase { ) let previewHandle = !this.props.active() ? (null) : (
    ); - let dividerDragger = this._splitPercentage == 100 ? (null) : + let dividerDragger = this.splitPercentage == 0 ? (null) :
    return (
    @@ -213,7 +214,8 @@ export class CollectionSchemaView extends CollectionViewBase { this._panelHeight = r.entry.height; })}> {({ measureRef }) => -
    +
    {dividerDragger} -
    +
    {content}
    {previewHandle} diff --git a/src/client/views/collections/CollectionTreeView.scss b/src/client/views/collections/CollectionTreeView.scss index f8d580a7b..fa0f1c761 100644 --- a/src/client/views/collections/CollectionTreeView.scss +++ b/src/client/views/collections/CollectionTreeView.scss @@ -1,16 +1,25 @@ +@import "../global_variables"; #body { padding: 20px; - background: #bbbbbb; + background: $light-color-secondary; + font-size: 13px; + overflow: scroll; } ul { list-style: none; + padding-left: 20px; } li { margin: 5px 0; } +.collection-child { + margin-top: 10px; + margin-bottom: 10px; +} + .no-indent { padding-left: 0; } @@ -18,10 +27,17 @@ li { .bullet { width: 1.5em; display: inline-block; + color: $intermediate-color; +} + +.coll-title { + font-size: 24px; + margin-bottom: 20px; } .collectionTreeView-dropTarget { - border-style: solid; + border: 0px solid transparent; + border-radius: $border-radius; box-sizing: border-box; height: 100%; } @@ -30,8 +46,16 @@ li { display: inline-table; } +.docContainer:hover { + .delete-button { + display: inline; + } +} + .delete-button { - color: #999999; + color: $intermediate-color; float: right; - margin-left: 1em; + margin-left: 15px; + margin-top: 3px; + display: none; } \ No newline at end of file diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx index 8b06d9ac4..80fc89712 100644 --- a/src/client/views/collections/CollectionTreeView.tsx +++ b/src/client/views/collections/CollectionTreeView.tsx @@ -12,6 +12,10 @@ import { setupDrag } from "../../util/DragManager"; import { FieldWaiting } from "../../../fields/Field"; import { COLLECTION_BORDER_WIDTH } from "./CollectionView"; +import { library } from '@fortawesome/fontawesome-svg-core'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faTrashAlt, faCaretRight, faCaretDown } from '@fortawesome/free-solid-svg-icons'; + export interface TreeViewProps { document: Document; deleteDoc: (doc: Document) => void; @@ -23,6 +27,10 @@ export enum BulletType { List } +library.add(faTrashAlt); +library.add(faCaretDown); +library.add(faCaretRight); + @observer /** * Component that takes in a document prop and a boolean whether it's collapsed or not. @@ -50,11 +58,11 @@ class TreeView extends React.Component { switch (type) { case BulletType.Collapsed: - return
    + return
    case BulletType.Collapsible: - return
    + return
    case BulletType.List: - return
    + return
    } } @@ -79,7 +87,7 @@ class TreeView extends React.Component { this.props.document.SetData(KeyStore.Title, value, TextField); return true; }} /> -
    x
    +
    } @@ -101,7 +109,7 @@ class TreeView extends React.Component { ) ) subView = -
  • +
  • {this.renderBullet(BulletType.Collapsible)} {titleElement}
      @@ -109,7 +117,7 @@ class TreeView extends React.Component {
  • } else { - subView =
  • + subView =
  • {this.renderBullet(BulletType.Collapsed)} {titleElement}
  • @@ -157,7 +165,7 @@ export class CollectionTreeView extends CollectionViewBase { return (
    this.onDrop(e, {})} ref={this.createDropTarget} style={{ borderWidth: `${COLLECTION_BORDER_WIDTH}px` }}> -

    +
    { return this.props.Document.Title; @@ -165,7 +173,8 @@ export class CollectionTreeView extends CollectionViewBase { this.props.Document.SetData(KeyStore.Title, value, TextField); return true; }} /> -

    +
    +
      {childrenElement}
    diff --git a/src/client/views/collections/CollectionVideoView.scss b/src/client/views/collections/CollectionVideoView.scss new file mode 100644 index 000000000..cbb981b13 --- /dev/null +++ b/src/client/views/collections/CollectionVideoView.scss @@ -0,0 +1,40 @@ + +.collectionVideoView-cont{ + width: 100%; + height: 100%; + position: absolute; + +} +.collectionVideoView-time{ + color : white; + top :25px; + left : 25px; + position: absolute; + background-color: rgba(50, 50, 50, 0.2); + transform-origin: left top; +} +.collectionVideoView-play { + width: 25px; + height: 20px; + bottom: 25px; + left : 25px; + position: absolute; + color : white; + background-color: rgba(50, 50, 50, 0.2); + border-radius: 4px; + text-align: center; + transform-origin: left bottom; +} +.collectionVideoView-full { + width: 25px; + height: 20px; + bottom: 25px; + right : 25px; + position: absolute; + color : white; + background-color: rgba(50, 50, 50, 0.2); + border-radius: 4px; + text-align: center; + transform-origin: right bottom; + +} \ No newline at end of file diff --git a/src/client/views/collections/CollectionVideoView.tsx b/src/client/views/collections/CollectionVideoView.tsx index a6471f53c..b64ef3c07 100644 --- a/src/client/views/collections/CollectionVideoView.tsx +++ b/src/client/views/collections/CollectionVideoView.tsx @@ -1,4 +1,4 @@ -import { action, computed } from "mobx"; +import { action, computed, observable } from "mobx"; import { observer } from "mobx-react"; import { Document } from "../../../fields/Document"; import { KeyStore } from "../../../fields/KeyStore"; @@ -7,6 +7,7 @@ import { CollectionView, CollectionViewType } from "./CollectionView"; import { CollectionViewProps } from "./CollectionViewBase"; import React = require("react"); import { FieldId } from "../../../fields/Field"; +import "./CollectionVideoView.scss" @observer @@ -18,14 +19,29 @@ export class CollectionVideoView extends React.Component { isTopMost={isTopMost} SelectOnLoad={selectOnLoad} BackgroundView={BackgroundView} focus={focus}/>`; } - public SelectedDocs: FieldId[] = [] - @action onPageBack = () => this.curPage > 1 ? this.props.Document.SetNumber(KeyStore.CurPage, this.curPage - 1) : 0; - @action onPageForward = () => this.curPage < this.numPages ? this.props.Document.SetNumber(KeyStore.CurPage, this.curPage + 1) : 0; + private _mainCont = React.createRef(); + + private get uIButtons() { + let scaling = Math.min(1.8, this.props.ScreenToLocalTransform().transformDirection(1, 1)[0]); + return ([ +
    + {"" + Math.round(this.ctime)} + {" " + Math.round((this.ctime - Math.trunc(this.ctime)) * 100)} +
    , +
    + {this.playing ? "\"" : ">"} +
    , +
    + F +
    + ]); + } + - @computed private get curPage() { return this.props.Document.GetNumber(KeyStore.CurPage, 0); } - @computed private get numPages() { return this.props.Document.GetNumber(KeyStore.NumPages, 0); } // "inherited" CollectionView API starts here... + @observable + public SelectedDocs: FieldId[] = [] public active: () => boolean = () => CollectionView.Active(this); addDocument = (doc: Document): void => { CollectionView.AddDocument(this.props, doc); } @@ -40,11 +56,63 @@ export class CollectionVideoView extends React.Component { get collectionViewType(): CollectionViewType { return CollectionViewType.Freeform; } get subView(): any { return CollectionView.SubView(this); } + componentDidMount() { + this.updateTimecode(); + } + + get player(): HTMLVideoElement | undefined { + return this._mainCont.current ? this._mainCont.current.getElementsByTagName("video")[0] : undefined; + } + + @action + updateTimecode = () => { + if (this.player) { + this.ctime = this.player.currentTime; + this.props.Document.SetNumber(KeyStore.CurPage, Math.round(this.ctime)); + } + setTimeout(() => this.updateTimecode(), 100) + } + + + @observable + ctime: number = 0 + @observable + playing: boolean = false; + + @action + onPlayDown = () => { + if (this.player) { + if (this.player.paused) { + this.player.play(); + this.playing = true; + } else { + this.player.pause(); + this.playing = false; + } + } + } + @action + onFullDown = (e: React.PointerEvent) => { + if (this.player) { + this.player.requestFullscreen(); + e.stopPropagation(); + e.preventDefault(); + } + } + + @action + onResetDown = () => { + if (this.player) { + this.player.pause(); + this.player.currentTime = 0; + } + + } + render() { - return (
    - {/*
    ) diff --git a/src/client/views/nodes/LinkEditor.scss b/src/client/views/nodes/LinkEditor.scss index cb191dc8c..fb0c69cff 100644 --- a/src/client/views/nodes/LinkEditor.scss +++ b/src/client/views/nodes/LinkEditor.scss @@ -1,3 +1,4 @@ +@import "../global_variables"; .edit-container { width: 100%; height: auto; @@ -9,21 +10,34 @@ margin-bottom: 10px; padding: 5px; font-size: 12px; + border: 1px solid #bababa; } .description-input { - font-size: 12px; + font-size: 11px; padding: 5px; margin-bottom: 10px; + border: 1px solid #bababa; } .save-button { width: 50px; height: 20px; - background-color: #2B6091; + pointer-events: auto; + background-color: $dark-color; + color: $light-color; + text-transform: uppercase; + letter-spacing: 2px; + padding: 2px; + font-size: 10px; margin: 0 auto; - color: white; + transition: transform 0.2s; text-align: center; line-height: 20px; - font-size: 12px; +} + +.save-button:hover { + background: $main-accent; + transform: scale(1.05); + cursor: pointer; } \ No newline at end of file diff --git a/src/client/views/nodes/LinkMenu.scss b/src/client/views/nodes/LinkMenu.scss index a120ab2a7..dedcce6ef 100644 --- a/src/client/views/nodes/LinkMenu.scss +++ b/src/client/views/nodes/LinkMenu.scss @@ -10,6 +10,7 @@ padding: 5px; margin-bottom: 10px; font-size: 12px; + border: 1px solid #bababa; } #linkMenu-list { diff --git a/src/client/views/nodes/LinkMenu.tsx b/src/client/views/nodes/LinkMenu.tsx index 5c6b06d00..5eeb40772 100644 --- a/src/client/views/nodes/LinkMenu.tsx +++ b/src/client/views/nodes/LinkMenu.tsx @@ -39,8 +39,8 @@ export class LinkMenu extends React.Component {
    - {this.renderLinkItems(linkTo, KeyStore.LinkedToDocs, "Source: ")} - {this.renderLinkItems(linkFrom, KeyStore.LinkedFromDocs, "Destination: ")} + {this.renderLinkItems(linkTo, KeyStore.LinkedToDocs, "Destination: ")} + {this.renderLinkItems(linkFrom, KeyStore.LinkedFromDocs, "Source: ")}
    ) diff --git a/src/client/views/nodes/PDFBox.scss b/src/client/views/nodes/PDFBox.scss index 9f92410d4..ad947afd5 100644 --- a/src/client/views/nodes/PDFBox.scss +++ b/src/client/views/nodes/PDFBox.scss @@ -11,5 +11,5 @@ } .pdfBox-contentContainer { position: absolute; - transform-origin: "left top"; + transform-origin: left top; } \ No newline at end of file diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index 544af41a2..b0b5a63a4 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -86,7 +86,7 @@ export class PDFBox extends React.Component { @observable private _interactive: boolean = false; @observable private _loaded: boolean = false; - @computed private get curPage() { return this.props.doc.GetNumber(KeyStore.CurPage, 0); } + @computed private get curPage() { return this.props.doc.GetNumber(KeyStore.CurPage, -1); } componentDidMount() { this._reactionDisposer = reaction( diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index 9c60d4348..8c1ee669f 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -30,7 +30,7 @@ export class VideoBox extends React.Component { var nativeWidth = this.props.doc.GetNumber(KeyStore.NativeWidth, 0); var nativeHeight = this.props.doc.GetNumber(KeyStore.NativeHeight, 0); var newNativeHeight = nativeWidth * r.entry.height / r.entry.width; - if (newNativeHeight != nativeHeight && !isNaN(newNativeHeight)) { + if (!nativeHeight && newNativeHeight != nativeHeight && !isNaN(newNativeHeight)) { this.props.doc.SetNumber(KeyStore.Height, newNativeHeight / nativeWidth * this.props.doc.GetNumber(KeyStore.Width, 0)); this.props.doc.SetNumber(KeyStore.NativeHeight, newNativeHeight); } @@ -48,16 +48,14 @@ export class VideoBox extends React.Component { //setTimeout(action(() => this._loaded = true), 500); return ( -
    - - {({ measureRef }) => -
    + } + ) } } \ No newline at end of file diff --git a/src/fields/KeyStore.ts b/src/fields/KeyStore.ts index 6481e14fe..06cdc8fc8 100644 --- a/src/fields/KeyStore.ts +++ b/src/fields/KeyStore.ts @@ -19,11 +19,13 @@ export namespace KeyStore { export const Annotations = new Key("Annotations"); export const ViewType = new Key("ViewType"); export const Layout = new Key("Layout"); + export const BackgroundColor = new Key("BackgroundColor"); export const BackgroundLayout = new Key("BackgroundLayout"); export const OverlayLayout = new Key("OverlayLayout"); export const LayoutKeys = new Key("LayoutKeys"); export const LayoutFields = new Key("LayoutFields"); export const ColumnsKey = new Key("SchemaColumns"); + export const SchemaSplitPercentage = new Key("SchemaSplitPercentage"); export const Caption = new Key("Caption"); export const ActiveFrame = new Key("ActiveFrame"); export const DocumentText = new Key("DocumentText"); @@ -33,7 +35,6 @@ export namespace KeyStore { export const LinkTags = new Key("LinkTag"); export const Thumbnail = new Key("Thumbnail"); export const CurPage = new Key("CurPage"); - export const CurFrame = new Key("CurFrame"); export const NumPages = new Key("NumPages"); export const Ink = new Key("Ink"); } -- cgit v1.2.3-70-g09d2 From a87f23374cbeb491e528127475bba6f55031dd81 Mon Sep 17 00:00:00 2001 From: Tyler Schicke Date: Sun, 17 Mar 2019 22:17:17 -0400 Subject: Small change --- deploy/mobile/image.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deploy') diff --git a/deploy/mobile/image.html b/deploy/mobile/image.html index ae39a5217..6424d2a60 100644 --- a/deploy/mobile/image.html +++ b/deploy/mobile/image.html @@ -7,7 +7,7 @@
    -

    Capture Image: +

    Capture Image:

    -- cgit v1.2.3-70-g09d2 From 67170e521366f8178645cc85aaf377e53b1a6f21 Mon Sep 17 00:00:00 2001 From: laurawilsonri Date: Mon, 18 Mar 2019 18:07:46 -0400 Subject: ui in place, needs refinement and more backend --- deploy/index.html | 2 + package-lock.json | 239 ++++++++++++++++++++- package.json | 7 +- src/client/views/DocumentDecorations.tsx | 4 +- .../views/collections/CollectionSchemaView.scss | 66 +++++- .../views/collections/CollectionSchemaView.tsx | 68 +++++- 6 files changed, 373 insertions(+), 13 deletions(-) (limited to 'deploy') diff --git a/deploy/index.html b/deploy/index.html index e0892662a..94699126c 100644 --- a/deploy/index.html +++ b/deploy/index.html @@ -3,6 +3,8 @@ Dash Web + diff --git a/package-lock.json b/package-lock.json index 5b9cb598d..3d66773f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -174,6 +174,52 @@ "resolved": "https://registry.npmjs.org/@icons/material/-/material-0.2.4.tgz", "integrity": "sha512-QPcGmICAPbGLGb6F/yNf/KzKqvFx8z5qx3D1yFqVAjoFmXK35EgyW+cJ57Te3CNsmzblwtzakLGFqHPqrfb4Tw==" }, + "@react-bootstrap/react-popper": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@react-bootstrap/react-popper/-/react-popper-1.2.1.tgz", + "integrity": "sha512-4l3q7LcZEhrSkI4d3Ie3g4CdrXqqTexXX4PFT45CB0z5z2JUbaxgRwKNq7r5j2bLdVpZm+uvUGqxJw8d9vgbJQ==", + "requires": { + "babel-runtime": "6.x.x", + "create-react-context": "^0.2.1", + "popper.js": "^1.14.4", + "prop-types": "^15.6.1", + "typed-styles": "^0.0.5", + "warning": "^3.0.0" + } + }, + "@trendmicro/react-buttons": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@trendmicro/react-buttons/-/react-buttons-1.3.1.tgz", + "integrity": "sha512-9zvt/fdkqCb9kxUdZnvTZKmbmykM2wDQ3VEJFtztGcKAkm4Wkq4oZOQLJXKfUQ1vX3w+YDJob18LkNOzaHI1UQ==", + "requires": { + "classnames": "^2.2.5", + "prop-types": "^15.5.8" + } + }, + "@trendmicro/react-dropdown": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@trendmicro/react-dropdown/-/react-dropdown-1.3.0.tgz", + "integrity": "sha512-KwL0ksEZPay7qNsiGcPQ3aGmyfJCcUuIjiD9HZs6L66ScwSRoFkDlAjMTlRVLFcYVNhpuyUH4pPiFlKQQzDHGQ==", + "requires": { + "@trendmicro/react-buttons": "^1.3.0", + "chained-function": "^0.5.0", + "classnames": "^2.2.5", + "dom-helpers": "^3.3.1", + "prop-types": "^15.6.0", + "uncontrollable": "^5.0.0", + "warning": "^3.0.0" + }, + "dependencies": { + "uncontrollable": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-5.1.0.tgz", + "integrity": "sha512-5FXYaFANKaafg4IVZXUNtGyzsnYEvqlr9wQ3WpZxFpEUxl29A3H6Q4G1Dnnorvq9TGOGATBApWR4YpLAh+F5hw==", + "requires": { + "invariant": "^2.2.4" + } + } + } + }, "@types/anymatch": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz", @@ -1531,6 +1577,11 @@ } } }, + "bootstrap": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.3.1.tgz", + "integrity": "sha512-rXqOmH1VilAt2DyPzluTi2blhk17bO7ef+zLLPlWvG494pDxcM234pJ8wTc/6R40UWizAIIMgxjvxZg5kmsbag==" + }, "boxen": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", @@ -1899,6 +1950,11 @@ "type-detect": "^4.0.5" } }, + "chained-function": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/chained-function/-/chained-function-0.5.0.tgz", + "integrity": "sha1-JWS73994AxlL6/daayvQQe3iOzo=" + }, "character-parser": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz", @@ -3461,6 +3517,20 @@ "websocket-driver": ">=0.5.1" } }, + "fbjs": { + "version": "0.8.17", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.17.tgz", + "integrity": "sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=", + "requires": { + "core-js": "^1.0.0", + "isomorphic-fetch": "^2.1.1", + "loose-envify": "^1.0.0", + "object-assign": "^4.1.0", + "promise": "^7.1.1", + "setimmediate": "^1.0.5", + "ua-parser-js": "^0.7.18" + } + }, "figgy-pudding": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", @@ -3735,14 +3805,12 @@ "balanced-match": { "version": "1.0.0", "resolved": false, - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "optional": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "brace-expansion": { "version": "1.1.11", "resolved": false, "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3762,8 +3830,7 @@ "concat-map": { "version": "0.0.1", "resolved": false, - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "optional": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "console-control-strings": { "version": "1.1.0", @@ -3911,7 +3978,6 @@ "version": "3.0.4", "resolved": false, "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4927,6 +4993,14 @@ "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", "dev": true }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "requires": { + "loose-envify": "^1.0.0" + } + }, "invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", @@ -5440,6 +5514,11 @@ "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.0.tgz", "integrity": "sha512-6hHxsp9e6zQU8nXsP+02HGWXwTkOEw6IROhF2ZA28cYbUk4eJ6QbtZvdqZOdD9YPKghG3apk5eOCvs+tLl3lRg==" }, + "keycode": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/keycode/-/keycode-2.2.0.tgz", + "integrity": "sha1-PQr1bce4uOXLqNCpfxByBO7CKwQ=" + }, "killable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", @@ -9983,6 +10062,11 @@ } } }, + "popper.js": { + "version": "1.14.7", + "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.14.7.tgz", + "integrity": "sha512-4q1hNvoUre/8srWsH7hnoSJ5xVmIL4qgz+s4qf2TnJIMyZFUFMGH+9vE7mXynAlHSZ/NdTmmow86muD0myUkVQ==" + }, "portfinder": { "version": "1.0.20", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.20.tgz", @@ -10168,6 +10252,15 @@ "react-is": "^16.8.1" } }, + "prop-types-extra": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.0.tgz", + "integrity": "sha512-QFyuDxvMipmIVKD2TwxLVPzMnO4e5oOf1vr3tJIomL8E7d0lr6phTHd5nkPhFIzTD1idBLLEPeylL9g+rrTzRg==", + "requires": { + "react-is": "^16.3.2", + "warning": "^3.0.0" + } + }, "prosemirror-commands": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.0.7.tgz", @@ -10605,6 +10698,43 @@ "scheduler": "^0.13.4" } }, + "react-bootstrap": { + "version": "1.0.0-beta.5", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-1.0.0-beta.5.tgz", + "integrity": "sha512-Osm0OtTbYwfsT1rpu88ESWuAHZxfaHFNKFiW8w3w+6YY9/bLEPHbGRZA6W21fg5yvcuKN9hJKT857TTHgY7SoQ==", + "requires": { + "@babel/runtime": "^7.2.0", + "@react-bootstrap/react-popper": "1.2.1", + "classnames": "^2.2.6", + "dom-helpers": "^3.4.0", + "invariant": "^2.2.3", + "keycode": "^2.1.2", + "popper.js": "^1.14.6", + "prop-types": "^15.6.2", + "prop-types-extra": "^1.1.0", + "react-context-toolbox": "^2.0.2", + "react-overlays": "^1.0.0", + "react-prop-types": "^0.4.0", + "react-transition-group": "^2.5.1", + "uncontrollable": "^6.0.0", + "warning": "^4.0.1" + }, + "dependencies": { + "warning": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", + "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", + "requires": { + "loose-envify": "^1.0.0" + } + } + } + }, + "react-bootstrap-dropdown-menu": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/react-bootstrap-dropdown-menu/-/react-bootstrap-dropdown-menu-1.1.15.tgz", + "integrity": "sha512-o35fODF4GsNxEzmnRWZuoe29a6x3fXqRsLXOlAvS4d+TvO3yoLTM8iZnSZpJCkHQnjOOWRnGvDh5tryqJCKZ0w==" + }, "react-color": { "version": "2.17.0", "resolved": "https://registry.npmjs.org/react-color/-/react-color-2.17.0.tgz", @@ -10618,6 +10748,11 @@ "tinycolor2": "^1.4.1" } }, + "react-context-toolbox": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/react-context-toolbox/-/react-context-toolbox-2.0.2.tgz", + "integrity": "sha512-tY4j0imkYC3n5ZlYSgFkaw7fmlCp3IoQQ6DxpqeNHzcD0hf+6V+/HeJxviLUZ1Rv1Yn3N3xyO2EhkkZwHn0m1A==" + }, "react-dimensions": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/react-dimensions/-/react-dimensions-1.3.1.tgz", @@ -10714,6 +10849,31 @@ "threads": "^0.8.0" } }, + "react-overlays": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-1.2.0.tgz", + "integrity": "sha512-i/FCV8wR6aRaI+Kz/dpJhOdyx+ah2tN1RhT9InPrexyC4uzf3N4bNayFTGtUeQVacj57j1Mqh1CwV60/5153Iw==", + "requires": { + "classnames": "^2.2.6", + "dom-helpers": "^3.4.0", + "prop-types": "^15.6.2", + "prop-types-extra": "^1.1.0", + "react-context-toolbox": "^2.0.2", + "react-popper": "^1.3.2", + "uncontrollable": "^6.0.0", + "warning": "^4.0.2" + }, + "dependencies": { + "warning": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", + "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", + "requires": { + "loose-envify": "^1.0.0" + } + } + } + }, "react-pdf": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/react-pdf/-/react-pdf-4.0.5.tgz", @@ -10791,6 +10951,51 @@ "resolved": "https://registry.npmjs.org/react-pointable/-/react-pointable-1.1.3.tgz", "integrity": "sha512-7skalWy38NLyKk1HcITmuloqCe2INPh69cFHbN7NcCn+Wfb0Ha4XGwGN0iVa4ZzqIHSqFRYOmV0loYNHrZ5/Sg==" }, + "react-popper": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/react-popper/-/react-popper-1.3.3.tgz", + "integrity": "sha512-ynMZBPkXONPc5K4P5yFWgZx5JGAUIP3pGGLNs58cfAPgK67olx7fmLp+AdpZ0+GoQ+ieFDa/z4cdV6u7sioH6w==", + "requires": { + "@babel/runtime": "^7.1.2", + "create-react-context": "<=0.2.2", + "popper.js": "^1.14.4", + "prop-types": "^15.6.1", + "typed-styles": "^0.0.7", + "warning": "^4.0.2" + }, + "dependencies": { + "create-react-context": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/create-react-context/-/create-react-context-0.2.2.tgz", + "integrity": "sha512-KkpaLARMhsTsgp0d2NA/R94F/eDLbhXERdIq3LvX2biCAXcDvHYoOqHfWCHf1+OLj+HKBotLG3KqaOOf+C1C+A==", + "requires": { + "fbjs": "^0.8.0", + "gud": "^1.0.0" + } + }, + "typed-styles": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/typed-styles/-/typed-styles-0.0.7.tgz", + "integrity": "sha512-pzP0PWoZUhsECYjABgCGQlRGL1n7tOHsgwYv3oIiEpJwGhFTuty/YNeduxQYzXXa3Ge5BdT6sHYIQYpl4uJ+5Q==" + }, + "warning": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", + "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", + "requires": { + "loose-envify": "^1.0.0" + } + } + } + }, + "react-prop-types": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/react-prop-types/-/react-prop-types-0.4.0.tgz", + "integrity": "sha1-+ZsL+0AGkpya8gUefBQUpcdbk9A=", + "requires": { + "warning": "^3.0.0" + } + }, "react-rnd": { "version": "7.4.3", "resolved": "https://registry.npmjs.org/react-rnd/-/react-rnd-7.4.3.tgz", @@ -10800,6 +11005,15 @@ "react-draggable": "^3.0.5" } }, + "react-simple-dropdown": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/react-simple-dropdown/-/react-simple-dropdown-3.2.3.tgz", + "integrity": "sha512-NmyyvA0D4wph5ctzkn8U4wmblOacavJMl9gTOhQR3v8I997mc1FL1NFKkj3Mx+HNysBKRD/HI+kpxXCAgXumPw==", + "requires": { + "classnames": "^2.1.2", + "prop-types": "^15.5.8" + } + }, "react-split-pane": { "version": "0.1.85", "resolved": "https://registry.npmjs.org/react-split-pane/-/react-split-pane-0.1.85.tgz", @@ -12453,6 +12667,11 @@ "mime-types": "~2.1.18" } }, + "typed-styles": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/typed-styles/-/typed-styles-0.0.5.tgz", + "integrity": "sha512-ht+rEe5UsdEBAa3gr64+QjUOqjOLJfWLvl5HZR5Ev9uo/OnD3p43wPeFSB1hNFc13GXQF/JU1Bn0YHLUqBRIlw==" + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -12526,6 +12745,14 @@ "random-bytes": "~1.0.0" } }, + "uncontrollable": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-6.1.0.tgz", + "integrity": "sha512-2TzEm0pLKauMBZfAZXsgQvLpZHEp95891frCZdGDrSG7dWYaIQhedwLAzi0X8pR8KHNqlmuYEb2cEgbQzr050A==", + "requires": { + "invariant": "^2.2.4" + } + }, "undefsafe": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.2.tgz", diff --git a/package.json b/package.json index 3bbaf72ad..3a1928632 100644 --- a/package.json +++ b/package.json @@ -35,9 +35,10 @@ "dependencies": { "@fortawesome/fontawesome-free-solid": "^5.0.13", "@fortawesome/fontawesome-svg-core": "^1.2.15", - "@hig/flyout": "^1.0.3", "@fortawesome/free-solid-svg-icons": "^5.7.2", "@fortawesome/react-fontawesome": "^0.1.4", + "@hig/flyout": "^1.0.3", + "@trendmicro/react-dropdown": "^1.3.0", "@types/bcrypt-nodejs": "0.0.30", "@types/bluebird": "^3.5.25", "@types/body-parser": "^1.17.0", @@ -78,6 +79,7 @@ "bcrypt-nodejs": "0.0.3", "bluebird": "^3.5.3", "body-parser": "^1.18.3", + "bootstrap": "^4.3.1", "connect-mongo": "^2.0.3", "express": "^4.16.4", "express-flash": "0.0.2", @@ -116,6 +118,8 @@ "pug": "^2.0.3", "raw-loader": "^1.0.0", "react": "^16.8.4", + "react-bootstrap": "^1.0.0-beta.5", + "react-bootstrap-dropdown-menu": "^1.1.15", "react-color": "^2.17.0", "react-dimensions": "^1.3.1", "react-dom": "^16.8.4", @@ -127,6 +131,7 @@ "react-pdf": "^4.0.2", "react-pdf-highlighter": "^2.1.2", "react-pdf-js": "^4.0.2", + "react-simple-dropdown": "^3.2.3", "react-split-pane": "^0.1.85", "react-table": "^6.9.2", "request": "^2.88.0", diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index dc62f97cf..1aa6d1936 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -10,8 +10,8 @@ import { DragManager } from "../util/DragManager"; import { LinkMenu } from "./nodes/LinkMenu"; import { ListField } from "../../fields/ListField"; const higflyout = require("@hig/flyout"); -const { anchorPoints } = higflyout; -const Flyout = higflyout.default; +export const { anchorPoints } = higflyout; +export const Flyout = higflyout.default; @observer export class DocumentDecorations extends React.Component { diff --git a/src/client/views/collections/CollectionSchemaView.scss b/src/client/views/collections/CollectionSchemaView.scss index d40e6d314..ab906cf4b 100644 --- a/src/client/views/collections/CollectionSchemaView.scss +++ b/src/client/views/collections/CollectionSchemaView.scss @@ -1,5 +1,65 @@ +//options menu styling +#schemaOptionsMenuBtn { + position: absolute; + height: 15px; + width: 15px; + border-radius: 50%; + z-index: 21; + right: 3px; + top: 3px; + pointer-events: auto; + background-color:red; +} + +.dd-item-containter:hover { + background-color: rgb(204, 204, 204); +} + +.dd-item { + color: black; + padding-left: 6px; + padding-bottom: 0px; + padding-top: 4px; + font-size: 12px; + margin: 0px; + display: block; + width: 100%; + height: 25px; + z-index: 100; +} +.dd-item:hover { + color: black; + font-weight: 500; +} + +.dropdown-menu { + height: 100px; + overflow-y: scroll; + } +#dropdown-basic-button { + background-color: #fff; + border: .75px solid #bbbbbb; + border-radius: 0; + -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + margin:10px; + margin-top: 8px; + color: black; + display: inline-block; + width: 160px; + height: 25px; + font-size: 15px; + padding: 0px; + border-radius: 3px; + font-size: 12px; + } + #options-flyout-div { + text-align: center; + padding:0px; + } + .collectionSchemaView-container { border-style: solid; box-sizing: border-box; @@ -14,11 +74,11 @@ } .collectionSchemaView-previewHandle { position: absolute; - height: 37px; - width: 20px; + height: 15px; + width: 15px; z-index: 20; right: 0; - top: 0; + top: 20px; background: Black ; } .collectionSchemaView-dividerDragger{ diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx index 04f017378..7c87ef744 100644 --- a/src/client/views/collections/CollectionSchemaView.tsx +++ b/src/client/views/collections/CollectionSchemaView.tsx @@ -1,4 +1,4 @@ -import React = require("react") +import React = require("react"); import { action, observable } from "mobx"; import { observer } from "mobx-react"; import Measure from "react-measure"; @@ -17,6 +17,16 @@ import "./CollectionSchemaView.scss"; import { COLLECTION_BORDER_WIDTH } from "./CollectionView"; import { CollectionViewBase } from "./CollectionViewBase"; import { setupDrag } from "../../util/DragManager"; +import '../DocumentDecorations.scss'; +import { Flyout, anchorPoints } from "../DocumentDecorations"; +import { DropdownButton, Dropdown } from 'react-bootstrap'; +import { ListField } from "../../../fields/ListField"; +import { Key } from "../../../fields/Key"; +//import { Server } from "http"; +//import { Server } from "http"; +import { Server } from "../../Server"; + +//import { MenuItem } from 'react-bootstrap'; // bcz: need to add drag and drop of rows and columns. This seems like it might work for rows: https://codesandbox.io/s/l94mn1q657 @@ -178,6 +188,19 @@ export class CollectionSchemaView extends CollectionViewBase { focusDocument = (doc: Document) => { } + keyDropDownOnSelect = (keyId: string) => { + const columns = this.props.Document.GetList(KeyStore.ColumnsKey, [KeyStore.Title, KeyStore.Data, KeyStore.Author]); + const listOfFields = this.props.Document.GetList(this.props.fieldKey, [])[1].fields; + if (listOfFields.has(keyId)) { + let index = columns.push(listOfFields!.get(keyId)!.key); + this.props.Document.SetData(KeyStore.ColumnsKey, columns, ListField); + } + } + + dropdownItemOnPointerDown = (e: React.PointerEvent): void => { + //(e.currentTarget.children[0] as Dropdown.Item ).onSelect(); + } + render() { const columns = this.props.Document.GetList(KeyStore.ColumnsKey, [KeyStore.Title, KeyStore.Data, KeyStore.Author]) const children = this.props.Document.GetList(this.props.fieldKey, []); @@ -205,6 +228,47 @@ export class CollectionSchemaView extends CollectionViewBase {
    ); let dividerDragger = this._splitPercentage == 100 ? (null) :
    + + //get the union of all childrens' keys + let addFields: { id: string, name: string }[] = []; + let removeFields: { id: string, name: string }[] = []; + //children.forEach((child) => { + // for (var keyId in fields.keys) { + // if (!allFields.includes(keyId)) { + // allFields.push(keyId); + // } + // } + // }); + let optionsMenu = null; + if (this.props.active()) { + let protos = this.props.Document.GetAllPrototypes(); + for (const proto of protos) { + proto._proxies.forEach((val, key) => { + if (!(key in addFields.keys)) { + let this_name: string = proto.fields!.get(key)!.key.Name; + addFields.push({ id: key, name: this_name }); + } + }) + } + optionsMenu = !this.props.active() ? (null) : (
    Options
    + + {addFields.map(({ id, name }) => ( +
    {name}
    ))} +
    + + {addFields.map(({ id, name }) => ( +
    {name}
    ))} +
    +
    + }> +
    + ); + } + + + return (
    this.onDrop(e, {})} ref={this.createDropTarget}> @@ -239,6 +303,8 @@ export class CollectionSchemaView extends CollectionViewBase { {content}
    {previewHandle} + {optionsMenu} +
    ) -- cgit v1.2.3-70-g09d2 From 670cf766c99a8a5de806fd7d6f1d9e357a55071a Mon Sep 17 00:00:00 2001 From: laurawilsonri Date: Mon, 18 Mar 2019 18:29:10 -0400 Subject: not sure --- deploy/index.html | 3 - package-lock.json | 419 ++++++++++++++++++--- package.json | 6 - .../views/collections/CollectionSchemaView.tsx | 80 ++-- 4 files changed, 402 insertions(+), 106 deletions(-) (limited to 'deploy') diff --git a/deploy/index.html b/deploy/index.html index dbfc6dee0..ca5c13e98 100644 --- a/deploy/index.html +++ b/deploy/index.html @@ -2,12 +2,9 @@ Dash Web -<<<<<<< HEAD -======= ->>>>>>> f70ad315167b714f11f7d68f35a46abe9e525a4d diff --git a/package-lock.json b/package-lock.json index 3d66773f2..18365bf9b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -152,11 +152,10 @@ } }, "@hig/theme-context": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@hig/theme-context/-/theme-context-2.1.2.tgz", - "integrity": "sha512-JTdYJgJpbPX0KPrjBkeKUFq8fLq7PFmMaBQaT71z6vs/ARqdeYC1ZNpksH2HCzDNU7mjGgFineA9He3eR3sgpg==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@hig/theme-context/-/theme-context-2.1.3.tgz", + "integrity": "sha512-c0Ju+Z8C532ZZtjwOLzN+XeO+pL3kqUawu6ZG3J084MH5RM9W8JCKyMf4D9Qr38jFWoiX6u8yiSxxjV/mz9Sqw==", "requires": { - "@hig/theme-data": "^2.3.2", "create-react-context": "^0.2.3", "prop-types": "^15.6.1" } @@ -225,6 +224,11 @@ "resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz", "integrity": "sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA==" }, + "@types/async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/async/-/async-2.4.1.tgz", + "integrity": "sha512-C09BK/wXzbW+/JK9zckhe+FeSbg7NmvVjUWwApnw7ksRpUq3ecGLiq2Aw1LlY4Z/VmtdhSaIs7jO5/MWRYMcOA==" + }, "@types/babel-types": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.6.tgz", @@ -292,6 +296,22 @@ "@types/express": "*" } }, + "@types/cookie-parser": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@types/cookie-parser/-/cookie-parser-1.4.1.tgz", + "integrity": "sha512-iJY6B3ZGufLiDf2OCAgiAAQuj1sMKC/wz/7XCEjZ+/MDuultfFJuSwrBKcLSmJ5iYApLzCCYBYJZs0Ws8GPmwA==", + "requires": { + "@types/express": "*" + } + }, + "@types/cookie-session": { + "version": "2.0.36", + "resolved": "https://registry.npmjs.org/@types/cookie-session/-/cookie-session-2.0.36.tgz", + "integrity": "sha512-vnKXnz9vGdOF6Gi9mvaMEtSn2PlDotvde1u9xVzzBRAVsPcufEmDfmas7023T7PpK9Awv1JqQDwN1ThjPSAoTA==", + "requires": { + "@types/express": "*" + } + }, "@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", @@ -400,6 +420,14 @@ "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz", "integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw==" }, + "@types/mobile-detect": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@types/mobile-detect/-/mobile-detect-1.3.4.tgz", + "integrity": "sha512-MGBTvT5c7aH8eX6szFYP3dWPryNLt5iGlo31XNaJtt8o6jsg6tjn99eEMq9l8T6cPZymsr+J4Jth8+/G/04ZDw==", + "requires": { + "mobile-detect": "*" + } + }, "@types/mocha": { "version": "5.2.6", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.6.tgz", @@ -429,6 +457,14 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.30.tgz", "integrity": "sha512-nsqTN6zUcm9xtdJiM9OvOJ5EF0kOI8f1Zuug27O/rgtxCRJHGqncSWfCMZUP852dCKPsDsYXGvBhxfRjDBkF5Q==" }, + "@types/nodemailer": { + "version": "4.6.6", + "resolved": "https://registry.npmjs.org/@types/nodemailer/-/nodemailer-4.6.6.tgz", + "integrity": "sha512-N2czhXs7fbQhvoquEGzmHAWttnxLfrM3+cWMRFX4hTQq4GE3VyaSE3MOOse4VoNgvtti/H5ow/Hq9KXu/UMWqA==", + "requires": { + "@types/node": "*" + } + }, "@types/orderedmap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/orderedmap/-/orderedmap-1.0.0.tgz", @@ -485,6 +521,15 @@ "@types/prosemirror-state": "*" } }, + "@types/prosemirror-inputrules": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/prosemirror-inputrules/-/prosemirror-inputrules-1.0.2.tgz", + "integrity": "sha512-bKFneQUPnkZmzCJ1uoitpKH6PFW0hc4q55NsC7mFUCvX0eZl0GRKxyfV47jkJbsbyUQoO/QFv0WwLDz2bo15sA==", + "requires": { + "@types/prosemirror-model": "*", + "@types/prosemirror-state": "*" + } + }, "@types/prosemirror-keymap": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/prosemirror-keymap/-/prosemirror-keymap-1.0.1.tgz", @@ -1160,7 +1205,6 @@ "version": "4.10.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, "requires": { "bn.js": "^4.0.0", "inherits": "^2.0.1", @@ -1215,11 +1259,11 @@ "integrity": "sha1-ECyenpAF0+fjgpvwxPok7oYu6bk=" }, "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", "requires": { - "lodash": "^4.17.10" + "lodash": "^4.17.11" } }, "async-each": { @@ -1525,8 +1569,7 @@ "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", - "dev": true + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, "body-parser": { "version": "1.18.3", @@ -1695,8 +1738,7 @@ "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, "browser-stdout": { "version": "1.3.1", @@ -1708,7 +1750,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, "requires": { "buffer-xor": "^1.0.3", "cipher-base": "^1.0.0", @@ -1722,7 +1763,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, "requires": { "browserify-aes": "^1.0.4", "browserify-des": "^1.0.0", @@ -1733,7 +1773,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, "requires": { "cipher-base": "^1.0.1", "des.js": "^1.0.0", @@ -1745,7 +1784,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, "requires": { "bn.js": "^4.1.0", "randombytes": "^2.0.1" @@ -1755,7 +1793,6 @@ "version": "4.0.4", "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, "requires": { "bn.js": "^4.1.1", "browserify-rsa": "^4.0.0", @@ -1816,8 +1853,7 @@ "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, "builtin-status-codes": { "version": "3.0.0", @@ -2021,7 +2057,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -2359,11 +2394,60 @@ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" }, + "cookie-parser": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.4.tgz", + "integrity": "sha512-lo13tqF3JEtFO7FyA49CqbhaFkskRJ0u/UAiINgrIXeRCY41c88/zxtrECl8AKH3B0hj9q10+h3Kt8I7KlW4tw==", + "requires": { + "cookie": "0.3.1", + "cookie-signature": "1.0.6" + } + }, + "cookie-session": { + "version": "2.0.0-beta.3", + "resolved": "https://registry.npmjs.org/cookie-session/-/cookie-session-2.0.0-beta.3.tgz", + "integrity": "sha512-zyqm5tA0z9yMEB/xyP7lnRnqp8eLR2e0dap+9+rBwVigla9yPKn8XTL1jJymog8xjfrowqW2o5LUjixQChkqrw==", + "requires": { + "cookies": "0.7.1", + "debug": "3.1.0", + "on-headers": "~1.0.1", + "safe-buffer": "5.1.1" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + } + } + }, "cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, + "cookies": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.7.1.tgz", + "integrity": "sha1-fIphX1SBxhq58WyDNzG8uPZjuZs=", + "requires": { + "depd": "~1.1.1", + "keygrip": "~1.0.2" + } + }, "copy-concurrently": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", @@ -2430,7 +2514,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "dev": true, "requires": { "bn.js": "^4.1.0", "elliptic": "^6.0.0" @@ -2459,7 +2542,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, "requires": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", @@ -2472,7 +2554,6 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, "requires": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -2516,7 +2597,6 @@ "version": "3.12.0", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, "requires": { "browserify-cipher": "^1.0.0", "browserify-sign": "^4.0.0", @@ -2779,7 +2859,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", - "dev": true, "requires": { "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0" @@ -2821,7 +2900,6 @@ "version": "5.0.3", "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, "requires": { "bn.js": "^4.1.0", "miller-rabin": "^4.0.0", @@ -2954,7 +3032,6 @@ "version": "6.4.1", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", - "dev": true, "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -3222,7 +3299,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, "requires": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" @@ -4559,6 +4635,21 @@ "ansi-regex": "^2.0.0" } }, + "has-binary": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-binary/-/has-binary-0.1.7.tgz", + "integrity": "sha1-aOYesWIQyVRaClzOBqhzkS/h5ow=", + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + } + } + }, "has-binary2": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", @@ -4628,7 +4719,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -4638,7 +4728,6 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, "requires": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -4654,7 +4743,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, "requires": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -5365,8 +5453,7 @@ "json3": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", - "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", - "dev": true + "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=" }, "json5": { "version": "1.0.1", @@ -5519,6 +5606,11 @@ "resolved": "https://registry.npmjs.org/keycode/-/keycode-2.2.0.tgz", "integrity": "sha1-PQr1bce4uOXLqNCpfxByBO7CKwQ=" }, + "keygrip": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.0.3.tgz", + "integrity": "sha512-/PpesirAIfaklxUzp4Yb7xBper9MwP6hNRA6BGGUFCgbJ+BM5CKBtsoxinNXkLHAr+GXS1/lSlF2rP7cv5Fl+g==" + }, "killable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", @@ -5845,7 +5937,6 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1", @@ -5940,7 +6031,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, "requires": { "bn.js": "^4.0.0", "brorand": "^1.0.1" @@ -5973,14 +6063,12 @@ "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" }, "minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" }, "minimatch": { "version": "3.0.4", @@ -6065,6 +6153,11 @@ } } }, + "mobile-detect": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/mobile-detect/-/mobile-detect-1.4.3.tgz", + "integrity": "sha512-UaahPNLllQsstHOEHAmVnTHCMQrAS9eL5Qgdi50QrYz6UgGk+Xziz2udz2GN6NYcyODcPLnasC7a7s6R2DjiaQ==" + }, "mobx": { "version": "5.9.0", "resolved": "https://registry.npmjs.org/mobx/-/mobx-5.9.0.tgz", @@ -6189,6 +6282,14 @@ "sliced": "1.0.1" }, "dependencies": { + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "requires": { + "lodash": "^4.17.10" + } + }, "bson": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.1.tgz", @@ -6494,6 +6595,11 @@ } } }, + "nodemailer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-5.1.1.tgz", + "integrity": "sha512-hKGCoeNdFL2W7S76J/Oucbw0/qRlfG815tENdhzcqTpSjKgAN91mFOqU2lQUflRRxFM7iZvCyaFcAR9noc/CqQ==" + }, "nodemon": { "version": "1.18.10", "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.18.10.tgz", @@ -9750,6 +9856,11 @@ "is-wsl": "^1.1.0" } }, + "options": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", + "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=" + }, "orderedmap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/orderedmap/-/orderedmap-1.0.0.tgz", @@ -9868,7 +9979,6 @@ "version": "5.1.4", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", - "dev": true, "requires": { "asn1.js": "^4.0.0", "browserify-aes": "^1.0.0", @@ -9893,6 +10003,14 @@ "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", "dev": true }, + "parsejson": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz", + "integrity": "sha1-q343WfIJ7OmUN5c/fQ8fZK4OZKs=", + "requires": { + "better-assert": "~1.0.0" + } + }, "parseqs": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", @@ -10000,7 +10118,6 @@ "version": "3.0.17", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", - "dev": true, "requires": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", @@ -10433,7 +10550,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, "requires": { "bn.js": "^4.1.0", "browserify-rsa": "^4.0.0", @@ -10621,7 +10737,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, "requires": { "safe-buffer": "^5.1.0" } @@ -10630,7 +10745,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, "requires": { "randombytes": "^2.0.5", "safe-buffer": "^5.1.0" @@ -11344,7 +11458,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1" @@ -11595,7 +11708,6 @@ "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -11845,6 +11957,204 @@ } } }, + "socketio": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/socketio/-/socketio-1.0.0.tgz", + "integrity": "sha1-aOoVmP0kBWFgFxLldJl2ftjrqMo=", + "requires": { + "express": "^4.13.3", + "socket.io": "^1.3.7" + }, + "dependencies": { + "accepts": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", + "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=", + "requires": { + "mime-types": "~2.1.11", + "negotiator": "0.6.1" + } + }, + "arraybuffer.slice": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz", + "integrity": "sha1-8zshWfBTKj8xB6JywMz70a0peco=" + }, + "blob": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", + "integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE=" + }, + "component-emitter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz", + "integrity": "sha1-KWWU8nU9qmOZbSrwjRWpURbJrsM=" + }, + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "requires": { + "ms": "0.7.2" + } + }, + "engine.io": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-1.8.5.tgz", + "integrity": "sha512-j1DWIcktw4hRwrv6nWx++5nFH2X64x16MAG2P0Lmi5Dvdfi3I+Jhc7JKJIdAmDJa+5aZ/imHV7dWRPy2Cqjh3A==", + "requires": { + "accepts": "1.3.3", + "base64id": "1.0.0", + "cookie": "0.3.1", + "debug": "2.3.3", + "engine.io-parser": "1.3.2", + "ws": "~1.1.5" + } + }, + "engine.io-client": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-1.8.5.tgz", + "integrity": "sha512-AYTgHyeVUPitsseqjoedjhYJapNVoSPShbZ+tEUX9/73jgZ/Z3sUlJf9oYgdEBBdVhupUpUqSxH0kBCXlQnmZg==", + "requires": { + "component-emitter": "1.2.1", + "component-inherit": "0.0.3", + "debug": "2.3.3", + "engine.io-parser": "1.3.2", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "parsejson": "0.0.3", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "ws": "~1.1.5", + "xmlhttprequest-ssl": "1.5.3", + "yeast": "0.1.2" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + } + } + }, + "engine.io-parser": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-1.3.2.tgz", + "integrity": "sha1-k3sHnwAH0Ik+xW1GyyILjLQ1Igo=", + "requires": { + "after": "0.8.2", + "arraybuffer.slice": "0.0.6", + "base64-arraybuffer": "0.1.5", + "blob": "0.0.4", + "has-binary": "0.1.7", + "wtf-8": "1.0.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=" + }, + "object-assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", + "integrity": "sha1-ejs9DpgGPUP0wD8uiubNUahog6A=" + }, + "socket.io": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-1.7.4.tgz", + "integrity": "sha1-L37O3DORvy1cc+KR/iM+bjTU3QA=", + "requires": { + "debug": "2.3.3", + "engine.io": "~1.8.4", + "has-binary": "0.1.7", + "object-assign": "4.1.0", + "socket.io-adapter": "0.5.0", + "socket.io-client": "1.7.4", + "socket.io-parser": "2.3.1" + } + }, + "socket.io-adapter": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-0.5.0.tgz", + "integrity": "sha1-y21LuL7IHhB4uZZ3+c7QBGBmu4s=", + "requires": { + "debug": "2.3.3", + "socket.io-parser": "2.3.1" + } + }, + "socket.io-client": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-1.7.4.tgz", + "integrity": "sha1-7J+CA1btme9tNX8HVtZIcXvdQoE=", + "requires": { + "backo2": "1.0.2", + "component-bind": "1.0.0", + "component-emitter": "1.2.1", + "debug": "2.3.3", + "engine.io-client": "~1.8.4", + "has-binary": "0.1.7", + "indexof": "0.0.1", + "object-component": "0.0.3", + "parseuri": "0.0.5", + "socket.io-parser": "2.3.1", + "to-array": "0.1.4" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + } + } + }, + "socket.io-parser": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-2.3.1.tgz", + "integrity": "sha1-3VMgJRA85Clpcya+/WQAX8/ltKA=", + "requires": { + "component-emitter": "1.1.2", + "debug": "2.2.0", + "isarray": "0.0.1", + "json3": "3.3.2" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "requires": { + "ms": "0.7.1" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=" + } + } + }, + "ws": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz", + "integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==", + "requires": { + "options": ">=0.0.5", + "ultron": "1.0.x" + } + }, + "xmlhttprequest-ssl": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz", + "integrity": "sha1-GFqIjATspGw+QHDZn3tJ3jUomS0=" + } + } + }, "sockjs": { "version": "0.3.19", "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.19.tgz", @@ -12745,6 +13055,11 @@ "random-bytes": "~1.0.0" } }, + "ultron": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", + "integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=" + }, "uncontrollable": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-6.1.0.tgz", @@ -13884,6 +14199,11 @@ "async-limiter": "~1.0.0" } }, + "wtf-8": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wtf-8/-/wtf-8-1.0.0.tgz", + "integrity": "sha1-OS2LotDxw00e4tYw8V0O+2jhBIo=" + }, "xdg-basedir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", @@ -13894,6 +14214,11 @@ "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=" }, + "xoauth2": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/xoauth2/-/xoauth2-1.2.0.tgz", + "integrity": "sha1-8u76wRRyyXHqO8RuVU60sSMhRuU=" + }, "xregexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.0.0.tgz", diff --git a/package.json b/package.json index 640f16437..a4a328859 100644 --- a/package.json +++ b/package.json @@ -38,13 +38,10 @@ "@fortawesome/free-solid-svg-icons": "^5.7.2", "@fortawesome/react-fontawesome": "^0.1.4", "@hig/flyout": "^1.0.3", -<<<<<<< HEAD "@trendmicro/react-dropdown": "^1.3.0", -======= "@types/async": "^2.4.1", "@hig/theme-context": "^2.1.3", "@hig/theme-data": "^2.3.3", ->>>>>>> f70ad315167b714f11f7d68f35a46abe9e525a4d "@types/bcrypt-nodejs": "0.0.30", "@types/bluebird": "^3.5.25", "@types/body-parser": "^1.17.0", @@ -92,11 +89,8 @@ "bcrypt-nodejs": "0.0.3", "bluebird": "^3.5.3", "body-parser": "^1.18.3", -<<<<<<< HEAD "bootstrap": "^4.3.1", -======= "connect-flash": "^0.1.1", ->>>>>>> f70ad315167b714f11f7d68f35a46abe9e525a4d "connect-mongo": "^2.0.3", "cookie-parser": "^1.4.4", "cookie-session": "^2.0.0-beta.3", diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx index 2598dd3a9..da38d54c4 100644 --- a/src/client/views/collections/CollectionSchemaView.tsx +++ b/src/client/views/collections/CollectionSchemaView.tsx @@ -1,10 +1,5 @@ -<<<<<<< HEAD -import React = require("react"); -import { action, observable } from "mobx"; -======= import React = require("react") import { action, observable, ObservableMap, computed } from "mobx"; ->>>>>>> f70ad315167b714f11f7d68f35a46abe9e525a4d import { observer } from "mobx-react"; import Measure from "react-measure"; import ReactTable, { CellInfo, ComponentPropsGetterR, ReactTableDefaults } from "react-table"; @@ -22,23 +17,13 @@ import "./CollectionSchemaView.scss"; import { COLLECTION_BORDER_WIDTH, CollectionView } from "./CollectionView"; import { CollectionViewBase } from "./CollectionViewBase"; import { setupDrag } from "../../util/DragManager"; -<<<<<<< HEAD import '../DocumentDecorations.scss'; import { Flyout, anchorPoints } from "../DocumentDecorations"; import { DropdownButton, Dropdown } from 'react-bootstrap'; import { ListField } from "../../../fields/ListField"; import { Key } from "../../../fields/Key"; -//import { Server } from "http"; -//import { Server } from "http"; import { Server } from "../../Server"; -//import { MenuItem } from 'react-bootstrap'; -======= -import { Key } from "./../../../fields/Key"; -import { Server } from "../../Server"; -import { ListField } from "../../../fields/ListField"; - ->>>>>>> f70ad315167b714f11f7d68f35a46abe9e525a4d // bcz: need to add drag and drop of rows and columns. This seems like it might work for rows: https://codesandbox.io/s/l94mn1q657 @@ -349,18 +334,10 @@ export class CollectionSchemaView extends CollectionViewBase {
    ); let dividerDragger = this.splitPercentage == 0 ? (null) :
    -<<<<<<< HEAD //get the union of all childrens' keys let addFields: { id: string, name: string }[] = []; let removeFields: { id: string, name: string }[] = []; - //children.forEach((child) => { - // for (var keyId in fields.keys) { - // if (!allFields.includes(keyId)) { - // allFields.push(keyId); - // } - // } - // }); let optionsMenu = null; if (this.props.active()) { let protos = this.props.Document.GetAllPrototypes(); @@ -372,28 +349,32 @@ export class CollectionSchemaView extends CollectionViewBase { } }) } - optionsMenu = !this.props.active() ? (null) : (
    Options
    - + /* {addFields.map(({ id, name }) => (
    {name}
    ))}
    {addFields.map(({ id, name }) => (
    {name}
    ))} -
    +
    */ + optionsMenu = !this.props.active() ? (null) : (
    Options
    +
    +
      + {Array.from(Object.keys(allKeys)).map(item => { + return () + })} +
    +
    }>
    ); } - -======= let colDividerDragger = this._columnsPercentage == 0 ? (null) :
    ->>>>>>> f70ad315167b714f11f7d68f35a46abe9e525a4d return (
    @@ -424,19 +405,6 @@ export class CollectionSchemaView extends CollectionViewBase { getTrProps={this.getTrProps} />
    - {colDividerDragger} -
    - {/* - */} - -
    -
      - {Array.from(Object.keys(allKeys)).map(item => { - return () - })} -
    -
    -
    } @@ -445,14 +413,26 @@ export class CollectionSchemaView extends CollectionViewBase { {content}
    {previewHandle} -<<<<<<< HEAD - {optionsMenu} -======= - {columnsHandle} ->>>>>>> f70ad315167b714f11f7d68f35a46abe9e525a4d + {columnsHandle} + {optionsMenu}
    ) } -} \ No newline at end of file +} +/* +{colDividerDragger} +
    + {/* + } + +
    +
      + {Array.from(Object.keys(allKeys)).map(item => { + return () + })} +
    +
    +
    + */ \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 5e416c352ebfb875482f890c6362fee5f84af1f6 Mon Sep 17 00:00:00 2001 From: bob Date: Tue, 19 Mar 2019 15:50:54 -0400 Subject: started to integrate Northstar. changed server port to 4321. --- deploy/assets/env.json | 15 + package.json | 3 +- src/client/Server.ts | 2 +- src/client/northstar/manager/Gateway.ts | 269 + .../northstar/model/idea/MetricTypeMapping.ts | 30 + src/client/northstar/model/idea/idea.ts | 8551 ++++++++++++++++++++ src/client/views/Main.tsx | 28 +- .../views/collections/CollectionSchemaView.tsx | 4 +- src/server/index.ts | 2 +- webpack.config.js | 2 +- 10 files changed, 8896 insertions(+), 10 deletions(-) create mode 100644 deploy/assets/env.json create mode 100644 src/client/northstar/manager/Gateway.ts create mode 100644 src/client/northstar/model/idea/MetricTypeMapping.ts create mode 100644 src/client/northstar/model/idea/idea.ts (limited to 'deploy') diff --git a/deploy/assets/env.json b/deploy/assets/env.json new file mode 100644 index 000000000..80963ea0d --- /dev/null +++ b/deploy/assets/env.json @@ -0,0 +1,15 @@ +{ + "IS_DARPA": false, + "IS_IGT": false, + "IS_MENU_FIXED": true, + "SERVER_URL": "http://localhost:1234", + "SERVER_API_PATH": "api", + "SAMPLE_SIZE": 100000, + "X_BINS": 15, + "Y_BINS": 15, + "SPLASH_TIME_IN_MS": 0, + "SHOW_FPS_COUNTER": true, + "SHOW_SHUTDOWN_BUTTON": false, + "DEGREE_OF_PARALLISM": 1, + "SHOW_WARNINGS": false +} \ No newline at end of file diff --git a/package.json b/package.json index 7ed94c508..c87e31bc4 100644 --- a/package.json +++ b/package.json @@ -38,9 +38,9 @@ "@fortawesome/free-solid-svg-icons": "^5.7.2", "@fortawesome/react-fontawesome": "^0.1.4", "@hig/flyout": "^1.0.3", - "@types/async": "^2.4.1", "@hig/theme-context": "^2.1.3", "@hig/theme-data": "^2.3.3", + "@types/async": "^2.4.1", "@types/bcrypt-nodejs": "0.0.30", "@types/bluebird": "^3.5.25", "@types/body-parser": "^1.17.0", @@ -149,6 +149,7 @@ "socket.io": "^2.2.0", "socket.io-client": "^2.2.0", "socketio": "^1.0.0", + "typescript-collections": "^1.3.2", "url-loader": "^1.1.2", "uuid": "^3.3.2", "xoauth2": "^1.2.0" diff --git a/src/client/Server.ts b/src/client/Server.ts index 3fb1ae878..bbdc27397 100644 --- a/src/client/Server.ts +++ b/src/client/Server.ts @@ -9,7 +9,7 @@ import { MessageStore, Types } from "./../server/Message"; export class Server { public static ClientFieldsCached: ObservableMap = new ObservableMap(); - static Socket: SocketIOClient.Socket = OpenSocket(`${window.location.protocol}//${window.location.hostname}:1234`); + static Socket: SocketIOClient.Socket = OpenSocket(`${window.location.protocol}//${window.location.hostname}:4321`); static GUID: string = Utils.GenerateGuid() diff --git a/src/client/northstar/manager/Gateway.ts b/src/client/northstar/manager/Gateway.ts new file mode 100644 index 000000000..5ae5e4f47 --- /dev/null +++ b/src/client/northstar/manager/Gateway.ts @@ -0,0 +1,269 @@ +import { Catalog, OperationReference, Result, CompileResults } from "../model/idea/idea" +import { computed, observable, action } from "mobx"; + +export class Gateway { + + private static _instance: Gateway; + + private constructor() { + } + + public static get Instance() { + return this._instance || (this._instance = new this()); + } + + public async GetCatalog(): Promise { + try { + const json = await this.MakeGetRequest("catalog"); + const cat = Catalog.fromJS(json); + return cat; + } + catch (error) { + throw new Error("can not reach northstar's backend"); + } + } + + public async ClearCatalog(): Promise { + try { + const json = await this.MakePostJsonRequest("Datamart/ClearAllAugmentations", {}); + } + catch (error) { + throw new Error("can not reach northstar's backend"); + } + } + + public async TerminateServer(): Promise { + try { + const url = Gateway.ConstructUrl("terminateServer"); + const response = await fetch(url, + { + redirect: "follow", + method: "POST", + credentials: "include" + }); + } + catch (error) { + throw new Error("can not reach northstar's backend"); + } + } + + public async Compile(data: any): Promise { + const json = await this.MakePostJsonRequest("compile", data); + if (json != null) { + const cr = CompileResults.fromJS(json); + return cr; + } + } + + public async SubmitResult(data: any): Promise { + try { + console.log(data); + const url = Gateway.ConstructUrl("submitProblem"); + const response = await fetch(url, + { + redirect: "follow", + method: "POST", + credentials: "include", + body: JSON.stringify(data) + }); + } + catch (error) { + throw new Error("can not reach northstar's backend"); + } + } + + public async SpecifyProblem(data: any): Promise { + try { + console.log(data); + const url = Gateway.ConstructUrl("specifyProblem"); + const response = await fetch(url, + { + redirect: "follow", + method: "POST", + credentials: "include", + body: JSON.stringify(data) + }); + } + catch (error) { + throw new Error("can not reach northstar's backend"); + } + } + + public async ExportToScript(solutionId: string): Promise { + try { + const url = Gateway.ConstructUrl("exportsolution/script/" + solutionId); + const response = await fetch(url, + { + redirect: "follow", + method: "GET", + credentials: "include" + }); + return await response.text(); + } + catch (error) { + throw new Error("can not reach northstar's backend"); + } + } + + + public async StartOperation(data: any): Promise { + const json = await this.MakePostJsonRequest("operation", data); + if (json != null) { + const or = OperationReference.fromJS(json); + return or; + } + } + + public async GetResult(data: any): Promise { + const json = await this.MakePostJsonRequest("result", data); + if (json != null) { + const res = Result.fromJS(json); + return res; + } + } + + public async PauseOperation(data: any): Promise { + const url = Gateway.ConstructUrl("pause"); + await fetch(url, + { + redirect: "follow", + method: "POST", + credentials: "include", + body: JSON.stringify(data) + }); + } + + public async MakeGetRequest(endpoint: string, signal?: AbortSignal): Promise { + const url = Gateway.ConstructUrl(endpoint); + const response = await fetch(url, + { + redirect: "follow", + method: "GET", + credentials: "include", + signal + }); + const json = await response.json(); + return json; + } + + public async MakePostJsonRequest(endpoint: string, data: any, signal?: AbortSignal): Promise { + const url = Gateway.ConstructUrl(endpoint); + const response = await fetch(url, + { + redirect: "follow", + method: "POST", + credentials: "include", + body: JSON.stringify(data), + signal + }); + const json = await response.json(); + return json; + } + + + public static ConstructUrl(appendix: string): string { + let base = Settings.Instance.ServerUrl; + if (base.slice(-1) == "/") { + base = base.slice(0, -1); + } + let url = base + "/" + Settings.Instance.ServerApiPath + "/" + appendix; + return url; + } +} + +declare var ENV: any; + +export class Settings { + private _environment: any; + + @observable + public ServerUrl: string = document.URL; + + @observable + public ServerApiPath?: string; + + @observable + public SampleSize?: number; + + @observable + public XBins?: number; + + @observable + public YBins?: number; + + @observable + public SplashTimeInMS?: number; + + @observable + public ShowFpsCounter?: boolean; + + @observable + public IsMenuFixed?: boolean; + + @observable + public ShowShutdownButton?: boolean; + + @observable + public IsDarpa?: boolean; + + @observable + public IsIGT?: boolean; + + @observable + public DegreeOfParallelism?: number; + + @observable + public ShowWarnings?: boolean; + + @computed + public get IsDev(): boolean { + return ENV.IsDev; + } + + @computed + public get TestDataFolderPath(): string { + return this.Origin + "testdata/"; + } + + @computed + public get Origin(): string { + return window.location.origin + "/"; + } + + private static _instance: Settings; + + @action + public Update(environment: any): void { + /*let serverParam = new URL(document.URL).searchParams.get("serverUrl"); + if (serverParam) { + if (serverParam === "debug") { + this.ServerUrl = `http://${window.location.hostname}:1234`; + } + else { + this.ServerUrl = serverParam; + } + } + else { + this.ServerUrl = environment["SERVER_URL"] ? environment["SERVER_URL"] : document.URL; + }*/ + this.ServerUrl = environment["SERVER_URL"] ? environment["SERVER_URL"] : document.URL; + this.ServerApiPath = environment["SERVER_API_PATH"]; + this.SampleSize = environment["SAMPLE_SIZE"]; + this.XBins = environment["X_BINS"]; + this.YBins = environment["Y_BINS"]; + this.SplashTimeInMS = environment["SPLASH_TIME_IN_MS"]; + this.ShowFpsCounter = environment["SHOW_FPS_COUNTER"]; + this.ShowShutdownButton = environment["SHOW_SHUTDOWN_BUTTON"]; + this.IsMenuFixed = environment["IS_MENU_FIXED"]; + this.IsDarpa = environment["IS_DARPA"]; + this.IsIGT = environment["IS_IGT"]; + this.DegreeOfParallelism = environment["DEGREE_OF_PARALLISM"]; + } + + public static get Instance(): Settings { + if (!this._instance) { + this._instance = new Settings(); + } + return this._instance; + } +} diff --git a/src/client/northstar/model/idea/MetricTypeMapping.ts b/src/client/northstar/model/idea/MetricTypeMapping.ts new file mode 100644 index 000000000..11e0c871a --- /dev/null +++ b/src/client/northstar/model/idea/MetricTypeMapping.ts @@ -0,0 +1,30 @@ +import { MetricType } from "./Idea"; +import { Dictionary } from 'typescript-collections'; + + +export class MetricTypeMapping { + + public static GetMetricInterpretation(metricType: MetricType): MetricInterpretation { + if (metricType == MetricType.Accuracy || + metricType == MetricType.F1 || + metricType == MetricType.F1Macro || + metricType == MetricType.F1Micro || + metricType == MetricType.JaccardSimilarityScore || + metricType == MetricType.ObjectDetectionAveragePrecision || + metricType == MetricType.Precision || + metricType == MetricType.PrecisionAtTopK || + metricType == MetricType.NormalizedMutualInformation || + metricType == MetricType.Recall || + metricType == MetricType.RocAucMacro || + metricType == MetricType.RocAuc || + metricType == MetricType.RocAucMicro || + metricType == MetricType.RSquared) { + return MetricInterpretation.HigherIsBetter; + } + return MetricInterpretation.LowerIsBetter; + } +} + +export enum MetricInterpretation { + HigherIsBetter, LowerIsBetter +} \ No newline at end of file diff --git a/src/client/northstar/model/idea/idea.ts b/src/client/northstar/model/idea/idea.ts new file mode 100644 index 000000000..9d9d60678 --- /dev/null +++ b/src/client/northstar/model/idea/idea.ts @@ -0,0 +1,8551 @@ +/* tslint:disable */ +//---------------------- +// +// Generated using the NSwag toolchain v11.19.2.0 (NJsonSchema v9.10.73.0 (Newtonsoft.Json v9.0.0.0)) (http://NSwag.org) +// +//---------------------- +// ReSharper disable InconsistentNaming + + + +export enum AggregateFunction { + None = "None", + Sum = "Sum", + SumE = "SumE", + Count = "Count", + Min = "Min", + Max = "Max", + Avg = "Avg", +} + +export abstract class AggregateParameters implements IAggregateParameters { + + protected _discriminator: string; + + constructor(data?: IAggregateParameters) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + this._discriminator = "AggregateParameters"; + } + + init(data?: any) { + if (data) { + } + } + + static fromJS(data: any): AggregateParameters { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "AverageAggregateParameters") { + let result = new AverageAggregateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "SingleDimensionAggregateParameters") { + throw new Error("The abstract class 'SingleDimensionAggregateParameters' cannot be instantiated."); + } + if (data["discriminator"] === "CountAggregateParameters") { + let result = new CountAggregateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "KDEAggregateParameters") { + let result = new KDEAggregateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "MarginAggregateParameters") { + let result = new MarginAggregateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "MaxAggregateParameters") { + let result = new MaxAggregateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "MinAggregateParameters") { + let result = new MinAggregateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "SumAggregateParameters") { + let result = new SumAggregateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "SumEstimationAggregateParameters") { + let result = new SumEstimationAggregateParameters(); + result.init(data); + return result; + } + throw new Error("The abstract class 'AggregateParameters' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["discriminator"] = this._discriminator; + return data; + } +} + +export interface IAggregateParameters { +} + +export abstract class SingleDimensionAggregateParameters extends AggregateParameters implements ISingleDimensionAggregateParameters { + attributeParameters?: AttributeParameters | undefined; + distinctAttributeParameters?: AttributeParameters | undefined; + + constructor(data?: ISingleDimensionAggregateParameters) { + super(data); + this._discriminator = "SingleDimensionAggregateParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.attributeParameters = data["AttributeParameters"] ? AttributeParameters.fromJS(data["AttributeParameters"]) : undefined; + this.distinctAttributeParameters = data["DistinctAttributeParameters"] ? AttributeParameters.fromJS(data["DistinctAttributeParameters"]) : undefined; + } + } + + static fromJS(data: any): SingleDimensionAggregateParameters { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "AverageAggregateParameters") { + let result = new AverageAggregateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "CountAggregateParameters") { + let result = new CountAggregateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "KDEAggregateParameters") { + let result = new KDEAggregateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "MarginAggregateParameters") { + let result = new MarginAggregateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "MaxAggregateParameters") { + let result = new MaxAggregateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "MinAggregateParameters") { + let result = new MinAggregateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "SumAggregateParameters") { + let result = new SumAggregateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "SumEstimationAggregateParameters") { + let result = new SumEstimationAggregateParameters(); + result.init(data); + return result; + } + throw new Error("The abstract class 'SingleDimensionAggregateParameters' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["AttributeParameters"] = this.attributeParameters ? this.attributeParameters.toJSON() : undefined; + data["DistinctAttributeParameters"] = this.distinctAttributeParameters ? this.distinctAttributeParameters.toJSON() : undefined; + super.toJSON(data); + return data; + } +} + +export interface ISingleDimensionAggregateParameters extends IAggregateParameters { + attributeParameters?: AttributeParameters | undefined; + distinctAttributeParameters?: AttributeParameters | undefined; +} + +export class AverageAggregateParameters extends SingleDimensionAggregateParameters implements IAverageAggregateParameters { + + constructor(data?: IAverageAggregateParameters) { + super(data); + this._discriminator = "AverageAggregateParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): AverageAggregateParameters { + data = typeof data === 'object' ? data : {}; + let result = new AverageAggregateParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface IAverageAggregateParameters extends ISingleDimensionAggregateParameters { +} + +export abstract class AttributeParameters implements IAttributeParameters { + visualizationHints?: VisualizationHint[] | undefined; + rawName?: string | undefined; + + protected _discriminator: string; + + constructor(data?: IAttributeParameters) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + this._discriminator = "AttributeParameters"; + } + + init(data?: any) { + if (data) { + if (data["VisualizationHints"] && data["VisualizationHints"].constructor === Array) { + this.visualizationHints = []; + for (let item of data["VisualizationHints"]) + this.visualizationHints.push(item); + } + this.rawName = data["RawName"]; + } + } + + static fromJS(data: any): AttributeParameters { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "AttributeBackendParameters") { + let result = new AttributeBackendParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "AttributeCaclculatedParameters") { + throw new Error("The abstract class 'AttributeCaclculatedParameters' cannot be instantiated."); + } + if (data["discriminator"] === "AttributeCodeParameters") { + let result = new AttributeCodeParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "AttributeColumnParameters") { + let result = new AttributeColumnParameters(); + result.init(data); + return result; + } + throw new Error("The abstract class 'AttributeParameters' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["discriminator"] = this._discriminator; + if (this.visualizationHints && this.visualizationHints.constructor === Array) { + data["VisualizationHints"] = []; + for (let item of this.visualizationHints) + data["VisualizationHints"].push(item); + } + data["RawName"] = this.rawName; + return data; + } +} + +export interface IAttributeParameters { + visualizationHints?: VisualizationHint[] | undefined; + rawName?: string | undefined; +} + +export enum VisualizationHint { + TreatAsEnumeration = "TreatAsEnumeration", + DefaultFlipAxis = "DefaultFlipAxis", + Image = "Image", +} + +export abstract class AttributeCaclculatedParameters extends AttributeParameters implements IAttributeCaclculatedParameters { + + constructor(data?: IAttributeCaclculatedParameters) { + super(data); + this._discriminator = "AttributeCaclculatedParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): AttributeCaclculatedParameters { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "AttributeBackendParameters") { + let result = new AttributeBackendParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "AttributeCodeParameters") { + let result = new AttributeCodeParameters(); + result.init(data); + return result; + } + throw new Error("The abstract class 'AttributeCaclculatedParameters' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface IAttributeCaclculatedParameters extends IAttributeParameters { +} + +export class AttributeBackendParameters extends AttributeCaclculatedParameters implements IAttributeBackendParameters { + id?: string | undefined; + + constructor(data?: IAttributeBackendParameters) { + super(data); + this._discriminator = "AttributeBackendParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.id = data["Id"]; + } + } + + static fromJS(data: any): AttributeBackendParameters { + data = typeof data === 'object' ? data : {}; + let result = new AttributeBackendParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Id"] = this.id; + super.toJSON(data); + return data; + } +} + +export interface IAttributeBackendParameters extends IAttributeCaclculatedParameters { + id?: string | undefined; +} + +export class AttributeCodeParameters extends AttributeCaclculatedParameters implements IAttributeCodeParameters { + code?: string | undefined; + + constructor(data?: IAttributeCodeParameters) { + super(data); + this._discriminator = "AttributeCodeParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.code = data["Code"]; + } + } + + static fromJS(data: any): AttributeCodeParameters { + data = typeof data === 'object' ? data : {}; + let result = new AttributeCodeParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Code"] = this.code; + super.toJSON(data); + return data; + } +} + +export interface IAttributeCodeParameters extends IAttributeCaclculatedParameters { + code?: string | undefined; +} + +export class AttributeColumnParameters extends AttributeParameters implements IAttributeColumnParameters { + + constructor(data?: IAttributeColumnParameters) { + super(data); + this._discriminator = "AttributeColumnParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): AttributeColumnParameters { + data = typeof data === 'object' ? data : {}; + let result = new AttributeColumnParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface IAttributeColumnParameters extends IAttributeParameters { +} + +export class CountAggregateParameters extends SingleDimensionAggregateParameters implements ICountAggregateParameters { + + constructor(data?: ICountAggregateParameters) { + super(data); + this._discriminator = "CountAggregateParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): CountAggregateParameters { + data = typeof data === 'object' ? data : {}; + let result = new CountAggregateParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface ICountAggregateParameters extends ISingleDimensionAggregateParameters { +} + +export class KDEAggregateParameters extends SingleDimensionAggregateParameters implements IKDEAggregateParameters { + nrOfSamples?: number | undefined; + + constructor(data?: IKDEAggregateParameters) { + super(data); + this._discriminator = "KDEAggregateParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.nrOfSamples = data["NrOfSamples"]; + } + } + + static fromJS(data: any): KDEAggregateParameters { + data = typeof data === 'object' ? data : {}; + let result = new KDEAggregateParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["NrOfSamples"] = this.nrOfSamples; + super.toJSON(data); + return data; + } +} + +export interface IKDEAggregateParameters extends ISingleDimensionAggregateParameters { + nrOfSamples?: number | undefined; +} + +export class MarginAggregateParameters extends SingleDimensionAggregateParameters implements IMarginAggregateParameters { + aggregateFunction?: AggregateFunction | undefined; + + constructor(data?: IMarginAggregateParameters) { + super(data); + this._discriminator = "MarginAggregateParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.aggregateFunction = data["AggregateFunction"]; + } + } + + static fromJS(data: any): MarginAggregateParameters { + data = typeof data === 'object' ? data : {}; + let result = new MarginAggregateParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["AggregateFunction"] = this.aggregateFunction; + super.toJSON(data); + return data; + } +} + +export interface IMarginAggregateParameters extends ISingleDimensionAggregateParameters { + aggregateFunction?: AggregateFunction | undefined; +} + +export class MaxAggregateParameters extends SingleDimensionAggregateParameters implements IMaxAggregateParameters { + + constructor(data?: IMaxAggregateParameters) { + super(data); + this._discriminator = "MaxAggregateParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): MaxAggregateParameters { + data = typeof data === 'object' ? data : {}; + let result = new MaxAggregateParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface IMaxAggregateParameters extends ISingleDimensionAggregateParameters { +} + +export class MinAggregateParameters extends SingleDimensionAggregateParameters implements IMinAggregateParameters { + + constructor(data?: IMinAggregateParameters) { + super(data); + this._discriminator = "MinAggregateParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): MinAggregateParameters { + data = typeof data === 'object' ? data : {}; + let result = new MinAggregateParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface IMinAggregateParameters extends ISingleDimensionAggregateParameters { +} + +export class SumAggregateParameters extends SingleDimensionAggregateParameters implements ISumAggregateParameters { + + constructor(data?: ISumAggregateParameters) { + super(data); + this._discriminator = "SumAggregateParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): SumAggregateParameters { + data = typeof data === 'object' ? data : {}; + let result = new SumAggregateParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface ISumAggregateParameters extends ISingleDimensionAggregateParameters { +} + +export class SumEstimationAggregateParameters extends SingleDimensionAggregateParameters implements ISumEstimationAggregateParameters { + + constructor(data?: ISumEstimationAggregateParameters) { + super(data); + this._discriminator = "SumEstimationAggregateParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): SumEstimationAggregateParameters { + data = typeof data === 'object' ? data : {}; + let result = new SumEstimationAggregateParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface ISumEstimationAggregateParameters extends ISingleDimensionAggregateParameters { +} + +export enum OrderingFunction { + None = 0, + SortUp = 1, + SortDown = 2, +} + +export abstract class BinningParameters implements IBinningParameters { + attributeParameters?: AttributeParameters | undefined; + + protected _discriminator: string; + + constructor(data?: IBinningParameters) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + this._discriminator = "BinningParameters"; + } + + init(data?: any) { + if (data) { + this.attributeParameters = data["AttributeParameters"] ? AttributeParameters.fromJS(data["AttributeParameters"]) : undefined; + } + } + + static fromJS(data: any): BinningParameters { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "EquiWidthBinningParameters") { + let result = new EquiWidthBinningParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "SingleBinBinningParameters") { + let result = new SingleBinBinningParameters(); + result.init(data); + return result; + } + throw new Error("The abstract class 'BinningParameters' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["discriminator"] = this._discriminator; + data["AttributeParameters"] = this.attributeParameters ? this.attributeParameters.toJSON() : undefined; + return data; + } +} + +export interface IBinningParameters { + attributeParameters?: AttributeParameters | undefined; +} + +export class EquiWidthBinningParameters extends BinningParameters implements IEquiWidthBinningParameters { + minValue?: number | undefined; + maxValue?: number | undefined; + requestedNrOfBins?: number | undefined; + referenceValue?: number | undefined; + step?: number | undefined; + + constructor(data?: IEquiWidthBinningParameters) { + super(data); + this._discriminator = "EquiWidthBinningParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.minValue = data["MinValue"]; + this.maxValue = data["MaxValue"]; + this.requestedNrOfBins = data["RequestedNrOfBins"]; + this.referenceValue = data["ReferenceValue"]; + this.step = data["Step"]; + } + } + + static fromJS(data: any): EquiWidthBinningParameters { + data = typeof data === 'object' ? data : {}; + let result = new EquiWidthBinningParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["MinValue"] = this.minValue; + data["MaxValue"] = this.maxValue; + data["RequestedNrOfBins"] = this.requestedNrOfBins; + data["ReferenceValue"] = this.referenceValue; + data["Step"] = this.step; + super.toJSON(data); + return data; + } +} + +export interface IEquiWidthBinningParameters extends IBinningParameters { + minValue?: number | undefined; + maxValue?: number | undefined; + requestedNrOfBins?: number | undefined; + referenceValue?: number | undefined; + step?: number | undefined; +} + +export class SingleBinBinningParameters extends BinningParameters implements ISingleBinBinningParameters { + + constructor(data?: ISingleBinBinningParameters) { + super(data); + this._discriminator = "SingleBinBinningParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): SingleBinBinningParameters { + data = typeof data === 'object' ? data : {}; + let result = new SingleBinBinningParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface ISingleBinBinningParameters extends IBinningParameters { +} + +export class Attribute implements IAttribute { + displayName?: string | undefined; + rawName?: string | undefined; + description?: string | undefined; + dataType?: DataType | undefined; + visualizationHints?: VisualizationHint[] | undefined; + isTarget?: boolean | undefined; + + constructor(data?: IAttribute) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.displayName = data["DisplayName"]; + this.rawName = data["RawName"]; + this.description = data["Description"]; + this.dataType = data["DataType"]; + if (data["VisualizationHints"] && data["VisualizationHints"].constructor === Array) { + this.visualizationHints = []; + for (let item of data["VisualizationHints"]) + this.visualizationHints.push(item); + } + this.isTarget = data["IsTarget"]; + } + } + + static fromJS(data: any): Attribute { + data = typeof data === 'object' ? data : {}; + let result = new Attribute(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["DisplayName"] = this.displayName; + data["RawName"] = this.rawName; + data["Description"] = this.description; + data["DataType"] = this.dataType; + if (this.visualizationHints && this.visualizationHints.constructor === Array) { + data["VisualizationHints"] = []; + for (let item of this.visualizationHints) + data["VisualizationHints"].push(item); + } + data["IsTarget"] = this.isTarget; + return data; + } +} + +export interface IAttribute { + displayName?: string | undefined; + rawName?: string | undefined; + description?: string | undefined; + dataType?: DataType | undefined; + visualizationHints?: VisualizationHint[] | undefined; + isTarget?: boolean | undefined; +} + +export enum DataType { + Int = "Int", + String = "String", + Float = "Float", + Double = "Double", + DateTime = "DateTime", + Object = "Object", + Undefined = "Undefined", +} + +export class AttributeGroup implements IAttributeGroup { + name?: string | undefined; + attributeGroups?: AttributeGroup[] | undefined; + attributes?: Attribute[] | undefined; + + constructor(data?: IAttributeGroup) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.name = data["Name"]; + if (data["AttributeGroups"] && data["AttributeGroups"].constructor === Array) { + this.attributeGroups = []; + for (let item of data["AttributeGroups"]) + this.attributeGroups.push(AttributeGroup.fromJS(item)); + } + if (data["Attributes"] && data["Attributes"].constructor === Array) { + this.attributes = []; + for (let item of data["Attributes"]) + this.attributes.push(Attribute.fromJS(item)); + } + } + } + + static fromJS(data: any): AttributeGroup { + data = typeof data === 'object' ? data : {}; + let result = new AttributeGroup(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Name"] = this.name; + if (this.attributeGroups && this.attributeGroups.constructor === Array) { + data["AttributeGroups"] = []; + for (let item of this.attributeGroups) + data["AttributeGroups"].push(item.toJSON()); + } + if (this.attributes && this.attributes.constructor === Array) { + data["Attributes"] = []; + for (let item of this.attributes) + data["Attributes"].push(item.toJSON()); + } + return data; + } +} + +export interface IAttributeGroup { + name?: string | undefined; + attributeGroups?: AttributeGroup[] | undefined; + attributes?: Attribute[] | undefined; +} + +export class Catalog implements ICatalog { + supportedOperations?: string[] | undefined; + schemas?: Schema[] | undefined; + + constructor(data?: ICatalog) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + if (data["SupportedOperations"] && data["SupportedOperations"].constructor === Array) { + this.supportedOperations = []; + for (let item of data["SupportedOperations"]) + this.supportedOperations.push(item); + } + if (data["Schemas"] && data["Schemas"].constructor === Array) { + this.schemas = []; + for (let item of data["Schemas"]) + this.schemas.push(Schema.fromJS(item)); + } + } + } + + static fromJS(data: any): Catalog { + data = typeof data === 'object' ? data : {}; + let result = new Catalog(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.supportedOperations && this.supportedOperations.constructor === Array) { + data["SupportedOperations"] = []; + for (let item of this.supportedOperations) + data["SupportedOperations"].push(item); + } + if (this.schemas && this.schemas.constructor === Array) { + data["Schemas"] = []; + for (let item of this.schemas) + data["Schemas"].push(item.toJSON()); + } + return data; + } +} + +export interface ICatalog { + supportedOperations?: string[] | undefined; + schemas?: Schema[] | undefined; +} + +export class Schema implements ISchema { + rootAttributeGroup?: AttributeGroup | undefined; + displayName?: string | undefined; + augmentedFrom?: string | undefined; + rawName?: string | undefined; + problemDescription?: string | undefined; + darpaProblemDoc?: DarpaProblemDoc | undefined; + distinctAttributeParameters?: AttributeParameters | undefined; + darpaDatasetDoc?: DarpaDatasetDoc | undefined; + darpaDatasetLocation?: string | undefined; + isMultiResourceData?: boolean | undefined; + problemFinderRows?: ProblemFinderRows[] | undefined; + correlationRows?: ProblemFinderRows[] | undefined; + + constructor(data?: ISchema) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.rootAttributeGroup = data["RootAttributeGroup"] ? AttributeGroup.fromJS(data["RootAttributeGroup"]) : undefined; + this.displayName = data["DisplayName"]; + this.augmentedFrom = data["AugmentedFrom"]; + this.rawName = data["RawName"]; + this.problemDescription = data["ProblemDescription"]; + this.darpaProblemDoc = data["DarpaProblemDoc"] ? DarpaProblemDoc.fromJS(data["DarpaProblemDoc"]) : undefined; + this.distinctAttributeParameters = data["DistinctAttributeParameters"] ? AttributeParameters.fromJS(data["DistinctAttributeParameters"]) : undefined; + this.darpaDatasetDoc = data["DarpaDatasetDoc"] ? DarpaDatasetDoc.fromJS(data["DarpaDatasetDoc"]) : undefined; + this.darpaDatasetLocation = data["DarpaDatasetLocation"]; + this.isMultiResourceData = data["IsMultiResourceData"]; + if (data["ProblemFinderRows"] && data["ProblemFinderRows"].constructor === Array) { + this.problemFinderRows = []; + for (let item of data["ProblemFinderRows"]) + this.problemFinderRows.push(ProblemFinderRows.fromJS(item)); + } + if (data["CorrelationRows"] && data["CorrelationRows"].constructor === Array) { + this.correlationRows = []; + for (let item of data["CorrelationRows"]) + this.correlationRows.push(ProblemFinderRows.fromJS(item)); + } + } + } + + static fromJS(data: any): Schema { + data = typeof data === 'object' ? data : {}; + let result = new Schema(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["RootAttributeGroup"] = this.rootAttributeGroup ? this.rootAttributeGroup.toJSON() : undefined; + data["DisplayName"] = this.displayName; + data["AugmentedFrom"] = this.augmentedFrom; + data["RawName"] = this.rawName; + data["ProblemDescription"] = this.problemDescription; + data["DarpaProblemDoc"] = this.darpaProblemDoc ? this.darpaProblemDoc.toJSON() : undefined; + data["DistinctAttributeParameters"] = this.distinctAttributeParameters ? this.distinctAttributeParameters.toJSON() : undefined; + data["DarpaDatasetDoc"] = this.darpaDatasetDoc ? this.darpaDatasetDoc.toJSON() : undefined; + data["DarpaDatasetLocation"] = this.darpaDatasetLocation; + data["IsMultiResourceData"] = this.isMultiResourceData; + if (this.problemFinderRows && this.problemFinderRows.constructor === Array) { + data["ProblemFinderRows"] = []; + for (let item of this.problemFinderRows) + data["ProblemFinderRows"].push(item.toJSON()); + } + if (this.correlationRows && this.correlationRows.constructor === Array) { + data["CorrelationRows"] = []; + for (let item of this.correlationRows) + data["CorrelationRows"].push(item.toJSON()); + } + return data; + } +} + +export interface ISchema { + rootAttributeGroup?: AttributeGroup | undefined; + displayName?: string | undefined; + augmentedFrom?: string | undefined; + rawName?: string | undefined; + problemDescription?: string | undefined; + darpaProblemDoc?: DarpaProblemDoc | undefined; + distinctAttributeParameters?: AttributeParameters | undefined; + darpaDatasetDoc?: DarpaDatasetDoc | undefined; + darpaDatasetLocation?: string | undefined; + isMultiResourceData?: boolean | undefined; + problemFinderRows?: ProblemFinderRows[] | undefined; + correlationRows?: ProblemFinderRows[] | undefined; +} + +export class DarpaProblemDoc implements IDarpaProblemDoc { + about?: ProblemAbout | undefined; + inputs?: ProblemInputs | undefined; + + constructor(data?: IDarpaProblemDoc) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.about = data["about"] ? ProblemAbout.fromJS(data["about"]) : undefined; + this.inputs = data["inputs"] ? ProblemInputs.fromJS(data["inputs"]) : undefined; + } + } + + static fromJS(data: any): DarpaProblemDoc { + data = typeof data === 'object' ? data : {}; + let result = new DarpaProblemDoc(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["about"] = this.about ? this.about.toJSON() : undefined; + data["inputs"] = this.inputs ? this.inputs.toJSON() : undefined; + return data; + } +} + +export interface IDarpaProblemDoc { + about?: ProblemAbout | undefined; + inputs?: ProblemInputs | undefined; +} + +export class ProblemAbout implements IProblemAbout { + problemID?: string | undefined; + problemName?: string | undefined; + problemDescription?: string | undefined; + taskType?: string | undefined; + taskSubType?: string | undefined; + problemSchemaVersion?: string | undefined; + problemVersion?: string | undefined; + + constructor(data?: IProblemAbout) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.problemID = data["problemID"]; + this.problemName = data["problemName"]; + this.problemDescription = data["problemDescription"]; + this.taskType = data["taskType"]; + this.taskSubType = data["taskSubType"]; + this.problemSchemaVersion = data["problemSchemaVersion"]; + this.problemVersion = data["problemVersion"]; + } + } + + static fromJS(data: any): ProblemAbout { + data = typeof data === 'object' ? data : {}; + let result = new ProblemAbout(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["problemID"] = this.problemID; + data["problemName"] = this.problemName; + data["problemDescription"] = this.problemDescription; + data["taskType"] = this.taskType; + data["taskSubType"] = this.taskSubType; + data["problemSchemaVersion"] = this.problemSchemaVersion; + data["problemVersion"] = this.problemVersion; + return data; + } +} + +export interface IProblemAbout { + problemID?: string | undefined; + problemName?: string | undefined; + problemDescription?: string | undefined; + taskType?: string | undefined; + taskSubType?: string | undefined; + problemSchemaVersion?: string | undefined; + problemVersion?: string | undefined; +} + +export class ProblemInputs implements IProblemInputs { + data?: ProblemData[] | undefined; + performanceMetrics?: ProblemPerformanceMetric[] | undefined; + + constructor(data?: IProblemInputs) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + if (data["data"] && data["data"].constructor === Array) { + this.data = []; + for (let item of data["data"]) + this.data.push(ProblemData.fromJS(item)); + } + if (data["performanceMetrics"] && data["performanceMetrics"].constructor === Array) { + this.performanceMetrics = []; + for (let item of data["performanceMetrics"]) + this.performanceMetrics.push(ProblemPerformanceMetric.fromJS(item)); + } + } + } + + static fromJS(data: any): ProblemInputs { + data = typeof data === 'object' ? data : {}; + let result = new ProblemInputs(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.data && this.data.constructor === Array) { + data["data"] = []; + for (let item of this.data) + data["data"].push(item.toJSON()); + } + if (this.performanceMetrics && this.performanceMetrics.constructor === Array) { + data["performanceMetrics"] = []; + for (let item of this.performanceMetrics) + data["performanceMetrics"].push(item.toJSON()); + } + return data; + } +} + +export interface IProblemInputs { + data?: ProblemData[] | undefined; + performanceMetrics?: ProblemPerformanceMetric[] | undefined; +} + +export class ProblemData implements IProblemData { + datasetID?: string | undefined; + targets?: ProblemTarget[] | undefined; + + constructor(data?: IProblemData) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.datasetID = data["datasetID"]; + if (data["targets"] && data["targets"].constructor === Array) { + this.targets = []; + for (let item of data["targets"]) + this.targets.push(ProblemTarget.fromJS(item)); + } + } + } + + static fromJS(data: any): ProblemData { + data = typeof data === 'object' ? data : {}; + let result = new ProblemData(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["datasetID"] = this.datasetID; + if (this.targets && this.targets.constructor === Array) { + data["targets"] = []; + for (let item of this.targets) + data["targets"].push(item.toJSON()); + } + return data; + } +} + +export interface IProblemData { + datasetID?: string | undefined; + targets?: ProblemTarget[] | undefined; +} + +export class ProblemTarget implements IProblemTarget { + targetIndex?: number | undefined; + resID?: string | undefined; + colIndex?: number | undefined; + colName?: string | undefined; + + constructor(data?: IProblemTarget) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.targetIndex = data["targetIndex"]; + this.resID = data["resID"]; + this.colIndex = data["colIndex"]; + this.colName = data["colName"]; + } + } + + static fromJS(data: any): ProblemTarget { + data = typeof data === 'object' ? data : {}; + let result = new ProblemTarget(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["targetIndex"] = this.targetIndex; + data["resID"] = this.resID; + data["colIndex"] = this.colIndex; + data["colName"] = this.colName; + return data; + } +} + +export interface IProblemTarget { + targetIndex?: number | undefined; + resID?: string | undefined; + colIndex?: number | undefined; + colName?: string | undefined; +} + +export class ProblemPerformanceMetric implements IProblemPerformanceMetric { + metric?: string | undefined; + + constructor(data?: IProblemPerformanceMetric) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.metric = data["metric"]; + } + } + + static fromJS(data: any): ProblemPerformanceMetric { + data = typeof data === 'object' ? data : {}; + let result = new ProblemPerformanceMetric(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["metric"] = this.metric; + return data; + } +} + +export interface IProblemPerformanceMetric { + metric?: string | undefined; +} + +export class DarpaDatasetDoc implements IDarpaDatasetDoc { + about?: DatasetAbout | undefined; + dataResources?: Resource[] | undefined; + + constructor(data?: IDarpaDatasetDoc) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.about = data["about"] ? DatasetAbout.fromJS(data["about"]) : undefined; + if (data["dataResources"] && data["dataResources"].constructor === Array) { + this.dataResources = []; + for (let item of data["dataResources"]) + this.dataResources.push(Resource.fromJS(item)); + } + } + } + + static fromJS(data: any): DarpaDatasetDoc { + data = typeof data === 'object' ? data : {}; + let result = new DarpaDatasetDoc(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["about"] = this.about ? this.about.toJSON() : undefined; + if (this.dataResources && this.dataResources.constructor === Array) { + data["dataResources"] = []; + for (let item of this.dataResources) + data["dataResources"].push(item.toJSON()); + } + return data; + } +} + +export interface IDarpaDatasetDoc { + about?: DatasetAbout | undefined; + dataResources?: Resource[] | undefined; +} + +export class DatasetAbout implements IDatasetAbout { + datasetID?: string | undefined; + datasetName?: string | undefined; + description?: string | undefined; + citation?: string | undefined; + license?: string | undefined; + source?: string | undefined; + sourceURI?: string | undefined; + approximateSize?: string | undefined; + datasetSchemaVersion?: string | undefined; + redacted?: boolean | undefined; + datasetVersion?: string | undefined; + + constructor(data?: IDatasetAbout) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.datasetID = data["datasetID"]; + this.datasetName = data["datasetName"]; + this.description = data["description"]; + this.citation = data["citation"]; + this.license = data["license"]; + this.source = data["source"]; + this.sourceURI = data["sourceURI"]; + this.approximateSize = data["approximateSize"]; + this.datasetSchemaVersion = data["datasetSchemaVersion"]; + this.redacted = data["redacted"]; + this.datasetVersion = data["datasetVersion"]; + } + } + + static fromJS(data: any): DatasetAbout { + data = typeof data === 'object' ? data : {}; + let result = new DatasetAbout(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["datasetID"] = this.datasetID; + data["datasetName"] = this.datasetName; + data["description"] = this.description; + data["citation"] = this.citation; + data["license"] = this.license; + data["source"] = this.source; + data["sourceURI"] = this.sourceURI; + data["approximateSize"] = this.approximateSize; + data["datasetSchemaVersion"] = this.datasetSchemaVersion; + data["redacted"] = this.redacted; + data["datasetVersion"] = this.datasetVersion; + return data; + } +} + +export interface IDatasetAbout { + datasetID?: string | undefined; + datasetName?: string | undefined; + description?: string | undefined; + citation?: string | undefined; + license?: string | undefined; + source?: string | undefined; + sourceURI?: string | undefined; + approximateSize?: string | undefined; + datasetSchemaVersion?: string | undefined; + redacted?: boolean | undefined; + datasetVersion?: string | undefined; +} + +export class Resource implements IResource { + resID?: string | undefined; + resPath?: string | undefined; + resType?: string | undefined; + resFormat?: string[] | undefined; + columns?: Column[] | undefined; + isCollection?: boolean | undefined; + + constructor(data?: IResource) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.resID = data["resID"]; + this.resPath = data["resPath"]; + this.resType = data["resType"]; + if (data["resFormat"] && data["resFormat"].constructor === Array) { + this.resFormat = []; + for (let item of data["resFormat"]) + this.resFormat.push(item); + } + if (data["columns"] && data["columns"].constructor === Array) { + this.columns = []; + for (let item of data["columns"]) + this.columns.push(Column.fromJS(item)); + } + this.isCollection = data["isCollection"]; + } + } + + static fromJS(data: any): Resource { + data = typeof data === 'object' ? data : {}; + let result = new Resource(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["resID"] = this.resID; + data["resPath"] = this.resPath; + data["resType"] = this.resType; + if (this.resFormat && this.resFormat.constructor === Array) { + data["resFormat"] = []; + for (let item of this.resFormat) + data["resFormat"].push(item); + } + if (this.columns && this.columns.constructor === Array) { + data["columns"] = []; + for (let item of this.columns) + data["columns"].push(item.toJSON()); + } + data["isCollection"] = this.isCollection; + return data; + } +} + +export interface IResource { + resID?: string | undefined; + resPath?: string | undefined; + resType?: string | undefined; + resFormat?: string[] | undefined; + columns?: Column[] | undefined; + isCollection?: boolean | undefined; +} + +export class Column implements IColumn { + colIndex?: number | undefined; + colDescription?: string | undefined; + colName?: string | undefined; + colType?: string | undefined; + role?: string[] | undefined; + refersTo?: Reference | undefined; + + constructor(data?: IColumn) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.colIndex = data["colIndex"]; + this.colDescription = data["colDescription"]; + this.colName = data["colName"]; + this.colType = data["colType"]; + if (data["role"] && data["role"].constructor === Array) { + this.role = []; + for (let item of data["role"]) + this.role.push(item); + } + this.refersTo = data["refersTo"] ? Reference.fromJS(data["refersTo"]) : undefined; + } + } + + static fromJS(data: any): Column { + data = typeof data === 'object' ? data : {}; + let result = new Column(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["colIndex"] = this.colIndex; + data["colDescription"] = this.colDescription; + data["colName"] = this.colName; + data["colType"] = this.colType; + if (this.role && this.role.constructor === Array) { + data["role"] = []; + for (let item of this.role) + data["role"].push(item); + } + data["refersTo"] = this.refersTo ? this.refersTo.toJSON() : undefined; + return data; + } +} + +export interface IColumn { + colIndex?: number | undefined; + colDescription?: string | undefined; + colName?: string | undefined; + colType?: string | undefined; + role?: string[] | undefined; + refersTo?: Reference | undefined; +} + +export class Reference implements IReference { + resID?: string | undefined; + + constructor(data?: IReference) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.resID = data["resID"]; + } + } + + static fromJS(data: any): Reference { + data = typeof data === 'object' ? data : {}; + let result = new Reference(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["resID"] = this.resID; + return data; + } +} + +export interface IReference { + resID?: string | undefined; +} + +export class ProblemFinderRows implements IProblemFinderRows { + label?: string | undefined; + type?: string | undefined; + features?: Feature[] | undefined; + + constructor(data?: IProblemFinderRows) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.label = data["label"]; + this.type = data["type"]; + if (data["features"] && data["features"].constructor === Array) { + this.features = []; + for (let item of data["features"]) + this.features.push(Feature.fromJS(item)); + } + } + } + + static fromJS(data: any): ProblemFinderRows { + data = typeof data === 'object' ? data : {}; + let result = new ProblemFinderRows(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["label"] = this.label; + data["type"] = this.type; + if (this.features && this.features.constructor === Array) { + data["features"] = []; + for (let item of this.features) + data["features"].push(item.toJSON()); + } + return data; + } +} + +export interface IProblemFinderRows { + label?: string | undefined; + type?: string | undefined; + features?: Feature[] | undefined; +} + +export class Feature implements IFeature { + name?: string | undefined; + selected?: boolean | undefined; + value?: number | undefined; + + constructor(data?: IFeature) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.name = data["name"]; + this.selected = data["selected"]; + this.value = data["value"]; + } + } + + static fromJS(data: any): Feature { + data = typeof data === 'object' ? data : {}; + let result = new Feature(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["name"] = this.name; + data["selected"] = this.selected; + data["value"] = this.value; + return data; + } +} + +export interface IFeature { + name?: string | undefined; + selected?: boolean | undefined; + value?: number | undefined; +} + +export enum DataType2 { + Int = 0, + String = 1, + Float = 2, + Double = 3, + DateTime = 4, + Object = 5, + Undefined = 6, +} + +export abstract class DataTypeExtensions implements IDataTypeExtensions { + + constructor(data?: IDataTypeExtensions) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + } + } + + static fromJS(data: any): DataTypeExtensions { + data = typeof data === 'object' ? data : {}; + throw new Error("The abstract class 'DataTypeExtensions' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + return data; + } +} + +export interface IDataTypeExtensions { +} + +export class ResObject implements IResObject { + columnName?: string | undefined; + + constructor(data?: IResObject) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.columnName = data["columnName"]; + } + } + + static fromJS(data: any): ResObject { + data = typeof data === 'object' ? data : {}; + let result = new ResObject(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["columnName"] = this.columnName; + return data; + } +} + +export interface IResObject { + columnName?: string | undefined; +} + +export class Exception implements IException { + message?: string | undefined; + innerException?: Exception | undefined; + stackTrace?: string | undefined; + source?: string | undefined; + + constructor(data?: IException) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.message = data["Message"]; + this.innerException = data["InnerException"] ? Exception.fromJS(data["InnerException"]) : undefined; + this.stackTrace = data["StackTrace"]; + this.source = data["Source"]; + } + } + + static fromJS(data: any): Exception { + data = typeof data === 'object' ? data : {}; + let result = new Exception(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Message"] = this.message; + data["InnerException"] = this.innerException ? this.innerException.toJSON() : undefined; + data["StackTrace"] = this.stackTrace; + data["Source"] = this.source; + return data; + } +} + +export interface IException { + message?: string | undefined; + innerException?: Exception | undefined; + stackTrace?: string | undefined; + source?: string | undefined; +} + +export class IDEAException extends Exception implements IIDEAException { + + constructor(data?: IIDEAException) { + super(data); + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): IDEAException { + data = typeof data === 'object' ? data : {}; + let result = new IDEAException(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface IIDEAException extends IException { +} + +export class CodeParameters implements ICodeParameters { + attributeCodeParameters?: AttributeCodeParameters[] | undefined; + adapterName?: string | undefined; + + constructor(data?: ICodeParameters) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + if (data["AttributeCodeParameters"] && data["AttributeCodeParameters"].constructor === Array) { + this.attributeCodeParameters = []; + for (let item of data["AttributeCodeParameters"]) + this.attributeCodeParameters.push(AttributeCodeParameters.fromJS(item)); + } + this.adapterName = data["AdapterName"]; + } + } + + static fromJS(data: any): CodeParameters { + data = typeof data === 'object' ? data : {}; + let result = new CodeParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.attributeCodeParameters && this.attributeCodeParameters.constructor === Array) { + data["AttributeCodeParameters"] = []; + for (let item of this.attributeCodeParameters) + data["AttributeCodeParameters"].push(item.toJSON()); + } + data["AdapterName"] = this.adapterName; + return data; + } +} + +export interface ICodeParameters { + attributeCodeParameters?: AttributeCodeParameters[] | undefined; + adapterName?: string | undefined; +} + +export class CompileResult implements ICompileResult { + compileSuccess?: boolean | undefined; + compileMessage?: string | undefined; + dataType?: DataType | undefined; + replaceAttributeParameters?: AttributeParameters[] | undefined; + + constructor(data?: ICompileResult) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.compileSuccess = data["CompileSuccess"]; + this.compileMessage = data["CompileMessage"]; + this.dataType = data["DataType"]; + if (data["ReplaceAttributeParameters"] && data["ReplaceAttributeParameters"].constructor === Array) { + this.replaceAttributeParameters = []; + for (let item of data["ReplaceAttributeParameters"]) + this.replaceAttributeParameters.push(AttributeParameters.fromJS(item)); + } + } + } + + static fromJS(data: any): CompileResult { + data = typeof data === 'object' ? data : {}; + let result = new CompileResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["CompileSuccess"] = this.compileSuccess; + data["CompileMessage"] = this.compileMessage; + data["DataType"] = this.dataType; + if (this.replaceAttributeParameters && this.replaceAttributeParameters.constructor === Array) { + data["ReplaceAttributeParameters"] = []; + for (let item of this.replaceAttributeParameters) + data["ReplaceAttributeParameters"].push(item.toJSON()); + } + return data; + } +} + +export interface ICompileResult { + compileSuccess?: boolean | undefined; + compileMessage?: string | undefined; + dataType?: DataType | undefined; + replaceAttributeParameters?: AttributeParameters[] | undefined; +} + +export class CompileResults implements ICompileResults { + rawNameToCompileResult?: { [key: string]: CompileResult; } | undefined; + + constructor(data?: ICompileResults) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + if (data["RawNameToCompileResult"]) { + this.rawNameToCompileResult = {}; + for (let key in data["RawNameToCompileResult"]) { + if (data["RawNameToCompileResult"].hasOwnProperty(key)) + this.rawNameToCompileResult[key] = data["RawNameToCompileResult"][key] ? CompileResult.fromJS(data["RawNameToCompileResult"][key]) : new CompileResult(); + } + } + } + } + + static fromJS(data: any): CompileResults { + data = typeof data === 'object' ? data : {}; + let result = new CompileResults(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.rawNameToCompileResult) { + data["RawNameToCompileResult"] = {}; + for (let key in this.rawNameToCompileResult) { + if (this.rawNameToCompileResult.hasOwnProperty(key)) + data["RawNameToCompileResult"][key] = this.rawNameToCompileResult[key]; + } + } + return data; + } +} + +export interface ICompileResults { + rawNameToCompileResult?: { [key: string]: CompileResult; } | undefined; +} + +export abstract class UniqueJson implements IUniqueJson { + + constructor(data?: IUniqueJson) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + } + } + + static fromJS(data: any): UniqueJson { + data = typeof data === 'object' ? data : {}; + throw new Error("The abstract class 'UniqueJson' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + return data; + } +} + +export interface IUniqueJson { +} + +export abstract class OperationParameters extends UniqueJson implements IOperationParameters { + isCachable?: boolean | undefined; + + protected _discriminator: string; + + constructor(data?: IOperationParameters) { + super(data); + this._discriminator = "OperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.isCachable = data["IsCachable"]; + } + } + + static fromJS(data: any): OperationParameters { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "DataOperationParameters") { + throw new Error("The abstract class 'DataOperationParameters' cannot be instantiated."); + } + if (data["discriminator"] === "ExampleOperationParameters") { + let result = new ExampleOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "HistogramOperationParameters") { + let result = new HistogramOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "DistOperationParameters") { + throw new Error("The abstract class 'DistOperationParameters' cannot be instantiated."); + } + if (data["discriminator"] === "OptimizerOperationParameters") { + let result = new OptimizerOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "RawDataOperationParameters") { + let result = new RawDataOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "RecommenderOperationParameters") { + let result = new RecommenderOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "CDFOperationParameters") { + let result = new CDFOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "TestDistOperationParameters") { + throw new Error("The abstract class 'TestDistOperationParameters' cannot be instantiated."); + } + if (data["discriminator"] === "ChiSquaredTestOperationParameters") { + let result = new ChiSquaredTestOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "HypothesisTestParameters") { + throw new Error("The abstract class 'HypothesisTestParameters' cannot be instantiated."); + } + if (data["discriminator"] === "CorrelationTestOperationParameters") { + let result = new CorrelationTestOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "EmpiricalDistOperationParameters") { + let result = new EmpiricalDistOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "KSTestOperationParameters") { + let result = new KSTestOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "NewModelOperationParameters") { + let result = new NewModelOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "ModelOperationParameters") { + throw new Error("The abstract class 'ModelOperationParameters' cannot be instantiated."); + } + if (data["discriminator"] === "RootMeanSquareTestOperationParameters") { + let result = new RootMeanSquareTestOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "TTestOperationParameters") { + let result = new TTestOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "FeatureImportanceOperationParameters") { + let result = new FeatureImportanceOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "SampleOperationParameters") { + let result = new SampleOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "AddComparisonParameters") { + let result = new AddComparisonParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "GetModelStateParameters") { + let result = new GetModelStateParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "FrequentItemsetOperationParameters") { + let result = new FrequentItemsetOperationParameters(); + result.init(data); + return result; + } + throw new Error("The abstract class 'OperationParameters' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["discriminator"] = this._discriminator; + data["IsCachable"] = this.isCachable; + super.toJSON(data); + return data; + } +} + +export interface IOperationParameters extends IUniqueJson { + isCachable?: boolean | undefined; +} + +export abstract class DataOperationParameters extends OperationParameters implements IDataOperationParameters { + sampleStreamBlockSize?: number | undefined; + adapterName?: string | undefined; + isCachable?: boolean | undefined; + + constructor(data?: IDataOperationParameters) { + super(data); + this._discriminator = "DataOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.sampleStreamBlockSize = data["SampleStreamBlockSize"]; + this.adapterName = data["AdapterName"]; + this.isCachable = data["IsCachable"]; + } + } + + static fromJS(data: any): DataOperationParameters { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "ExampleOperationParameters") { + let result = new ExampleOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "HistogramOperationParameters") { + let result = new HistogramOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "DistOperationParameters") { + throw new Error("The abstract class 'DistOperationParameters' cannot be instantiated."); + } + if (data["discriminator"] === "OptimizerOperationParameters") { + let result = new OptimizerOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "RawDataOperationParameters") { + let result = new RawDataOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "RecommenderOperationParameters") { + let result = new RecommenderOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "CDFOperationParameters") { + let result = new CDFOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "TestDistOperationParameters") { + throw new Error("The abstract class 'TestDistOperationParameters' cannot be instantiated."); + } + if (data["discriminator"] === "EmpiricalDistOperationParameters") { + let result = new EmpiricalDistOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "FeatureImportanceOperationParameters") { + let result = new FeatureImportanceOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "SampleOperationParameters") { + let result = new SampleOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "FrequentItemsetOperationParameters") { + let result = new FrequentItemsetOperationParameters(); + result.init(data); + return result; + } + throw new Error("The abstract class 'DataOperationParameters' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["SampleStreamBlockSize"] = this.sampleStreamBlockSize; + data["AdapterName"] = this.adapterName; + data["IsCachable"] = this.isCachable; + super.toJSON(data); + return data; + } +} + +export interface IDataOperationParameters extends IOperationParameters { + sampleStreamBlockSize?: number | undefined; + adapterName?: string | undefined; + isCachable?: boolean | undefined; +} + +export class ExampleOperationParameters extends DataOperationParameters implements IExampleOperationParameters { + filter?: string | undefined; + attributeParameters?: AttributeParameters[] | undefined; + attributeCodeParameters?: AttributeCaclculatedParameters[] | undefined; + dummyValue?: number | undefined; + exampleType?: string | undefined; + + constructor(data?: IExampleOperationParameters) { + super(data); + this._discriminator = "ExampleOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.filter = data["Filter"]; + if (data["AttributeParameters"] && data["AttributeParameters"].constructor === Array) { + this.attributeParameters = []; + for (let item of data["AttributeParameters"]) + this.attributeParameters.push(AttributeParameters.fromJS(item)); + } + if (data["AttributeCodeParameters"] && data["AttributeCodeParameters"].constructor === Array) { + this.attributeCodeParameters = []; + for (let item of data["AttributeCodeParameters"]) + this.attributeCodeParameters.push(AttributeCaclculatedParameters.fromJS(item)); + } + this.dummyValue = data["DummyValue"]; + this.exampleType = data["ExampleType"]; + } + } + + static fromJS(data: any): ExampleOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new ExampleOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Filter"] = this.filter; + if (this.attributeParameters && this.attributeParameters.constructor === Array) { + data["AttributeParameters"] = []; + for (let item of this.attributeParameters) + data["AttributeParameters"].push(item.toJSON()); + } + if (this.attributeCodeParameters && this.attributeCodeParameters.constructor === Array) { + data["AttributeCodeParameters"] = []; + for (let item of this.attributeCodeParameters) + data["AttributeCodeParameters"].push(item.toJSON()); + } + data["DummyValue"] = this.dummyValue; + data["ExampleType"] = this.exampleType; + super.toJSON(data); + return data; + } +} + +export interface IExampleOperationParameters extends IDataOperationParameters { + filter?: string | undefined; + attributeParameters?: AttributeParameters[] | undefined; + attributeCodeParameters?: AttributeCaclculatedParameters[] | undefined; + dummyValue?: number | undefined; + exampleType?: string | undefined; +} + +export abstract class DistOperationParameters extends DataOperationParameters implements IDistOperationParameters { + filter?: string | undefined; + attributeCalculatedParameters?: AttributeCaclculatedParameters[] | undefined; + + constructor(data?: IDistOperationParameters) { + super(data); + this._discriminator = "DistOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.filter = data["Filter"]; + if (data["AttributeCalculatedParameters"] && data["AttributeCalculatedParameters"].constructor === Array) { + this.attributeCalculatedParameters = []; + for (let item of data["AttributeCalculatedParameters"]) + this.attributeCalculatedParameters.push(AttributeCaclculatedParameters.fromJS(item)); + } + } + } + + static fromJS(data: any): DistOperationParameters { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "HistogramOperationParameters") { + let result = new HistogramOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "OptimizerOperationParameters") { + let result = new OptimizerOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "RawDataOperationParameters") { + let result = new RawDataOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "CDFOperationParameters") { + let result = new CDFOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "TestDistOperationParameters") { + throw new Error("The abstract class 'TestDistOperationParameters' cannot be instantiated."); + } + if (data["discriminator"] === "EmpiricalDistOperationParameters") { + let result = new EmpiricalDistOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "FeatureImportanceOperationParameters") { + let result = new FeatureImportanceOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "SampleOperationParameters") { + let result = new SampleOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "FrequentItemsetOperationParameters") { + let result = new FrequentItemsetOperationParameters(); + result.init(data); + return result; + } + throw new Error("The abstract class 'DistOperationParameters' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Filter"] = this.filter; + if (this.attributeCalculatedParameters && this.attributeCalculatedParameters.constructor === Array) { + data["AttributeCalculatedParameters"] = []; + for (let item of this.attributeCalculatedParameters) + data["AttributeCalculatedParameters"].push(item.toJSON()); + } + super.toJSON(data); + return data; + } +} + +export interface IDistOperationParameters extends IDataOperationParameters { + filter?: string | undefined; + attributeCalculatedParameters?: AttributeCaclculatedParameters[] | undefined; +} + +export class HistogramOperationParameters extends DistOperationParameters implements IHistogramOperationParameters { + sortPerBinAggregateParameter?: AggregateParameters | undefined; + binningParameters?: BinningParameters[] | undefined; + perBinAggregateParameters?: AggregateParameters[] | undefined; + globalAggregateParameters?: AggregateParameters[] | undefined; + brushes?: string[] | undefined; + enableBrushComputation?: boolean | undefined; + degreeOfParallism?: number | undefined; + + constructor(data?: IHistogramOperationParameters) { + super(data); + this._discriminator = "HistogramOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.sortPerBinAggregateParameter = data["SortPerBinAggregateParameter"] ? AggregateParameters.fromJS(data["SortPerBinAggregateParameter"]) : undefined; + if (data["BinningParameters"] && data["BinningParameters"].constructor === Array) { + this.binningParameters = []; + for (let item of data["BinningParameters"]) + this.binningParameters.push(BinningParameters.fromJS(item)); + } + if (data["PerBinAggregateParameters"] && data["PerBinAggregateParameters"].constructor === Array) { + this.perBinAggregateParameters = []; + for (let item of data["PerBinAggregateParameters"]) + this.perBinAggregateParameters.push(AggregateParameters.fromJS(item)); + } + if (data["GlobalAggregateParameters"] && data["GlobalAggregateParameters"].constructor === Array) { + this.globalAggregateParameters = []; + for (let item of data["GlobalAggregateParameters"]) + this.globalAggregateParameters.push(AggregateParameters.fromJS(item)); + } + if (data["Brushes"] && data["Brushes"].constructor === Array) { + this.brushes = []; + for (let item of data["Brushes"]) + this.brushes.push(item); + } + this.enableBrushComputation = data["EnableBrushComputation"]; + this.degreeOfParallism = data["DegreeOfParallism"]; + } + } + + static fromJS(data: any): HistogramOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new HistogramOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["SortPerBinAggregateParameter"] = this.sortPerBinAggregateParameter ? this.sortPerBinAggregateParameter.toJSON() : undefined; + if (this.binningParameters && this.binningParameters.constructor === Array) { + data["BinningParameters"] = []; + for (let item of this.binningParameters) + data["BinningParameters"].push(item.toJSON()); + } + if (this.perBinAggregateParameters && this.perBinAggregateParameters.constructor === Array) { + data["PerBinAggregateParameters"] = []; + for (let item of this.perBinAggregateParameters) + data["PerBinAggregateParameters"].push(item.toJSON()); + } + if (this.globalAggregateParameters && this.globalAggregateParameters.constructor === Array) { + data["GlobalAggregateParameters"] = []; + for (let item of this.globalAggregateParameters) + data["GlobalAggregateParameters"].push(item.toJSON()); + } + if (this.brushes && this.brushes.constructor === Array) { + data["Brushes"] = []; + for (let item of this.brushes) + data["Brushes"].push(item); + } + data["EnableBrushComputation"] = this.enableBrushComputation; + data["DegreeOfParallism"] = this.degreeOfParallism; + super.toJSON(data); + return data; + } +} + +export interface IHistogramOperationParameters extends IDistOperationParameters { + sortPerBinAggregateParameter?: AggregateParameters | undefined; + binningParameters?: BinningParameters[] | undefined; + perBinAggregateParameters?: AggregateParameters[] | undefined; + globalAggregateParameters?: AggregateParameters[] | undefined; + brushes?: string[] | undefined; + enableBrushComputation?: boolean | undefined; + degreeOfParallism?: number | undefined; +} + +export class OptimizerOperationParameters extends DistOperationParameters implements IOptimizerOperationParameters { + taskType?: TaskType | undefined; + taskSubType?: TaskSubType | undefined; + metricType?: MetricType | undefined; + labelAttribute?: AttributeParameters | undefined; + featureAttributes?: AttributeParameters[] | undefined; + requiredPrimitives?: string[] | undefined; + pythonFilter?: string | undefined; + trainFilter?: string | undefined; + pythonTrainFilter?: string | undefined; + testFilter?: string | undefined; + pythonTestFilter?: string | undefined; + + constructor(data?: IOptimizerOperationParameters) { + super(data); + this._discriminator = "OptimizerOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.taskType = data["TaskType"]; + this.taskSubType = data["TaskSubType"]; + this.metricType = data["MetricType"]; + this.labelAttribute = data["LabelAttribute"] ? AttributeParameters.fromJS(data["LabelAttribute"]) : undefined; + if (data["FeatureAttributes"] && data["FeatureAttributes"].constructor === Array) { + this.featureAttributes = []; + for (let item of data["FeatureAttributes"]) + this.featureAttributes.push(AttributeParameters.fromJS(item)); + } + if (data["RequiredPrimitives"] && data["RequiredPrimitives"].constructor === Array) { + this.requiredPrimitives = []; + for (let item of data["RequiredPrimitives"]) + this.requiredPrimitives.push(item); + } + this.pythonFilter = data["PythonFilter"]; + this.trainFilter = data["TrainFilter"]; + this.pythonTrainFilter = data["PythonTrainFilter"]; + this.testFilter = data["TestFilter"]; + this.pythonTestFilter = data["PythonTestFilter"]; + } + } + + static fromJS(data: any): OptimizerOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new OptimizerOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["TaskType"] = this.taskType; + data["TaskSubType"] = this.taskSubType; + data["MetricType"] = this.metricType; + data["LabelAttribute"] = this.labelAttribute ? this.labelAttribute.toJSON() : undefined; + if (this.featureAttributes && this.featureAttributes.constructor === Array) { + data["FeatureAttributes"] = []; + for (let item of this.featureAttributes) + data["FeatureAttributes"].push(item.toJSON()); + } + if (this.requiredPrimitives && this.requiredPrimitives.constructor === Array) { + data["RequiredPrimitives"] = []; + for (let item of this.requiredPrimitives) + data["RequiredPrimitives"].push(item); + } + data["PythonFilter"] = this.pythonFilter; + data["TrainFilter"] = this.trainFilter; + data["PythonTrainFilter"] = this.pythonTrainFilter; + data["TestFilter"] = this.testFilter; + data["PythonTestFilter"] = this.pythonTestFilter; + super.toJSON(data); + return data; + } +} + +export interface IOptimizerOperationParameters extends IDistOperationParameters { + taskType?: TaskType | undefined; + taskSubType?: TaskSubType | undefined; + metricType?: MetricType | undefined; + labelAttribute?: AttributeParameters | undefined; + featureAttributes?: AttributeParameters[] | undefined; + requiredPrimitives?: string[] | undefined; + pythonFilter?: string | undefined; + trainFilter?: string | undefined; + pythonTrainFilter?: string | undefined; + testFilter?: string | undefined; + pythonTestFilter?: string | undefined; +} + +export enum TaskType { + Undefined = 0, + Classification = 1, + Regression = 2, + Clustering = 3, + LinkPrediction = 4, + VertexNomination = 5, + CommunityDetection = 6, + GraphClustering = 7, + GraphMatching = 8, + TimeSeriesForecasting = 9, + CollaborativeFiltering = 10, +} + +export enum TaskSubType { + Undefined = 0, + None = 1, + Binary = 2, + Multiclass = 3, + Multilabel = 4, + Univariate = 5, + Multivariate = 6, + Overlapping = 7, + Nonoverlapping = 8, +} + +export enum MetricType { + MetricUndefined = 0, + Accuracy = 1, + Precision = 2, + Recall = 3, + F1 = 4, + F1Micro = 5, + F1Macro = 6, + RocAuc = 7, + RocAucMicro = 8, + RocAucMacro = 9, + MeanSquaredError = 10, + RootMeanSquaredError = 11, + RootMeanSquaredErrorAvg = 12, + MeanAbsoluteError = 13, + RSquared = 14, + NormalizedMutualInformation = 15, + JaccardSimilarityScore = 16, + PrecisionAtTopK = 17, + ObjectDetectionAveragePrecision = 18, + Loss = 100, +} + +export class RawDataOperationParameters extends DistOperationParameters implements IRawDataOperationParameters { + sortUpRawName?: string | undefined; + sortDownRawName?: string | undefined; + numRecords?: number | undefined; + binningParameters?: BinningParameters[] | undefined; + brushes?: string[] | undefined; + enableBrushComputation?: boolean | undefined; + + constructor(data?: IRawDataOperationParameters) { + super(data); + this._discriminator = "RawDataOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.sortUpRawName = data["SortUpRawName"]; + this.sortDownRawName = data["SortDownRawName"]; + this.numRecords = data["NumRecords"]; + if (data["BinningParameters"] && data["BinningParameters"].constructor === Array) { + this.binningParameters = []; + for (let item of data["BinningParameters"]) + this.binningParameters.push(BinningParameters.fromJS(item)); + } + if (data["Brushes"] && data["Brushes"].constructor === Array) { + this.brushes = []; + for (let item of data["Brushes"]) + this.brushes.push(item); + } + this.enableBrushComputation = data["EnableBrushComputation"]; + } + } + + static fromJS(data: any): RawDataOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new RawDataOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["SortUpRawName"] = this.sortUpRawName; + data["SortDownRawName"] = this.sortDownRawName; + data["NumRecords"] = this.numRecords; + if (this.binningParameters && this.binningParameters.constructor === Array) { + data["BinningParameters"] = []; + for (let item of this.binningParameters) + data["BinningParameters"].push(item.toJSON()); + } + if (this.brushes && this.brushes.constructor === Array) { + data["Brushes"] = []; + for (let item of this.brushes) + data["Brushes"].push(item); + } + data["EnableBrushComputation"] = this.enableBrushComputation; + super.toJSON(data); + return data; + } +} + +export interface IRawDataOperationParameters extends IDistOperationParameters { + sortUpRawName?: string | undefined; + sortDownRawName?: string | undefined; + numRecords?: number | undefined; + binningParameters?: BinningParameters[] | undefined; + brushes?: string[] | undefined; + enableBrushComputation?: boolean | undefined; +} + +export class RecommenderOperationParameters extends DataOperationParameters implements IRecommenderOperationParameters { + target?: HistogramOperationParameters | undefined; + budget?: number | undefined; + modelId?: ModelId | undefined; + includeAttributeParameters?: AttributeParameters[] | undefined; + excludeAttributeParameters?: AttributeParameters[] | undefined; + riskControlType?: RiskControlType | undefined; + + constructor(data?: IRecommenderOperationParameters) { + super(data); + this._discriminator = "RecommenderOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.target = data["Target"] ? HistogramOperationParameters.fromJS(data["Target"]) : undefined; + this.budget = data["Budget"]; + this.modelId = data["ModelId"] ? ModelId.fromJS(data["ModelId"]) : undefined; + if (data["IncludeAttributeParameters"] && data["IncludeAttributeParameters"].constructor === Array) { + this.includeAttributeParameters = []; + for (let item of data["IncludeAttributeParameters"]) + this.includeAttributeParameters.push(AttributeParameters.fromJS(item)); + } + if (data["ExcludeAttributeParameters"] && data["ExcludeAttributeParameters"].constructor === Array) { + this.excludeAttributeParameters = []; + for (let item of data["ExcludeAttributeParameters"]) + this.excludeAttributeParameters.push(AttributeParameters.fromJS(item)); + } + this.riskControlType = data["RiskControlType"]; + } + } + + static fromJS(data: any): RecommenderOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new RecommenderOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Target"] = this.target ? this.target.toJSON() : undefined; + data["Budget"] = this.budget; + data["ModelId"] = this.modelId ? this.modelId.toJSON() : undefined; + if (this.includeAttributeParameters && this.includeAttributeParameters.constructor === Array) { + data["IncludeAttributeParameters"] = []; + for (let item of this.includeAttributeParameters) + data["IncludeAttributeParameters"].push(item.toJSON()); + } + if (this.excludeAttributeParameters && this.excludeAttributeParameters.constructor === Array) { + data["ExcludeAttributeParameters"] = []; + for (let item of this.excludeAttributeParameters) + data["ExcludeAttributeParameters"].push(item.toJSON()); + } + data["RiskControlType"] = this.riskControlType; + super.toJSON(data); + return data; + } +} + +export interface IRecommenderOperationParameters extends IDataOperationParameters { + target?: HistogramOperationParameters | undefined; + budget?: number | undefined; + modelId?: ModelId | undefined; + includeAttributeParameters?: AttributeParameters[] | undefined; + excludeAttributeParameters?: AttributeParameters[] | undefined; + riskControlType?: RiskControlType | undefined; +} + +export class ModelId implements IModelId { + value?: string | undefined; + + constructor(data?: IModelId) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.value = data["Value"]; + } + } + + static fromJS(data: any): ModelId { + data = typeof data === 'object' ? data : {}; + let result = new ModelId(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Value"] = this.value; + return data; + } +} + +export interface IModelId { + value?: string | undefined; +} + +export enum RiskControlType { + PCER = 0, + Bonferroni = 1, + AdaBonferroni = 2, + HolmBonferroni = 3, + BHFDR = 4, + SeqFDR = 5, + AlphaFDR = 6, + BestFootForward = 7, + BetaFarsighted = 8, + BetaFarsightedWithSupport = 9, + GammaFixed = 10, + DeltaHopeful = 11, + EpsilonHybrid = 12, + EpsilonHybridWithoutSupport = 13, + PsiSupport = 14, + ZetaDynamic = 15, + Unknown = 16, +} + +export abstract class TestDistOperationParameters extends DistOperationParameters implements ITestDistOperationParameters { + attributeParameters?: AttributeParameters[] | undefined; + + constructor(data?: ITestDistOperationParameters) { + super(data); + this._discriminator = "TestDistOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["AttributeParameters"] && data["AttributeParameters"].constructor === Array) { + this.attributeParameters = []; + for (let item of data["AttributeParameters"]) + this.attributeParameters.push(AttributeParameters.fromJS(item)); + } + } + } + + static fromJS(data: any): TestDistOperationParameters { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "CDFOperationParameters") { + let result = new CDFOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "EmpiricalDistOperationParameters") { + let result = new EmpiricalDistOperationParameters(); + result.init(data); + return result; + } + throw new Error("The abstract class 'TestDistOperationParameters' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.attributeParameters && this.attributeParameters.constructor === Array) { + data["AttributeParameters"] = []; + for (let item of this.attributeParameters) + data["AttributeParameters"].push(item.toJSON()); + } + super.toJSON(data); + return data; + } +} + +export interface ITestDistOperationParameters extends IDistOperationParameters { + attributeParameters?: AttributeParameters[] | undefined; +} + +export class CDFOperationParameters extends TestDistOperationParameters implements ICDFOperationParameters { + + constructor(data?: ICDFOperationParameters) { + super(data); + this._discriminator = "CDFOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): CDFOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new CDFOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface ICDFOperationParameters extends ITestDistOperationParameters { +} + +export abstract class HypothesisTestParameters extends OperationParameters implements IHypothesisTestParameters { + childOperationParameters?: OperationParameters[] | undefined; + isCachable?: boolean | undefined; + + constructor(data?: IHypothesisTestParameters) { + super(data); + this._discriminator = "HypothesisTestParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["ChildOperationParameters"] && data["ChildOperationParameters"].constructor === Array) { + this.childOperationParameters = []; + for (let item of data["ChildOperationParameters"]) + this.childOperationParameters.push(OperationParameters.fromJS(item)); + } + this.isCachable = data["IsCachable"]; + } + } + + static fromJS(data: any): HypothesisTestParameters { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "ChiSquaredTestOperationParameters") { + let result = new ChiSquaredTestOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "CorrelationTestOperationParameters") { + let result = new CorrelationTestOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "KSTestOperationParameters") { + let result = new KSTestOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "RootMeanSquareTestOperationParameters") { + let result = new RootMeanSquareTestOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "TTestOperationParameters") { + let result = new TTestOperationParameters(); + result.init(data); + return result; + } + throw new Error("The abstract class 'HypothesisTestParameters' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.childOperationParameters && this.childOperationParameters.constructor === Array) { + data["ChildOperationParameters"] = []; + for (let item of this.childOperationParameters) + data["ChildOperationParameters"].push(item.toJSON()); + } + data["IsCachable"] = this.isCachable; + super.toJSON(data); + return data; + } +} + +export interface IHypothesisTestParameters extends IOperationParameters { + childOperationParameters?: OperationParameters[] | undefined; + isCachable?: boolean | undefined; +} + +export class ChiSquaredTestOperationParameters extends HypothesisTestParameters implements IChiSquaredTestOperationParameters { + + constructor(data?: IChiSquaredTestOperationParameters) { + super(data); + this._discriminator = "ChiSquaredTestOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): ChiSquaredTestOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new ChiSquaredTestOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface IChiSquaredTestOperationParameters extends IHypothesisTestParameters { +} + +export class CorrelationTestOperationParameters extends HypothesisTestParameters implements ICorrelationTestOperationParameters { + + constructor(data?: ICorrelationTestOperationParameters) { + super(data); + this._discriminator = "CorrelationTestOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): CorrelationTestOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new CorrelationTestOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface ICorrelationTestOperationParameters extends IHypothesisTestParameters { +} + +export class SubmitProblemParameters implements ISubmitProblemParameters { + id?: string | undefined; + + constructor(data?: ISubmitProblemParameters) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.id = data["Id"]; + } + } + + static fromJS(data: any): SubmitProblemParameters { + data = typeof data === 'object' ? data : {}; + let result = new SubmitProblemParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Id"] = this.id; + return data; + } +} + +export interface ISubmitProblemParameters { + id?: string | undefined; +} + +export class SpecifyProblemParameters implements ISpecifyProblemParameters { + id?: string | undefined; + userComment?: string | undefined; + optimizerOperationParameters?: OptimizerOperationParameters | undefined; + + constructor(data?: ISpecifyProblemParameters) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.id = data["Id"]; + this.userComment = data["UserComment"]; + this.optimizerOperationParameters = data["OptimizerOperationParameters"] ? OptimizerOperationParameters.fromJS(data["OptimizerOperationParameters"]) : undefined; + } + } + + static fromJS(data: any): SpecifyProblemParameters { + data = typeof data === 'object' ? data : {}; + let result = new SpecifyProblemParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Id"] = this.id; + data["UserComment"] = this.userComment; + data["OptimizerOperationParameters"] = this.optimizerOperationParameters ? this.optimizerOperationParameters.toJSON() : undefined; + return data; + } +} + +export interface ISpecifyProblemParameters { + id?: string | undefined; + userComment?: string | undefined; + optimizerOperationParameters?: OptimizerOperationParameters | undefined; +} + +export class EmpiricalDistOperationParameters extends TestDistOperationParameters implements IEmpiricalDistOperationParameters { + keepSamples?: boolean | undefined; + + constructor(data?: IEmpiricalDistOperationParameters) { + super(data); + this._discriminator = "EmpiricalDistOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.keepSamples = data["KeepSamples"]; + } + } + + static fromJS(data: any): EmpiricalDistOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new EmpiricalDistOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["KeepSamples"] = this.keepSamples; + super.toJSON(data); + return data; + } +} + +export interface IEmpiricalDistOperationParameters extends ITestDistOperationParameters { + keepSamples?: boolean | undefined; +} + +export class KSTestOperationParameters extends HypothesisTestParameters implements IKSTestOperationParameters { + + constructor(data?: IKSTestOperationParameters) { + super(data); + this._discriminator = "KSTestOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): KSTestOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new KSTestOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface IKSTestOperationParameters extends IHypothesisTestParameters { +} + +export abstract class ModelOperationParameters extends OperationParameters implements IModelOperationParameters { + + constructor(data?: IModelOperationParameters) { + super(data); + this._discriminator = "ModelOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): ModelOperationParameters { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "NewModelOperationParameters") { + let result = new NewModelOperationParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "AddComparisonParameters") { + let result = new AddComparisonParameters(); + result.init(data); + return result; + } + if (data["discriminator"] === "GetModelStateParameters") { + let result = new GetModelStateParameters(); + result.init(data); + return result; + } + throw new Error("The abstract class 'ModelOperationParameters' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface IModelOperationParameters extends IOperationParameters { +} + +export class NewModelOperationParameters extends ModelOperationParameters implements INewModelOperationParameters { + riskControlTypes?: RiskControlType[] | undefined; + alpha?: number | undefined; + alphaInvestParameter?: AlphaInvestParameter | undefined; + + constructor(data?: INewModelOperationParameters) { + super(data); + this._discriminator = "NewModelOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["RiskControlTypes"] && data["RiskControlTypes"].constructor === Array) { + this.riskControlTypes = []; + for (let item of data["RiskControlTypes"]) + this.riskControlTypes.push(item); + } + this.alpha = data["Alpha"]; + this.alphaInvestParameter = data["AlphaInvestParameter"] ? AlphaInvestParameter.fromJS(data["AlphaInvestParameter"]) : undefined; + } + } + + static fromJS(data: any): NewModelOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new NewModelOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.riskControlTypes && this.riskControlTypes.constructor === Array) { + data["RiskControlTypes"] = []; + for (let item of this.riskControlTypes) + data["RiskControlTypes"].push(item); + } + data["Alpha"] = this.alpha; + data["AlphaInvestParameter"] = this.alphaInvestParameter ? this.alphaInvestParameter.toJSON() : undefined; + super.toJSON(data); + return data; + } +} + +export interface INewModelOperationParameters extends IModelOperationParameters { + riskControlTypes?: RiskControlType[] | undefined; + alpha?: number | undefined; + alphaInvestParameter?: AlphaInvestParameter | undefined; +} + +export class AlphaInvestParameter extends UniqueJson implements IAlphaInvestParameter { + beta?: number | undefined; + gamma?: number | undefined; + delta?: number | undefined; + epsilon?: number | undefined; + windowSize?: number | undefined; + psi?: number | undefined; + + constructor(data?: IAlphaInvestParameter) { + super(data); + } + + init(data?: any) { + super.init(data); + if (data) { + this.beta = data["Beta"]; + this.gamma = data["Gamma"]; + this.delta = data["Delta"]; + this.epsilon = data["Epsilon"]; + this.windowSize = data["WindowSize"]; + this.psi = data["Psi"]; + } + } + + static fromJS(data: any): AlphaInvestParameter { + data = typeof data === 'object' ? data : {}; + let result = new AlphaInvestParameter(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Beta"] = this.beta; + data["Gamma"] = this.gamma; + data["Delta"] = this.delta; + data["Epsilon"] = this.epsilon; + data["WindowSize"] = this.windowSize; + data["Psi"] = this.psi; + super.toJSON(data); + return data; + } +} + +export interface IAlphaInvestParameter extends IUniqueJson { + beta?: number | undefined; + gamma?: number | undefined; + delta?: number | undefined; + epsilon?: number | undefined; + windowSize?: number | undefined; + psi?: number | undefined; +} + +export class RootMeanSquareTestOperationParameters extends HypothesisTestParameters implements IRootMeanSquareTestOperationParameters { + seeded?: boolean | undefined; + pValueConvergenceThreshold?: number | undefined; + maxSimulationBatchCount?: number | undefined; + perBatchSimulationCount?: number | undefined; + + constructor(data?: IRootMeanSquareTestOperationParameters) { + super(data); + this._discriminator = "RootMeanSquareTestOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.seeded = data["Seeded"]; + this.pValueConvergenceThreshold = data["PValueConvergenceThreshold"]; + this.maxSimulationBatchCount = data["MaxSimulationBatchCount"]; + this.perBatchSimulationCount = data["PerBatchSimulationCount"]; + } + } + + static fromJS(data: any): RootMeanSquareTestOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new RootMeanSquareTestOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Seeded"] = this.seeded; + data["PValueConvergenceThreshold"] = this.pValueConvergenceThreshold; + data["MaxSimulationBatchCount"] = this.maxSimulationBatchCount; + data["PerBatchSimulationCount"] = this.perBatchSimulationCount; + super.toJSON(data); + return data; + } +} + +export interface IRootMeanSquareTestOperationParameters extends IHypothesisTestParameters { + seeded?: boolean | undefined; + pValueConvergenceThreshold?: number | undefined; + maxSimulationBatchCount?: number | undefined; + perBatchSimulationCount?: number | undefined; +} + +export class TTestOperationParameters extends HypothesisTestParameters implements ITTestOperationParameters { + + constructor(data?: ITTestOperationParameters) { + super(data); + this._discriminator = "TTestOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): TTestOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new TTestOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface ITTestOperationParameters extends IHypothesisTestParameters { +} + +export enum EffectSize { + Small = 1, + Meduim = 2, + Large = 4, +} + +export abstract class Result extends UniqueJson implements IResult { + progress?: number | undefined; + + protected _discriminator: string; + + constructor(data?: IResult) { + super(data); + this._discriminator = "Result"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.progress = data["Progress"]; + } + } + + static fromJS(data: any): Result { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "ErrorResult") { + let result = new ErrorResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "HistogramResult") { + let result = new HistogramResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "DistResult") { + throw new Error("The abstract class 'DistResult' cannot be instantiated."); + } + if (data["discriminator"] === "ModelWealthResult") { + let result = new ModelWealthResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "HypothesisTestResult") { + throw new Error("The abstract class 'HypothesisTestResult' cannot be instantiated."); + } + if (data["discriminator"] === "ModelOperationResult") { + throw new Error("The abstract class 'ModelOperationResult' cannot be instantiated."); + } + if (data["discriminator"] === "RecommenderResult") { + let result = new RecommenderResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "Decision") { + let result = new Decision(); + result.init(data); + return result; + } + if (data["discriminator"] === "OptimizerResult") { + let result = new OptimizerResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "ExampleResult") { + let result = new ExampleResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "NewModelOperationResult") { + let result = new NewModelOperationResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "AddComparisonResult") { + let result = new AddComparisonResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "GetModelStateResult") { + let result = new GetModelStateResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "FeatureImportanceResult") { + let result = new FeatureImportanceResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "RawDataResult") { + let result = new RawDataResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "SampleResult") { + let result = new SampleResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "CDFResult") { + let result = new CDFResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "ChiSquaredTestResult") { + let result = new ChiSquaredTestResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "CorrelationTestResult") { + let result = new CorrelationTestResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "EmpiricalDistResult") { + let result = new EmpiricalDistResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "KSTestResult") { + let result = new KSTestResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "RootMeanSquareTestResult") { + let result = new RootMeanSquareTestResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "TTestResult") { + let result = new TTestResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "FrequentItemsetResult") { + let result = new FrequentItemsetResult(); + result.init(data); + return result; + } + throw new Error("The abstract class 'Result' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["discriminator"] = this._discriminator; + data["Progress"] = this.progress; + super.toJSON(data); + return data; + } +} + +export interface IResult extends IUniqueJson { + progress?: number | undefined; +} + +export class ErrorResult extends Result implements IErrorResult { + message?: string | undefined; + + constructor(data?: IErrorResult) { + super(data); + this._discriminator = "ErrorResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.message = data["Message"]; + } + } + + static fromJS(data: any): ErrorResult { + data = typeof data === 'object' ? data : {}; + let result = new ErrorResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Message"] = this.message; + super.toJSON(data); + return data; + } +} + +export interface IErrorResult extends IResult { + message?: string | undefined; +} + +export abstract class DistResult extends Result implements IDistResult { + sampleSize?: number | undefined; + populationSize?: number | undefined; + + constructor(data?: IDistResult) { + super(data); + this._discriminator = "DistResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.sampleSize = data["SampleSize"]; + this.populationSize = data["PopulationSize"]; + } + } + + static fromJS(data: any): DistResult { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "HistogramResult") { + let result = new HistogramResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "RawDataResult") { + let result = new RawDataResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "SampleResult") { + let result = new SampleResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "CDFResult") { + let result = new CDFResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "EmpiricalDistResult") { + let result = new EmpiricalDistResult(); + result.init(data); + return result; + } + throw new Error("The abstract class 'DistResult' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["SampleSize"] = this.sampleSize; + data["PopulationSize"] = this.populationSize; + super.toJSON(data); + return data; + } +} + +export interface IDistResult extends IResult { + sampleSize?: number | undefined; + populationSize?: number | undefined; +} + +export class HistogramResult extends DistResult implements IHistogramResult { + aggregateResults?: AggregateResult[][] | undefined; + isEmpty?: boolean | undefined; + brushes?: Brush[] | undefined; + binRanges?: BinRange[] | undefined; + aggregateParameters?: AggregateParameters[] | undefined; + nullValueCount?: number | undefined; + bins?: { [key: string]: Bin; } | undefined; + + constructor(data?: IHistogramResult) { + super(data); + this._discriminator = "HistogramResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["AggregateResults"] && data["AggregateResults"].constructor === Array) { + this.aggregateResults = []; + for (let item of data["AggregateResults"]) + this.aggregateResults.push(item); + } + this.isEmpty = data["IsEmpty"]; + if (data["Brushes"] && data["Brushes"].constructor === Array) { + this.brushes = []; + for (let item of data["Brushes"]) + this.brushes.push(Brush.fromJS(item)); + } + if (data["BinRanges"] && data["BinRanges"].constructor === Array) { + this.binRanges = []; + for (let item of data["BinRanges"]) + this.binRanges.push(BinRange.fromJS(item)); + } + if (data["AggregateParameters"] && data["AggregateParameters"].constructor === Array) { + this.aggregateParameters = []; + for (let item of data["AggregateParameters"]) + this.aggregateParameters.push(AggregateParameters.fromJS(item)); + } + this.nullValueCount = data["NullValueCount"]; + if (data["Bins"]) { + this.bins = {}; + for (let key in data["Bins"]) { + if (data["Bins"].hasOwnProperty(key)) + this.bins[key] = data["Bins"][key] ? Bin.fromJS(data["Bins"][key]) : new Bin(); + } + } + } + } + + static fromJS(data: any): HistogramResult { + data = typeof data === 'object' ? data : {}; + let result = new HistogramResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.aggregateResults && this.aggregateResults.constructor === Array) { + data["AggregateResults"] = []; + for (let item of this.aggregateResults) + data["AggregateResults"].push(item); + } + data["IsEmpty"] = this.isEmpty; + if (this.brushes && this.brushes.constructor === Array) { + data["Brushes"] = []; + for (let item of this.brushes) + data["Brushes"].push(item.toJSON()); + } + if (this.binRanges && this.binRanges.constructor === Array) { + data["BinRanges"] = []; + for (let item of this.binRanges) + data["BinRanges"].push(item.toJSON()); + } + if (this.aggregateParameters && this.aggregateParameters.constructor === Array) { + data["AggregateParameters"] = []; + for (let item of this.aggregateParameters) + data["AggregateParameters"].push(item.toJSON()); + } + data["NullValueCount"] = this.nullValueCount; + if (this.bins) { + data["Bins"] = {}; + for (let key in this.bins) { + if (this.bins.hasOwnProperty(key)) + data["Bins"][key] = this.bins[key]; + } + } + super.toJSON(data); + return data; + } +} + +export interface IHistogramResult extends IDistResult { + aggregateResults?: AggregateResult[][] | undefined; + isEmpty?: boolean | undefined; + brushes?: Brush[] | undefined; + binRanges?: BinRange[] | undefined; + aggregateParameters?: AggregateParameters[] | undefined; + nullValueCount?: number | undefined; + bins?: { [key: string]: Bin; } | undefined; +} + +export abstract class AggregateResult implements IAggregateResult { + hasResult?: boolean | undefined; + n?: number | undefined; + + protected _discriminator: string; + + constructor(data?: IAggregateResult) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + this._discriminator = "AggregateResult"; + } + + init(data?: any) { + if (data) { + this.hasResult = data["HasResult"]; + this.n = data["N"]; + } + } + + static fromJS(data: any): AggregateResult | undefined { + if (data === null || data === undefined) { + return undefined; + } + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "MarginAggregateResult") { + let result = new MarginAggregateResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "DoubleValueAggregateResult") { + let result = new DoubleValueAggregateResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "PointsAggregateResult") { + let result = new PointsAggregateResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "SumEstimationAggregateResult") { + let result = new SumEstimationAggregateResult(); + result.init(data); + return result; + } + throw new Error("The abstract class 'AggregateResult' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["discriminator"] = this._discriminator; + data["HasResult"] = this.hasResult; + data["N"] = this.n; + return data; + } +} + +export interface IAggregateResult { + hasResult?: boolean | undefined; + n?: number | undefined; +} + +export class MarginAggregateResult extends AggregateResult implements IMarginAggregateResult { + margin?: number | undefined; + absolutMargin?: number | undefined; + sumOfSquare?: number | undefined; + sampleStandardDeviation?: number | undefined; + mean?: number | undefined; + ex?: number | undefined; + ex2?: number | undefined; + variance?: number | undefined; + + constructor(data?: IMarginAggregateResult) { + super(data); + this._discriminator = "MarginAggregateResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.margin = data["Margin"]; + this.absolutMargin = data["AbsolutMargin"]; + this.sumOfSquare = data["SumOfSquare"]; + this.sampleStandardDeviation = data["SampleStandardDeviation"]; + this.mean = data["Mean"]; + this.ex = data["Ex"]; + this.ex2 = data["Ex2"]; + this.variance = data["Variance"]; + } + } + + static fromJS(data: any): MarginAggregateResult { + data = typeof data === 'object' ? data : {}; + let result = new MarginAggregateResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Margin"] = this.margin; + data["AbsolutMargin"] = this.absolutMargin; + data["SumOfSquare"] = this.sumOfSquare; + data["SampleStandardDeviation"] = this.sampleStandardDeviation; + data["Mean"] = this.mean; + data["Ex"] = this.ex; + data["Ex2"] = this.ex2; + data["Variance"] = this.variance; + super.toJSON(data); + return data; + } +} + +export interface IMarginAggregateResult extends IAggregateResult { + margin?: number | undefined; + absolutMargin?: number | undefined; + sumOfSquare?: number | undefined; + sampleStandardDeviation?: number | undefined; + mean?: number | undefined; + ex?: number | undefined; + ex2?: number | undefined; + variance?: number | undefined; +} + +export class DoubleValueAggregateResult extends AggregateResult implements IDoubleValueAggregateResult { + result?: number | undefined; + temporaryResult?: number | undefined; + + constructor(data?: IDoubleValueAggregateResult) { + super(data); + this._discriminator = "DoubleValueAggregateResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.result = data["Result"]; + this.temporaryResult = data["TemporaryResult"]; + } + } + + static fromJS(data: any): DoubleValueAggregateResult { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "SumEstimationAggregateResult") { + let result = new SumEstimationAggregateResult(); + result.init(data); + return result; + } + let result = new DoubleValueAggregateResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Result"] = this.result; + data["TemporaryResult"] = this.temporaryResult; + super.toJSON(data); + return data; + } +} + +export interface IDoubleValueAggregateResult extends IAggregateResult { + result?: number | undefined; + temporaryResult?: number | undefined; +} + +export class PointsAggregateResult extends AggregateResult implements IPointsAggregateResult { + points?: Point[] | undefined; + + constructor(data?: IPointsAggregateResult) { + super(data); + this._discriminator = "PointsAggregateResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["Points"] && data["Points"].constructor === Array) { + this.points = []; + for (let item of data["Points"]) + this.points.push(Point.fromJS(item)); + } + } + } + + static fromJS(data: any): PointsAggregateResult { + data = typeof data === 'object' ? data : {}; + let result = new PointsAggregateResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.points && this.points.constructor === Array) { + data["Points"] = []; + for (let item of this.points) + data["Points"].push(item.toJSON()); + } + super.toJSON(data); + return data; + } +} + +export interface IPointsAggregateResult extends IAggregateResult { + points?: Point[] | undefined; +} + +export class Point implements IPoint { + x?: number | undefined; + y?: number | undefined; + + constructor(data?: IPoint) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.x = data["X"]; + this.y = data["Y"]; + } + } + + static fromJS(data: any): Point { + data = typeof data === 'object' ? data : {}; + let result = new Point(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["X"] = this.x; + data["Y"] = this.y; + return data; + } +} + +export interface IPoint { + x?: number | undefined; + y?: number | undefined; +} + +export class SumEstimationAggregateResult extends DoubleValueAggregateResult implements ISumEstimationAggregateResult { + sum?: number | undefined; + sumEstimation?: number | undefined; + + constructor(data?: ISumEstimationAggregateResult) { + super(data); + this._discriminator = "SumEstimationAggregateResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.sum = data["Sum"]; + this.sumEstimation = data["SumEstimation"]; + } + } + + static fromJS(data: any): SumEstimationAggregateResult { + data = typeof data === 'object' ? data : {}; + let result = new SumEstimationAggregateResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Sum"] = this.sum; + data["SumEstimation"] = this.sumEstimation; + super.toJSON(data); + return data; + } +} + +export interface ISumEstimationAggregateResult extends IDoubleValueAggregateResult { + sum?: number | undefined; + sumEstimation?: number | undefined; +} + +export class Brush implements IBrush { + brushIndex?: number | undefined; + brushEnum?: BrushEnum | undefined; + + constructor(data?: IBrush) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.brushIndex = data["BrushIndex"]; + this.brushEnum = data["BrushEnum"]; + } + } + + static fromJS(data: any): Brush { + data = typeof data === 'object' ? data : {}; + let result = new Brush(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["BrushIndex"] = this.brushIndex; + data["BrushEnum"] = this.brushEnum; + return data; + } +} + +export interface IBrush { + brushIndex?: number | undefined; + brushEnum?: BrushEnum | undefined; +} + +export enum BrushEnum { + Overlap = 0, + Rest = 1, + All = 2, + UserSpecified = 3, +} + +export abstract class BinRange implements IBinRange { + minValue?: number | undefined; + maxValue?: number | undefined; + targetBinNumber?: number | undefined; + + protected _discriminator: string; + + constructor(data?: IBinRange) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + this._discriminator = "BinRange"; + } + + init(data?: any) { + if (data) { + this.minValue = data["MinValue"]; + this.maxValue = data["MaxValue"]; + this.targetBinNumber = data["TargetBinNumber"]; + } + } + + static fromJS(data: any): BinRange { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "NominalBinRange") { + let result = new NominalBinRange(); + result.init(data); + return result; + } + if (data["discriminator"] === "QuantitativeBinRange") { + let result = new QuantitativeBinRange(); + result.init(data); + return result; + } + if (data["discriminator"] === "AggregateBinRange") { + let result = new AggregateBinRange(); + result.init(data); + return result; + } + if (data["discriminator"] === "AlphabeticBinRange") { + let result = new AlphabeticBinRange(); + result.init(data); + return result; + } + if (data["discriminator"] === "DateTimeBinRange") { + let result = new DateTimeBinRange(); + result.init(data); + return result; + } + throw new Error("The abstract class 'BinRange' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["discriminator"] = this._discriminator; + data["MinValue"] = this.minValue; + data["MaxValue"] = this.maxValue; + data["TargetBinNumber"] = this.targetBinNumber; + return data; + } +} + +export interface IBinRange { + minValue?: number | undefined; + maxValue?: number | undefined; + targetBinNumber?: number | undefined; +} + +export class NominalBinRange extends BinRange implements INominalBinRange { + labelsValue?: { [key: string]: number; } | undefined; + valuesLabel?: { [key: string]: string; } | undefined; + + constructor(data?: INominalBinRange) { + super(data); + this._discriminator = "NominalBinRange"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["LabelsValue"]) { + this.labelsValue = {}; + for (let key in data["LabelsValue"]) { + if (data["LabelsValue"].hasOwnProperty(key)) + this.labelsValue[key] = data["LabelsValue"][key]; + } + } + if (data["ValuesLabel"]) { + this.valuesLabel = {}; + for (let key in data["ValuesLabel"]) { + if (data["ValuesLabel"].hasOwnProperty(key)) + this.valuesLabel[key] = data["ValuesLabel"][key]; + } + } + } + } + + static fromJS(data: any): NominalBinRange { + data = typeof data === 'object' ? data : {}; + let result = new NominalBinRange(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.labelsValue) { + data["LabelsValue"] = {}; + for (let key in this.labelsValue) { + if (this.labelsValue.hasOwnProperty(key)) + data["LabelsValue"][key] = this.labelsValue[key]; + } + } + if (this.valuesLabel) { + data["ValuesLabel"] = {}; + for (let key in this.valuesLabel) { + if (this.valuesLabel.hasOwnProperty(key)) + data["ValuesLabel"][key] = this.valuesLabel[key]; + } + } + super.toJSON(data); + return data; + } +} + +export interface INominalBinRange extends IBinRange { + labelsValue?: { [key: string]: number; } | undefined; + valuesLabel?: { [key: string]: string; } | undefined; +} + +export class QuantitativeBinRange extends BinRange implements IQuantitativeBinRange { + isIntegerRange?: boolean | undefined; + step?: number | undefined; + + constructor(data?: IQuantitativeBinRange) { + super(data); + this._discriminator = "QuantitativeBinRange"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.isIntegerRange = data["IsIntegerRange"]; + this.step = data["Step"]; + } + } + + static fromJS(data: any): QuantitativeBinRange { + data = typeof data === 'object' ? data : {}; + let result = new QuantitativeBinRange(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["IsIntegerRange"] = this.isIntegerRange; + data["Step"] = this.step; + super.toJSON(data); + return data; + } +} + +export interface IQuantitativeBinRange extends IBinRange { + isIntegerRange?: boolean | undefined; + step?: number | undefined; +} + +export class AggregateBinRange extends BinRange implements IAggregateBinRange { + + constructor(data?: IAggregateBinRange) { + super(data); + this._discriminator = "AggregateBinRange"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): AggregateBinRange { + data = typeof data === 'object' ? data : {}; + let result = new AggregateBinRange(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface IAggregateBinRange extends IBinRange { +} + +export class AlphabeticBinRange extends BinRange implements IAlphabeticBinRange { + prefix?: string | undefined; + labelsValue?: { [key: string]: number; } | undefined; + valuesLabel?: { [key: string]: string; } | undefined; + + constructor(data?: IAlphabeticBinRange) { + super(data); + this._discriminator = "AlphabeticBinRange"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.prefix = data["Prefix"]; + if (data["LabelsValue"]) { + this.labelsValue = {}; + for (let key in data["LabelsValue"]) { + if (data["LabelsValue"].hasOwnProperty(key)) + this.labelsValue[key] = data["LabelsValue"][key]; + } + } + if (data["ValuesLabel"]) { + this.valuesLabel = {}; + for (let key in data["ValuesLabel"]) { + if (data["ValuesLabel"].hasOwnProperty(key)) + this.valuesLabel[key] = data["ValuesLabel"][key]; + } + } + } + } + + static fromJS(data: any): AlphabeticBinRange { + data = typeof data === 'object' ? data : {}; + let result = new AlphabeticBinRange(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Prefix"] = this.prefix; + if (this.labelsValue) { + data["LabelsValue"] = {}; + for (let key in this.labelsValue) { + if (this.labelsValue.hasOwnProperty(key)) + data["LabelsValue"][key] = this.labelsValue[key]; + } + } + if (this.valuesLabel) { + data["ValuesLabel"] = {}; + for (let key in this.valuesLabel) { + if (this.valuesLabel.hasOwnProperty(key)) + data["ValuesLabel"][key] = this.valuesLabel[key]; + } + } + super.toJSON(data); + return data; + } +} + +export interface IAlphabeticBinRange extends IBinRange { + prefix?: string | undefined; + labelsValue?: { [key: string]: number; } | undefined; + valuesLabel?: { [key: string]: string; } | undefined; +} + +export class DateTimeBinRange extends BinRange implements IDateTimeBinRange { + step?: DateTimeStep | undefined; + + constructor(data?: IDateTimeBinRange) { + super(data); + this._discriminator = "DateTimeBinRange"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.step = data["Step"] ? DateTimeStep.fromJS(data["Step"]) : undefined; + } + } + + static fromJS(data: any): DateTimeBinRange { + data = typeof data === 'object' ? data : {}; + let result = new DateTimeBinRange(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Step"] = this.step ? this.step.toJSON() : undefined; + super.toJSON(data); + return data; + } +} + +export interface IDateTimeBinRange extends IBinRange { + step?: DateTimeStep | undefined; +} + +export class DateTimeStep implements IDateTimeStep { + dateTimeStepGranularity?: DateTimeStepGranularity | undefined; + dateTimeStepValue?: number | undefined; + dateTimeStepMaxValue?: number | undefined; + + constructor(data?: IDateTimeStep) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.dateTimeStepGranularity = data["DateTimeStepGranularity"]; + this.dateTimeStepValue = data["DateTimeStepValue"]; + this.dateTimeStepMaxValue = data["DateTimeStepMaxValue"]; + } + } + + static fromJS(data: any): DateTimeStep { + data = typeof data === 'object' ? data : {}; + let result = new DateTimeStep(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["DateTimeStepGranularity"] = this.dateTimeStepGranularity; + data["DateTimeStepValue"] = this.dateTimeStepValue; + data["DateTimeStepMaxValue"] = this.dateTimeStepMaxValue; + return data; + } +} + +export interface IDateTimeStep { + dateTimeStepGranularity?: DateTimeStepGranularity | undefined; + dateTimeStepValue?: number | undefined; + dateTimeStepMaxValue?: number | undefined; +} + +export enum DateTimeStepGranularity { + Second = 0, + Minute = 1, + Hour = 2, + Day = 3, + Month = 4, + Year = 5, +} + +export class Bin implements IBin { + aggregateResults?: AggregateResult[] | undefined; + count?: number | undefined; + binIndex?: BinIndex | undefined; + spans?: Span[] | undefined; + xSize?: number | undefined; + ySize?: number | undefined; + + constructor(data?: IBin) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + if (data["AggregateResults"] && data["AggregateResults"].constructor === Array) { + this.aggregateResults = []; + for (let item of data["AggregateResults"]) { + let fromJs = AggregateResult.fromJS(item); + if (fromJs) + this.aggregateResults.push(fromJs); + } + } + this.count = data["Count"]; + this.binIndex = data["BinIndex"] ? BinIndex.fromJS(data["BinIndex"]) : undefined; + if (data["Spans"] && data["Spans"].constructor === Array) { + this.spans = []; + for (let item of data["Spans"]) + this.spans.push(Span.fromJS(item)); + } + this.xSize = data["XSize"]; + this.ySize = data["YSize"]; + } + } + + static fromJS(data: any): Bin { + data = typeof data === 'object' ? data : {}; + let result = new Bin(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.aggregateResults && this.aggregateResults.constructor === Array) { + data["AggregateResults"] = []; + for (let item of this.aggregateResults) + data["AggregateResults"].push(item.toJSON()); + } + data["Count"] = this.count; + data["BinIndex"] = this.binIndex ? this.binIndex.toJSON() : undefined; + if (this.spans && this.spans.constructor === Array) { + data["Spans"] = []; + for (let item of this.spans) + data["Spans"].push(item.toJSON()); + } + data["XSize"] = this.xSize; + data["YSize"] = this.ySize; + return data; + } +} + +export interface IBin { + aggregateResults?: AggregateResult[] | undefined; + count?: number | undefined; + binIndex?: BinIndex | undefined; + spans?: Span[] | undefined; + xSize?: number | undefined; + ySize?: number | undefined; +} + +export class BinIndex implements IBinIndex { + indices?: number[] | undefined; + flatIndex?: number | undefined; + + constructor(data?: IBinIndex) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + if (data["Indices"] && data["Indices"].constructor === Array) { + this.indices = []; + for (let item of data["Indices"]) + this.indices.push(item); + } + this.flatIndex = data["FlatIndex"]; + } + } + + static fromJS(data: any): BinIndex { + data = typeof data === 'object' ? data : {}; + let result = new BinIndex(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.indices && this.indices.constructor === Array) { + data["Indices"] = []; + for (let item of this.indices) + data["Indices"].push(item); + } + data["FlatIndex"] = this.flatIndex; + return data; + } +} + +export interface IBinIndex { + indices?: number[] | undefined; + flatIndex?: number | undefined; +} + +export class Span implements ISpan { + min?: number | undefined; + max?: number | undefined; + index?: number | undefined; + + constructor(data?: ISpan) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.min = data["Min"]; + this.max = data["Max"]; + this.index = data["Index"]; + } + } + + static fromJS(data: any): Span { + data = typeof data === 'object' ? data : {}; + let result = new Span(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Min"] = this.min; + data["Max"] = this.max; + data["Index"] = this.index; + return data; + } +} + +export interface ISpan { + min?: number | undefined; + max?: number | undefined; + index?: number | undefined; +} + +export class ModelWealthResult extends Result implements IModelWealthResult { + wealth?: number | undefined; + startWealth?: number | undefined; + + constructor(data?: IModelWealthResult) { + super(data); + this._discriminator = "ModelWealthResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.wealth = data["Wealth"]; + this.startWealth = data["StartWealth"]; + } + } + + static fromJS(data: any): ModelWealthResult { + data = typeof data === 'object' ? data : {}; + let result = new ModelWealthResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Wealth"] = this.wealth; + data["StartWealth"] = this.startWealth; + super.toJSON(data); + return data; + } +} + +export interface IModelWealthResult extends IResult { + wealth?: number | undefined; + startWealth?: number | undefined; +} + +export abstract class HypothesisTestResult extends Result implements IHypothesisTestResult { + pValue?: number | undefined; + statistic?: number | undefined; + support?: number | undefined; + sampleSizes?: number[] | undefined; + errorMessage?: string | undefined; + + constructor(data?: IHypothesisTestResult) { + super(data); + this._discriminator = "HypothesisTestResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.pValue = data["PValue"]; + this.statistic = data["Statistic"]; + this.support = data["Support"]; + if (data["SampleSizes"] && data["SampleSizes"].constructor === Array) { + this.sampleSizes = []; + for (let item of data["SampleSizes"]) + this.sampleSizes.push(item); + } + this.errorMessage = data["ErrorMessage"]; + } + } + + static fromJS(data: any): HypothesisTestResult { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "ChiSquaredTestResult") { + let result = new ChiSquaredTestResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "CorrelationTestResult") { + let result = new CorrelationTestResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "KSTestResult") { + let result = new KSTestResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "RootMeanSquareTestResult") { + let result = new RootMeanSquareTestResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "TTestResult") { + let result = new TTestResult(); + result.init(data); + return result; + } + throw new Error("The abstract class 'HypothesisTestResult' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["PValue"] = this.pValue; + data["Statistic"] = this.statistic; + data["Support"] = this.support; + if (this.sampleSizes && this.sampleSizes.constructor === Array) { + data["SampleSizes"] = []; + for (let item of this.sampleSizes) + data["SampleSizes"].push(item); + } + data["ErrorMessage"] = this.errorMessage; + super.toJSON(data); + return data; + } +} + +export interface IHypothesisTestResult extends IResult { + pValue?: number | undefined; + statistic?: number | undefined; + support?: number | undefined; + sampleSizes?: number[] | undefined; + errorMessage?: string | undefined; +} + +export abstract class ModelOperationResult extends Result implements IModelOperationResult { + modelId?: ModelId | undefined; + + constructor(data?: IModelOperationResult) { + super(data); + this._discriminator = "ModelOperationResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.modelId = data["ModelId"] ? ModelId.fromJS(data["ModelId"]) : undefined; + } + } + + static fromJS(data: any): ModelOperationResult { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "NewModelOperationResult") { + let result = new NewModelOperationResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "AddComparisonResult") { + let result = new AddComparisonResult(); + result.init(data); + return result; + } + if (data["discriminator"] === "GetModelStateResult") { + let result = new GetModelStateResult(); + result.init(data); + return result; + } + throw new Error("The abstract class 'ModelOperationResult' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["ModelId"] = this.modelId ? this.modelId.toJSON() : undefined; + super.toJSON(data); + return data; + } +} + +export interface IModelOperationResult extends IResult { + modelId?: ModelId | undefined; +} + +export class RecommenderResult extends Result implements IRecommenderResult { + recommendedHistograms?: RecommendedHistogram[] | undefined; + totalCount?: number | undefined; + + constructor(data?: IRecommenderResult) { + super(data); + this._discriminator = "RecommenderResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["RecommendedHistograms"] && data["RecommendedHistograms"].constructor === Array) { + this.recommendedHistograms = []; + for (let item of data["RecommendedHistograms"]) + this.recommendedHistograms.push(RecommendedHistogram.fromJS(item)); + } + this.totalCount = data["TotalCount"]; + } + } + + static fromJS(data: any): RecommenderResult { + data = typeof data === 'object' ? data : {}; + let result = new RecommenderResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.recommendedHistograms && this.recommendedHistograms.constructor === Array) { + data["RecommendedHistograms"] = []; + for (let item of this.recommendedHistograms) + data["RecommendedHistograms"].push(item.toJSON()); + } + data["TotalCount"] = this.totalCount; + super.toJSON(data); + return data; + } +} + +export interface IRecommenderResult extends IResult { + recommendedHistograms?: RecommendedHistogram[] | undefined; + totalCount?: number | undefined; +} + +export class RecommendedHistogram implements IRecommendedHistogram { + histogramResult?: HistogramResult | undefined; + selectedBinIndices?: BinIndex[] | undefined; + selections?: Selection[] | undefined; + pValue?: number | undefined; + significance?: boolean | undefined; + decision?: Decision | undefined; + effectSize?: number | undefined; + hypothesisTestResult?: HypothesisTestResult | undefined; + id?: string | undefined; + xAttribute?: Attribute | undefined; + yAttribute?: Attribute | undefined; + + constructor(data?: IRecommendedHistogram) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.histogramResult = data["HistogramResult"] ? HistogramResult.fromJS(data["HistogramResult"]) : undefined; + if (data["SelectedBinIndices"] && data["SelectedBinIndices"].constructor === Array) { + this.selectedBinIndices = []; + for (let item of data["SelectedBinIndices"]) + this.selectedBinIndices.push(BinIndex.fromJS(item)); + } + if (data["Selections"] && data["Selections"].constructor === Array) { + this.selections = []; + for (let item of data["Selections"]) + this.selections.push(Selection.fromJS(item)); + } + this.pValue = data["PValue"]; + this.significance = data["Significance"]; + this.decision = data["Decision"] ? Decision.fromJS(data["Decision"]) : undefined; + this.effectSize = data["EffectSize"]; + this.hypothesisTestResult = data["HypothesisTestResult"] ? HypothesisTestResult.fromJS(data["HypothesisTestResult"]) : undefined; + this.id = data["Id"]; + this.xAttribute = data["XAttribute"] ? Attribute.fromJS(data["XAttribute"]) : undefined; + this.yAttribute = data["YAttribute"] ? Attribute.fromJS(data["YAttribute"]) : undefined; + } + } + + static fromJS(data: any): RecommendedHistogram { + data = typeof data === 'object' ? data : {}; + let result = new RecommendedHistogram(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["HistogramResult"] = this.histogramResult ? this.histogramResult.toJSON() : undefined; + if (this.selectedBinIndices && this.selectedBinIndices.constructor === Array) { + data["SelectedBinIndices"] = []; + for (let item of this.selectedBinIndices) + data["SelectedBinIndices"].push(item.toJSON()); + } + if (this.selections && this.selections.constructor === Array) { + data["Selections"] = []; + for (let item of this.selections) + data["Selections"].push(item.toJSON()); + } + data["PValue"] = this.pValue; + data["Significance"] = this.significance; + data["Decision"] = this.decision ? this.decision.toJSON() : undefined; + data["EffectSize"] = this.effectSize; + data["HypothesisTestResult"] = this.hypothesisTestResult ? this.hypothesisTestResult.toJSON() : undefined; + data["Id"] = this.id; + data["XAttribute"] = this.xAttribute ? this.xAttribute.toJSON() : undefined; + data["YAttribute"] = this.yAttribute ? this.yAttribute.toJSON() : undefined; + return data; + } +} + +export interface IRecommendedHistogram { + histogramResult?: HistogramResult | undefined; + selectedBinIndices?: BinIndex[] | undefined; + selections?: Selection[] | undefined; + pValue?: number | undefined; + significance?: boolean | undefined; + decision?: Decision | undefined; + effectSize?: number | undefined; + hypothesisTestResult?: HypothesisTestResult | undefined; + id?: string | undefined; + xAttribute?: Attribute | undefined; + yAttribute?: Attribute | undefined; +} + +export class Selection implements ISelection { + statements?: Statement[] | undefined; + filterHistogramOperationReference?: IOperationReference | undefined; + + constructor(data?: ISelection) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + if (data["Statements"] && data["Statements"].constructor === Array) { + this.statements = []; + for (let item of data["Statements"]) + this.statements.push(Statement.fromJS(item)); + } + this.filterHistogramOperationReference = data["FilterHistogramOperationReference"] ? IOperationReference.fromJS(data["FilterHistogramOperationReference"]) : undefined; + } + } + + static fromJS(data: any): Selection { + data = typeof data === 'object' ? data : {}; + let result = new Selection(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.statements && this.statements.constructor === Array) { + data["Statements"] = []; + for (let item of this.statements) + data["Statements"].push(item.toJSON()); + } + data["FilterHistogramOperationReference"] = this.filterHistogramOperationReference ? this.filterHistogramOperationReference.toJSON() : undefined; + return data; + } +} + +export interface ISelection { + statements?: Statement[] | undefined; + filterHistogramOperationReference?: IOperationReference | undefined; +} + +export class Statement implements IStatement { + attribute?: Attribute | undefined; + predicate?: Predicate | undefined; + value?: any | undefined; + + constructor(data?: IStatement) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.attribute = data["Attribute"] ? Attribute.fromJS(data["Attribute"]) : undefined; + this.predicate = data["Predicate"]; + this.value = data["Value"]; + } + } + + static fromJS(data: any): Statement { + data = typeof data === 'object' ? data : {}; + let result = new Statement(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Attribute"] = this.attribute ? this.attribute.toJSON() : undefined; + data["Predicate"] = this.predicate; + data["Value"] = this.value; + return data; + } +} + +export interface IStatement { + attribute?: Attribute | undefined; + predicate?: Predicate | undefined; + value?: any | undefined; +} + +export enum Predicate { + EQUALS = 0, + LIKE = 1, + GREATER_THAN = 2, + LESS_THAN = 3, + GREATER_THAN_EQUAL = 4, + LESS_THAN_EQUAL = 5, + STARTS_WITH = 6, + ENDS_WITH = 7, + CONTAINS = 8, +} + +export abstract class IOperationReference implements IIOperationReference { + id?: string | undefined; + + protected _discriminator: string; + + constructor(data?: IIOperationReference) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + this._discriminator = "IOperationReference"; + } + + init(data?: any) { + if (data) { + this.id = data["Id"]; + } + } + + static fromJS(data: any): IOperationReference { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "OperationReference") { + let result = new OperationReference(); + result.init(data); + return result; + } + throw new Error("The abstract class 'IOperationReference' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["discriminator"] = this._discriminator; + data["Id"] = this.id; + return data; + } +} + +export interface IIOperationReference { + id?: string | undefined; +} + +export class OperationReference extends IOperationReference implements IOperationReference { + id?: string | undefined; + + constructor(data?: IOperationReference) { + super(data); + this._discriminator = "OperationReference"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.id = data["Id"]; + } + } + + static fromJS(data: any): OperationReference { + data = typeof data === 'object' ? data : {}; + let result = new OperationReference(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Id"] = this.id; + super.toJSON(data); + return data; + } +} + +export interface IOperationReference extends IIOperationReference { + id?: string | undefined; +} + +export class Decision extends Result implements IDecision { + comparisonId?: ComparisonId | undefined; + riskControlType?: RiskControlType | undefined; + significance?: boolean | undefined; + pValue?: number | undefined; + lhs?: number | undefined; + significanceLevel?: number | undefined; + sampleSizeEstimate?: number | undefined; + + constructor(data?: IDecision) { + super(data); + this._discriminator = "Decision"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.comparisonId = data["ComparisonId"] ? ComparisonId.fromJS(data["ComparisonId"]) : undefined; + this.riskControlType = data["RiskControlType"]; + this.significance = data["Significance"]; + this.pValue = data["PValue"]; + this.lhs = data["Lhs"]; + this.significanceLevel = data["SignificanceLevel"]; + this.sampleSizeEstimate = data["SampleSizeEstimate"]; + } + } + + static fromJS(data: any): Decision { + data = typeof data === 'object' ? data : {}; + let result = new Decision(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["ComparisonId"] = this.comparisonId ? this.comparisonId.toJSON() : undefined; + data["RiskControlType"] = this.riskControlType; + data["Significance"] = this.significance; + data["PValue"] = this.pValue; + data["Lhs"] = this.lhs; + data["SignificanceLevel"] = this.significanceLevel; + data["SampleSizeEstimate"] = this.sampleSizeEstimate; + super.toJSON(data); + return data; + } +} + +export interface IDecision extends IResult { + comparisonId?: ComparisonId | undefined; + riskControlType?: RiskControlType | undefined; + significance?: boolean | undefined; + pValue?: number | undefined; + lhs?: number | undefined; + significanceLevel?: number | undefined; + sampleSizeEstimate?: number | undefined; +} + +export class ComparisonId implements IComparisonId { + value?: string | undefined; + + constructor(data?: IComparisonId) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.value = data["Value"]; + } + } + + static fromJS(data: any): ComparisonId { + data = typeof data === 'object' ? data : {}; + let result = new ComparisonId(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Value"] = this.value; + return data; + } +} + +export interface IComparisonId { + value?: string | undefined; +} + +export class OptimizerResult extends Result implements IOptimizerResult { + topKSolutions?: Solution[] | undefined; + + constructor(data?: IOptimizerResult) { + super(data); + this._discriminator = "OptimizerResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["TopKSolutions"] && data["TopKSolutions"].constructor === Array) { + this.topKSolutions = []; + for (let item of data["TopKSolutions"]) + this.topKSolutions.push(Solution.fromJS(item)); + } + } + } + + static fromJS(data: any): OptimizerResult { + data = typeof data === 'object' ? data : {}; + let result = new OptimizerResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.topKSolutions && this.topKSolutions.constructor === Array) { + data["TopKSolutions"] = []; + for (let item of this.topKSolutions) + data["TopKSolutions"].push(item.toJSON()); + } + super.toJSON(data); + return data; + } +} + +export interface IOptimizerResult extends IResult { + topKSolutions?: Solution[] | undefined; +} + +export class Solution implements ISolution { + solutionId?: string | undefined; + stepDescriptions?: StepDescription[] | undefined; + pipelineDescription?: PipelineDescription | undefined; + score?: Score | undefined; + naiveScore?: Score | undefined; + + constructor(data?: ISolution) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.solutionId = data["SolutionId"]; + if (data["StepDescriptions"] && data["StepDescriptions"].constructor === Array) { + this.stepDescriptions = []; + for (let item of data["StepDescriptions"]) + this.stepDescriptions.push(StepDescription.fromJS(item)); + } + this.pipelineDescription = data["PipelineDescription"] ? PipelineDescription.fromJS(data["PipelineDescription"]) : undefined; + this.score = data["Score"] ? Score.fromJS(data["Score"]) : undefined; + this.naiveScore = data["NaiveScore"] ? Score.fromJS(data["NaiveScore"]) : undefined; + } + } + + static fromJS(data: any): Solution { + data = typeof data === 'object' ? data : {}; + let result = new Solution(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["SolutionId"] = this.solutionId; + if (this.stepDescriptions && this.stepDescriptions.constructor === Array) { + data["StepDescriptions"] = []; + for (let item of this.stepDescriptions) + data["StepDescriptions"].push(item.toJSON()); + } + data["PipelineDescription"] = this.pipelineDescription ? this.pipelineDescription.toJSON() : undefined; + data["Score"] = this.score ? this.score.toJSON() : undefined; + data["NaiveScore"] = this.naiveScore ? this.naiveScore.toJSON() : undefined; + return data; + } +} + +export interface ISolution { + solutionId?: string | undefined; + stepDescriptions?: StepDescription[] | undefined; + pipelineDescription?: PipelineDescription | undefined; + score?: Score | undefined; + naiveScore?: Score | undefined; +} + +export class StepDescription implements IStepDescription { + + protected _discriminator: string; + + constructor(data?: IStepDescription) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + this._discriminator = "StepDescription"; + } + + init(data?: any) { + if (data) { + } + } + + static fromJS(data: any): StepDescription { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "SubpipelineStepDescription") { + let result = new SubpipelineStepDescription(); + result.init(data); + return result; + } + if (data["discriminator"] === "PrimitiveStepDescription") { + let result = new PrimitiveStepDescription(); + result.init(data); + return result; + } + let result = new StepDescription(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["discriminator"] = this._discriminator; + return data; + } +} + +export interface IStepDescription { +} + +export class SubpipelineStepDescription extends StepDescription implements ISubpipelineStepDescription { + steps?: StepDescription[] | undefined; + + constructor(data?: ISubpipelineStepDescription) { + super(data); + this._discriminator = "SubpipelineStepDescription"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["Steps"] && data["Steps"].constructor === Array) { + this.steps = []; + for (let item of data["Steps"]) + this.steps.push(StepDescription.fromJS(item)); + } + } + } + + static fromJS(data: any): SubpipelineStepDescription { + data = typeof data === 'object' ? data : {}; + let result = new SubpipelineStepDescription(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.steps && this.steps.constructor === Array) { + data["Steps"] = []; + for (let item of this.steps) + data["Steps"].push(item.toJSON()); + } + super.toJSON(data); + return data; + } +} + +export interface ISubpipelineStepDescription extends IStepDescription { + steps?: StepDescription[] | undefined; +} + +export class PipelineDescription implements IPipelineDescription { + id?: string | undefined; + name?: string | undefined; + description?: string | undefined; + inputs?: PipelineDescriptionInput[] | undefined; + outputs?: PipelineDescriptionOutput[] | undefined; + steps?: PipelineDescriptionStep[] | undefined; + + constructor(data?: IPipelineDescription) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.id = data["Id"]; + this.name = data["Name"]; + this.description = data["Description"]; + if (data["Inputs"] && data["Inputs"].constructor === Array) { + this.inputs = []; + for (let item of data["Inputs"]) + this.inputs.push(PipelineDescriptionInput.fromJS(item)); + } + if (data["Outputs"] && data["Outputs"].constructor === Array) { + this.outputs = []; + for (let item of data["Outputs"]) + this.outputs.push(PipelineDescriptionOutput.fromJS(item)); + } + if (data["Steps"] && data["Steps"].constructor === Array) { + this.steps = []; + for (let item of data["Steps"]) + this.steps.push(PipelineDescriptionStep.fromJS(item)); + } + } + } + + static fromJS(data: any): PipelineDescription { + data = typeof data === 'object' ? data : {}; + let result = new PipelineDescription(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Id"] = this.id; + data["Name"] = this.name; + data["Description"] = this.description; + if (this.inputs && this.inputs.constructor === Array) { + data["Inputs"] = []; + for (let item of this.inputs) + data["Inputs"].push(item.toJSON()); + } + if (this.outputs && this.outputs.constructor === Array) { + data["Outputs"] = []; + for (let item of this.outputs) + data["Outputs"].push(item.toJSON()); + } + if (this.steps && this.steps.constructor === Array) { + data["Steps"] = []; + for (let item of this.steps) + data["Steps"].push(item.toJSON()); + } + return data; + } +} + +export interface IPipelineDescription { + id?: string | undefined; + name?: string | undefined; + description?: string | undefined; + inputs?: PipelineDescriptionInput[] | undefined; + outputs?: PipelineDescriptionOutput[] | undefined; + steps?: PipelineDescriptionStep[] | undefined; +} + +export class PipelineDescriptionInput implements IPipelineDescriptionInput { + name?: string | undefined; + + constructor(data?: IPipelineDescriptionInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.name = data["Name"]; + } + } + + static fromJS(data: any): PipelineDescriptionInput { + data = typeof data === 'object' ? data : {}; + let result = new PipelineDescriptionInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Name"] = this.name; + return data; + } +} + +export interface IPipelineDescriptionInput { + name?: string | undefined; +} + +export class PipelineDescriptionOutput implements IPipelineDescriptionOutput { + name?: string | undefined; + data?: string | undefined; + + constructor(data?: IPipelineDescriptionOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.name = data["Name"]; + this.data = data["Data"]; + } + } + + static fromJS(data: any): PipelineDescriptionOutput { + data = typeof data === 'object' ? data : {}; + let result = new PipelineDescriptionOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Name"] = this.name; + data["Data"] = this.data; + return data; + } +} + +export interface IPipelineDescriptionOutput { + name?: string | undefined; + data?: string | undefined; +} + +export class PipelineDescriptionStep implements IPipelineDescriptionStep { + outputs?: StepOutput[] | undefined; + + protected _discriminator: string; + + constructor(data?: IPipelineDescriptionStep) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + this._discriminator = "PipelineDescriptionStep"; + } + + init(data?: any) { + if (data) { + if (data["Outputs"] && data["Outputs"].constructor === Array) { + this.outputs = []; + for (let item of data["Outputs"]) + this.outputs.push(StepOutput.fromJS(item)); + } + } + } + + static fromJS(data: any): PipelineDescriptionStep { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "PlaceholderPipelineDescriptionStep") { + let result = new PlaceholderPipelineDescriptionStep(); + result.init(data); + return result; + } + if (data["discriminator"] === "SubpipelinePipelineDescriptionStep") { + let result = new SubpipelinePipelineDescriptionStep(); + result.init(data); + return result; + } + if (data["discriminator"] === "PrimitivePipelineDescriptionStep") { + let result = new PrimitivePipelineDescriptionStep(); + result.init(data); + return result; + } + let result = new PipelineDescriptionStep(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["discriminator"] = this._discriminator; + if (this.outputs && this.outputs.constructor === Array) { + data["Outputs"] = []; + for (let item of this.outputs) + data["Outputs"].push(item.toJSON()); + } + return data; + } +} + +export interface IPipelineDescriptionStep { + outputs?: StepOutput[] | undefined; +} + +export class StepOutput implements IStepOutput { + id?: string | undefined; + + constructor(data?: IStepOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.id = data["Id"]; + } + } + + static fromJS(data: any): StepOutput { + data = typeof data === 'object' ? data : {}; + let result = new StepOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Id"] = this.id; + return data; + } +} + +export interface IStepOutput { + id?: string | undefined; +} + +export class PlaceholderPipelineDescriptionStep extends PipelineDescriptionStep implements IPlaceholderPipelineDescriptionStep { + inputs?: StepInput[] | undefined; + + constructor(data?: IPlaceholderPipelineDescriptionStep) { + super(data); + this._discriminator = "PlaceholderPipelineDescriptionStep"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["Inputs"] && data["Inputs"].constructor === Array) { + this.inputs = []; + for (let item of data["Inputs"]) + this.inputs.push(StepInput.fromJS(item)); + } + } + } + + static fromJS(data: any): PlaceholderPipelineDescriptionStep { + data = typeof data === 'object' ? data : {}; + let result = new PlaceholderPipelineDescriptionStep(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.inputs && this.inputs.constructor === Array) { + data["Inputs"] = []; + for (let item of this.inputs) + data["Inputs"].push(item.toJSON()); + } + super.toJSON(data); + return data; + } +} + +export interface IPlaceholderPipelineDescriptionStep extends IPipelineDescriptionStep { + inputs?: StepInput[] | undefined; +} + +export class StepInput implements IStepInput { + data?: string | undefined; + + constructor(data?: IStepInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.data = data["Data"]; + } + } + + static fromJS(data: any): StepInput { + data = typeof data === 'object' ? data : {}; + let result = new StepInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Data"] = this.data; + return data; + } +} + +export interface IStepInput { + data?: string | undefined; +} + +export class SubpipelinePipelineDescriptionStep extends PipelineDescriptionStep implements ISubpipelinePipelineDescriptionStep { + pipelineDescription?: PipelineDescription | undefined; + inputs?: StepInput[] | undefined; + + constructor(data?: ISubpipelinePipelineDescriptionStep) { + super(data); + this._discriminator = "SubpipelinePipelineDescriptionStep"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.pipelineDescription = data["PipelineDescription"] ? PipelineDescription.fromJS(data["PipelineDescription"]) : undefined; + if (data["Inputs"] && data["Inputs"].constructor === Array) { + this.inputs = []; + for (let item of data["Inputs"]) + this.inputs.push(StepInput.fromJS(item)); + } + } + } + + static fromJS(data: any): SubpipelinePipelineDescriptionStep { + data = typeof data === 'object' ? data : {}; + let result = new SubpipelinePipelineDescriptionStep(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["PipelineDescription"] = this.pipelineDescription ? this.pipelineDescription.toJSON() : undefined; + if (this.inputs && this.inputs.constructor === Array) { + data["Inputs"] = []; + for (let item of this.inputs) + data["Inputs"].push(item.toJSON()); + } + super.toJSON(data); + return data; + } +} + +export interface ISubpipelinePipelineDescriptionStep extends IPipelineDescriptionStep { + pipelineDescription?: PipelineDescription | undefined; + inputs?: StepInput[] | undefined; +} + +export class PrimitivePipelineDescriptionStep extends PipelineDescriptionStep implements IPrimitivePipelineDescriptionStep { + primitive?: Primitive | undefined; + arguments?: { [key: string]: PrimitiveStepArgument; } | undefined; + hyperparams?: { [key: string]: PrimitiveStepHyperparameter; } | undefined; + + constructor(data?: IPrimitivePipelineDescriptionStep) { + super(data); + this._discriminator = "PrimitivePipelineDescriptionStep"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.primitive = data["Primitive"] ? Primitive.fromJS(data["Primitive"]) : undefined; + if (data["Arguments"]) { + this.arguments = {}; + for (let key in data["Arguments"]) { + if (data["Arguments"].hasOwnProperty(key)) + this.arguments[key] = data["Arguments"][key] ? PrimitiveStepArgument.fromJS(data["Arguments"][key]) : new PrimitiveStepArgument(); + } + } + if (data["Hyperparams"]) { + this.hyperparams = {}; + for (let key in data["Hyperparams"]) { + if (data["Hyperparams"].hasOwnProperty(key)) + this.hyperparams[key] = data["Hyperparams"][key] ? PrimitiveStepHyperparameter.fromJS(data["Hyperparams"][key]) : new PrimitiveStepHyperparameter(); + } + } + } + } + + static fromJS(data: any): PrimitivePipelineDescriptionStep { + data = typeof data === 'object' ? data : {}; + let result = new PrimitivePipelineDescriptionStep(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Primitive"] = this.primitive ? this.primitive.toJSON() : undefined; + if (this.arguments) { + data["Arguments"] = {}; + for (let key in this.arguments) { + if (this.arguments.hasOwnProperty(key)) + data["Arguments"][key] = this.arguments[key]; + } + } + if (this.hyperparams) { + data["Hyperparams"] = {}; + for (let key in this.hyperparams) { + if (this.hyperparams.hasOwnProperty(key)) + data["Hyperparams"][key] = this.hyperparams[key]; + } + } + super.toJSON(data); + return data; + } +} + +export interface IPrimitivePipelineDescriptionStep extends IPipelineDescriptionStep { + primitive?: Primitive | undefined; + arguments?: { [key: string]: PrimitiveStepArgument; } | undefined; + hyperparams?: { [key: string]: PrimitiveStepHyperparameter; } | undefined; +} + +export class Primitive implements IPrimitive { + id?: string | undefined; + version?: string | undefined; + pythonPath?: string | undefined; + name?: string | undefined; + digest?: string | undefined; + + constructor(data?: IPrimitive) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.id = data["Id"]; + this.version = data["Version"]; + this.pythonPath = data["PythonPath"]; + this.name = data["Name"]; + this.digest = data["Digest"]; + } + } + + static fromJS(data: any): Primitive { + data = typeof data === 'object' ? data : {}; + let result = new Primitive(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Id"] = this.id; + data["Version"] = this.version; + data["PythonPath"] = this.pythonPath; + data["Name"] = this.name; + data["Digest"] = this.digest; + return data; + } +} + +export interface IPrimitive { + id?: string | undefined; + version?: string | undefined; + pythonPath?: string | undefined; + name?: string | undefined; + digest?: string | undefined; +} + +export class PrimitiveStepHyperparameter implements IPrimitiveStepHyperparameter { + + protected _discriminator: string; + + constructor(data?: IPrimitiveStepHyperparameter) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + this._discriminator = "PrimitiveStepHyperparameter"; + } + + init(data?: any) { + if (data) { + } + } + + static fromJS(data: any): PrimitiveStepHyperparameter { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "PrimitiveStepArgument") { + let result = new PrimitiveStepArgument(); + result.init(data); + return result; + } + if (data["discriminator"] === "DataArguments") { + let result = new DataArguments(); + result.init(data); + return result; + } + if (data["discriminator"] === "PrimitiveArgument") { + let result = new PrimitiveArgument(); + result.init(data); + return result; + } + if (data["discriminator"] === "PrimitiveArguments") { + let result = new PrimitiveArguments(); + result.init(data); + return result; + } + if (data["discriminator"] === "ValueArgument") { + let result = new ValueArgument(); + result.init(data); + return result; + } + if (data["discriminator"] === "ContainerArgument") { + let result = new ContainerArgument(); + result.init(data); + return result; + } + if (data["discriminator"] === "DataArgument") { + let result = new DataArgument(); + result.init(data); + return result; + } + let result = new PrimitiveStepHyperparameter(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["discriminator"] = this._discriminator; + return data; + } +} + +export interface IPrimitiveStepHyperparameter { +} + +export class PrimitiveStepArgument extends PrimitiveStepHyperparameter implements IPrimitiveStepArgument { + + protected _discriminator: string; + + constructor(data?: IPrimitiveStepArgument) { + super(data); + this._discriminator = "PrimitiveStepArgument"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): PrimitiveStepArgument { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "ContainerArgument") { + let result = new ContainerArgument(); + result.init(data); + return result; + } + if (data["discriminator"] === "DataArgument") { + let result = new DataArgument(); + result.init(data); + return result; + } + let result = new PrimitiveStepArgument(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["discriminator"] = this._discriminator; + super.toJSON(data); + return data; + } +} + +export interface IPrimitiveStepArgument extends IPrimitiveStepHyperparameter { +} + +export class DataArguments extends PrimitiveStepHyperparameter implements IDataArguments { + data?: string[] | undefined; + + constructor(data?: IDataArguments) { + super(data); + this._discriminator = "DataArguments"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["Data"] && data["Data"].constructor === Array) { + this.data = []; + for (let item of data["Data"]) + this.data.push(item); + } + } + } + + static fromJS(data: any): DataArguments { + data = typeof data === 'object' ? data : {}; + let result = new DataArguments(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.data && this.data.constructor === Array) { + data["Data"] = []; + for (let item of this.data) + data["Data"].push(item); + } + super.toJSON(data); + return data; + } +} + +export interface IDataArguments extends IPrimitiveStepHyperparameter { + data?: string[] | undefined; +} + +export class PrimitiveArgument extends PrimitiveStepHyperparameter implements IPrimitiveArgument { + data?: number | undefined; + + constructor(data?: IPrimitiveArgument) { + super(data); + this._discriminator = "PrimitiveArgument"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.data = data["Data"]; + } + } + + static fromJS(data: any): PrimitiveArgument { + data = typeof data === 'object' ? data : {}; + let result = new PrimitiveArgument(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Data"] = this.data; + super.toJSON(data); + return data; + } +} + +export interface IPrimitiveArgument extends IPrimitiveStepHyperparameter { + data?: number | undefined; +} + +export class PrimitiveArguments extends PrimitiveStepHyperparameter implements IPrimitiveArguments { + data?: number[] | undefined; + + constructor(data?: IPrimitiveArguments) { + super(data); + this._discriminator = "PrimitiveArguments"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["Data"] && data["Data"].constructor === Array) { + this.data = []; + for (let item of data["Data"]) + this.data.push(item); + } + } + } + + static fromJS(data: any): PrimitiveArguments { + data = typeof data === 'object' ? data : {}; + let result = new PrimitiveArguments(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.data && this.data.constructor === Array) { + data["Data"] = []; + for (let item of this.data) + data["Data"].push(item); + } + super.toJSON(data); + return data; + } +} + +export interface IPrimitiveArguments extends IPrimitiveStepHyperparameter { + data?: number[] | undefined; +} + +export class ValueArgument extends PrimitiveStepHyperparameter implements IValueArgument { + data?: Value | undefined; + + constructor(data?: IValueArgument) { + super(data); + this._discriminator = "ValueArgument"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.data = data["Data"] ? Value.fromJS(data["Data"]) : undefined; + } + } + + static fromJS(data: any): ValueArgument { + data = typeof data === 'object' ? data : {}; + let result = new ValueArgument(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Data"] = this.data ? this.data.toJSON() : undefined; + super.toJSON(data); + return data; + } +} + +export interface IValueArgument extends IPrimitiveStepHyperparameter { + data?: Value | undefined; +} + +export abstract class Value implements IValue { + + protected _discriminator: string; + + constructor(data?: IValue) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + this._discriminator = "Value"; + } + + init(data?: any) { + if (data) { + } + } + + static fromJS(data: any): Value { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "ErrorValue") { + let result = new ErrorValue(); + result.init(data); + return result; + } + if (data["discriminator"] === "DoubleValue") { + let result = new DoubleValue(); + result.init(data); + return result; + } + if (data["discriminator"] === "LongValue") { + let result = new LongValue(); + result.init(data); + return result; + } + if (data["discriminator"] === "BoolValue") { + let result = new BoolValue(); + result.init(data); + return result; + } + if (data["discriminator"] === "StringValue") { + let result = new StringValue(); + result.init(data); + return result; + } + if (data["discriminator"] === "DatasetUriValue") { + let result = new DatasetUriValue(); + result.init(data); + return result; + } + if (data["discriminator"] === "CsvUriValue") { + let result = new CsvUriValue(); + result.init(data); + return result; + } + if (data["discriminator"] === "PickleUriValue") { + let result = new PickleUriValue(); + result.init(data); + return result; + } + if (data["discriminator"] === "PickleBlobValue") { + let result = new PickleBlobValue(); + result.init(data); + return result; + } + if (data["discriminator"] === "PlasmaIdValue") { + let result = new PlasmaIdValue(); + result.init(data); + return result; + } + if (data["discriminator"] === "BytesValue") { + let result = new BytesValue(); + result.init(data); + return result; + } + if (data["discriminator"] === "ListValue") { + let result = new ListValue(); + result.init(data); + return result; + } + throw new Error("The abstract class 'Value' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["discriminator"] = this._discriminator; + return data; + } +} + +export interface IValue { +} + +export class ErrorValue extends Value implements IErrorValue { + message?: string | undefined; + + constructor(data?: IErrorValue) { + super(data); + this._discriminator = "ErrorValue"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.message = data["Message"]; + } + } + + static fromJS(data: any): ErrorValue { + data = typeof data === 'object' ? data : {}; + let result = new ErrorValue(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Message"] = this.message; + super.toJSON(data); + return data; + } +} + +export interface IErrorValue extends IValue { + message?: string | undefined; +} + +export class DoubleValue extends Value implements IDoubleValue { + value?: number | undefined; + + constructor(data?: IDoubleValue) { + super(data); + this._discriminator = "DoubleValue"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.value = data["Value"]; + } + } + + static fromJS(data: any): DoubleValue { + data = typeof data === 'object' ? data : {}; + let result = new DoubleValue(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Value"] = this.value; + super.toJSON(data); + return data; + } +} + +export interface IDoubleValue extends IValue { + value?: number | undefined; +} + +export class LongValue extends Value implements ILongValue { + value?: number | undefined; + + constructor(data?: ILongValue) { + super(data); + this._discriminator = "LongValue"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.value = data["Value"]; + } + } + + static fromJS(data: any): LongValue { + data = typeof data === 'object' ? data : {}; + let result = new LongValue(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Value"] = this.value; + super.toJSON(data); + return data; + } +} + +export interface ILongValue extends IValue { + value?: number | undefined; +} + +export class BoolValue extends Value implements IBoolValue { + value?: boolean | undefined; + + constructor(data?: IBoolValue) { + super(data); + this._discriminator = "BoolValue"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.value = data["Value"]; + } + } + + static fromJS(data: any): BoolValue { + data = typeof data === 'object' ? data : {}; + let result = new BoolValue(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Value"] = this.value; + super.toJSON(data); + return data; + } +} + +export interface IBoolValue extends IValue { + value?: boolean | undefined; +} + +export class StringValue extends Value implements IStringValue { + value?: string | undefined; + + constructor(data?: IStringValue) { + super(data); + this._discriminator = "StringValue"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.value = data["Value"]; + } + } + + static fromJS(data: any): StringValue { + data = typeof data === 'object' ? data : {}; + let result = new StringValue(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Value"] = this.value; + super.toJSON(data); + return data; + } +} + +export interface IStringValue extends IValue { + value?: string | undefined; +} + +export class DatasetUriValue extends Value implements IDatasetUriValue { + value?: string | undefined; + + constructor(data?: IDatasetUriValue) { + super(data); + this._discriminator = "DatasetUriValue"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.value = data["Value"]; + } + } + + static fromJS(data: any): DatasetUriValue { + data = typeof data === 'object' ? data : {}; + let result = new DatasetUriValue(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Value"] = this.value; + super.toJSON(data); + return data; + } +} + +export interface IDatasetUriValue extends IValue { + value?: string | undefined; +} + +export class CsvUriValue extends Value implements ICsvUriValue { + value?: string | undefined; + + constructor(data?: ICsvUriValue) { + super(data); + this._discriminator = "CsvUriValue"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.value = data["Value"]; + } + } + + static fromJS(data: any): CsvUriValue { + data = typeof data === 'object' ? data : {}; + let result = new CsvUriValue(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Value"] = this.value; + super.toJSON(data); + return data; + } +} + +export interface ICsvUriValue extends IValue { + value?: string | undefined; +} + +export class PickleUriValue extends Value implements IPickleUriValue { + value?: string | undefined; + + constructor(data?: IPickleUriValue) { + super(data); + this._discriminator = "PickleUriValue"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.value = data["Value"]; + } + } + + static fromJS(data: any): PickleUriValue { + data = typeof data === 'object' ? data : {}; + let result = new PickleUriValue(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Value"] = this.value; + super.toJSON(data); + return data; + } +} + +export interface IPickleUriValue extends IValue { + value?: string | undefined; +} + +export class PickleBlobValue extends Value implements IPickleBlobValue { + value?: string | undefined; + + constructor(data?: IPickleBlobValue) { + super(data); + this._discriminator = "PickleBlobValue"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.value = data["Value"]; + } + } + + static fromJS(data: any): PickleBlobValue { + data = typeof data === 'object' ? data : {}; + let result = new PickleBlobValue(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Value"] = this.value; + super.toJSON(data); + return data; + } +} + +export interface IPickleBlobValue extends IValue { + value?: string | undefined; +} + +export class PlasmaIdValue extends Value implements IPlasmaIdValue { + value?: string | undefined; + + constructor(data?: IPlasmaIdValue) { + super(data); + this._discriminator = "PlasmaIdValue"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.value = data["Value"]; + } + } + + static fromJS(data: any): PlasmaIdValue { + data = typeof data === 'object' ? data : {}; + let result = new PlasmaIdValue(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Value"] = this.value; + super.toJSON(data); + return data; + } +} + +export interface IPlasmaIdValue extends IValue { + value?: string | undefined; +} + +export class BytesValue extends Value implements IBytesValue { + value?: string | undefined; + + constructor(data?: IBytesValue) { + super(data); + this._discriminator = "BytesValue"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.value = data["Value"]; + } + } + + static fromJS(data: any): BytesValue { + data = typeof data === 'object' ? data : {}; + let result = new BytesValue(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Value"] = this.value; + super.toJSON(data); + return data; + } +} + +export interface IBytesValue extends IValue { + value?: string | undefined; +} + +export class ContainerArgument extends PrimitiveStepArgument implements IContainerArgument { + data?: string | undefined; + + constructor(data?: IContainerArgument) { + super(data); + this._discriminator = "ContainerArgument"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.data = data["Data"]; + } + } + + static fromJS(data: any): ContainerArgument { + data = typeof data === 'object' ? data : {}; + let result = new ContainerArgument(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Data"] = this.data; + super.toJSON(data); + return data; + } +} + +export interface IContainerArgument extends IPrimitiveStepArgument { + data?: string | undefined; +} + +export class Score implements IScore { + metricType?: MetricType | undefined; + value?: number | undefined; + + constructor(data?: IScore) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.metricType = data["MetricType"]; + this.value = data["Value"]; + } + } + + static fromJS(data: any): Score { + data = typeof data === 'object' ? data : {}; + let result = new Score(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["MetricType"] = this.metricType; + data["Value"] = this.value; + return data; + } +} + +export interface IScore { + metricType?: MetricType | undefined; + value?: number | undefined; +} + +export class ExampleResult extends Result implements IExampleResult { + resultValues?: { [key: string]: string; } | undefined; + message?: string | undefined; + + constructor(data?: IExampleResult) { + super(data); + this._discriminator = "ExampleResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["ResultValues"]) { + this.resultValues = {}; + for (let key in data["ResultValues"]) { + if (data["ResultValues"].hasOwnProperty(key)) + this.resultValues[key] = data["ResultValues"][key]; + } + } + this.message = data["Message"]; + } + } + + static fromJS(data: any): ExampleResult { + data = typeof data === 'object' ? data : {}; + let result = new ExampleResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.resultValues) { + data["ResultValues"] = {}; + for (let key in this.resultValues) { + if (this.resultValues.hasOwnProperty(key)) + data["ResultValues"][key] = this.resultValues[key]; + } + } + data["Message"] = this.message; + super.toJSON(data); + return data; + } +} + +export interface IExampleResult extends IResult { + resultValues?: { [key: string]: string; } | undefined; + message?: string | undefined; +} + +export class NewModelOperationResult extends ModelOperationResult implements INewModelOperationResult { + + constructor(data?: INewModelOperationResult) { + super(data); + this._discriminator = "NewModelOperationResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): NewModelOperationResult { + data = typeof data === 'object' ? data : {}; + let result = new NewModelOperationResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface INewModelOperationResult extends IModelOperationResult { +} + +export class AddComparisonResult extends ModelOperationResult implements IAddComparisonResult { + comparisonId?: ComparisonId | undefined; + + constructor(data?: IAddComparisonResult) { + super(data); + this._discriminator = "AddComparisonResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.comparisonId = data["ComparisonId"] ? ComparisonId.fromJS(data["ComparisonId"]) : undefined; + } + } + + static fromJS(data: any): AddComparisonResult { + data = typeof data === 'object' ? data : {}; + let result = new AddComparisonResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["ComparisonId"] = this.comparisonId ? this.comparisonId.toJSON() : undefined; + super.toJSON(data); + return data; + } +} + +export interface IAddComparisonResult extends IModelOperationResult { + comparisonId?: ComparisonId | undefined; +} + +export class GetModelStateResult extends ModelOperationResult implements IGetModelStateResult { + decisions?: Decision[] | undefined; + startingWealth?: number | undefined; + currentWealth?: number | undefined; + + constructor(data?: IGetModelStateResult) { + super(data); + this._discriminator = "GetModelStateResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["Decisions"] && data["Decisions"].constructor === Array) { + this.decisions = []; + for (let item of data["Decisions"]) + this.decisions.push(Decision.fromJS(item)); + } + this.startingWealth = data["StartingWealth"]; + this.currentWealth = data["CurrentWealth"]; + } + } + + static fromJS(data: any): GetModelStateResult { + data = typeof data === 'object' ? data : {}; + let result = new GetModelStateResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.decisions && this.decisions.constructor === Array) { + data["Decisions"] = []; + for (let item of this.decisions) + data["Decisions"].push(item.toJSON()); + } + data["StartingWealth"] = this.startingWealth; + data["CurrentWealth"] = this.currentWealth; + super.toJSON(data); + return data; + } +} + +export interface IGetModelStateResult extends IModelOperationResult { + decisions?: Decision[] | undefined; + startingWealth?: number | undefined; + currentWealth?: number | undefined; +} + +export class AggregateKey implements IAggregateKey { + aggregateParameterIndex?: number | undefined; + brushIndex?: number | undefined; + + constructor(data?: IAggregateKey) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.aggregateParameterIndex = data["AggregateParameterIndex"]; + this.brushIndex = data["BrushIndex"]; + } + } + + static fromJS(data: any): AggregateKey { + data = typeof data === 'object' ? data : {}; + let result = new AggregateKey(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["AggregateParameterIndex"] = this.aggregateParameterIndex; + data["BrushIndex"] = this.brushIndex; + return data; + } +} + +export interface IAggregateKey { + aggregateParameterIndex?: number | undefined; + brushIndex?: number | undefined; +} + +export abstract class IResult implements IIResult { + + constructor(data?: IIResult) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + } + } + + static fromJS(data: any): IResult { + data = typeof data === 'object' ? data : {}; + throw new Error("The abstract class 'IResult' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + return data; + } +} + +export interface IIResult { +} + +export class DataArgument extends PrimitiveStepArgument implements IDataArgument { + data?: string | undefined; + + constructor(data?: IDataArgument) { + super(data); + this._discriminator = "DataArgument"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.data = data["Data"]; + } + } + + static fromJS(data: any): DataArgument { + data = typeof data === 'object' ? data : {}; + let result = new DataArgument(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Data"] = this.data; + super.toJSON(data); + return data; + } +} + +export interface IDataArgument extends IPrimitiveStepArgument { + data?: string | undefined; +} + +export class ListValue extends Value implements IListValue { + items?: Value[] | undefined; + + constructor(data?: IListValue) { + super(data); + this._discriminator = "ListValue"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["Items"] && data["Items"].constructor === Array) { + this.items = []; + for (let item of data["Items"]) + this.items.push(Value.fromJS(item)); + } + } + } + + static fromJS(data: any): ListValue { + data = typeof data === 'object' ? data : {}; + let result = new ListValue(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.items && this.items.constructor === Array) { + data["Items"] = []; + for (let item of this.items) + data["Items"].push(item.toJSON()); + } + super.toJSON(data); + return data; + } +} + +export interface IListValue extends IValue { + items?: Value[] | undefined; +} + +export class Metrics implements IMetrics { + averageAccuracy?: number | undefined; + averageRSquared?: number | undefined; + f1Macro?: number | undefined; + + constructor(data?: IMetrics) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.averageAccuracy = data["AverageAccuracy"]; + this.averageRSquared = data["AverageRSquared"]; + this.f1Macro = data["F1Macro"]; + } + } + + static fromJS(data: any): Metrics { + data = typeof data === 'object' ? data : {}; + let result = new Metrics(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["AverageAccuracy"] = this.averageAccuracy; + data["AverageRSquared"] = this.averageRSquared; + data["F1Macro"] = this.f1Macro; + return data; + } +} + +export interface IMetrics { + averageAccuracy?: number | undefined; + averageRSquared?: number | undefined; + f1Macro?: number | undefined; +} + +export class FeatureImportanceOperationParameters extends DistOperationParameters implements IFeatureImportanceOperationParameters { + solutionId?: string | undefined; + + constructor(data?: IFeatureImportanceOperationParameters) { + super(data); + this._discriminator = "FeatureImportanceOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.solutionId = data["SolutionId"]; + } + } + + static fromJS(data: any): FeatureImportanceOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new FeatureImportanceOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["SolutionId"] = this.solutionId; + super.toJSON(data); + return data; + } +} + +export interface IFeatureImportanceOperationParameters extends IDistOperationParameters { + solutionId?: string | undefined; +} + +export class FeatureImportanceResult extends Result implements IFeatureImportanceResult { + featureImportances?: { [key: string]: TupleOfDoubleAndDouble; } | undefined; + + constructor(data?: IFeatureImportanceResult) { + super(data); + this._discriminator = "FeatureImportanceResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["FeatureImportances"]) { + this.featureImportances = {}; + for (let key in data["FeatureImportances"]) { + if (data["FeatureImportances"].hasOwnProperty(key)) + this.featureImportances[key] = data["FeatureImportances"][key] ? TupleOfDoubleAndDouble.fromJS(data["FeatureImportances"][key]) : new TupleOfDoubleAndDouble(); + } + } + } + } + + static fromJS(data: any): FeatureImportanceResult { + data = typeof data === 'object' ? data : {}; + let result = new FeatureImportanceResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.featureImportances) { + data["FeatureImportances"] = {}; + for (let key in this.featureImportances) { + if (this.featureImportances.hasOwnProperty(key)) + data["FeatureImportances"][key] = this.featureImportances[key]; + } + } + super.toJSON(data); + return data; + } +} + +export interface IFeatureImportanceResult extends IResult { + featureImportances?: { [key: string]: TupleOfDoubleAndDouble; } | undefined; +} + +export class TupleOfDoubleAndDouble implements ITupleOfDoubleAndDouble { + item1?: number | undefined; + item2?: number | undefined; + + constructor(data?: ITupleOfDoubleAndDouble) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.item1 = data["Item1"]; + this.item2 = data["Item2"]; + } + } + + static fromJS(data: any): TupleOfDoubleAndDouble { + data = typeof data === 'object' ? data : {}; + let result = new TupleOfDoubleAndDouble(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Item1"] = this.item1; + data["Item2"] = this.item2; + return data; + } +} + +export interface ITupleOfDoubleAndDouble { + item1?: number | undefined; + item2?: number | undefined; +} + +export class PrimitiveStepDescription extends StepDescription implements IPrimitiveStepDescription { + hyperparams?: { [key: string]: Value; } | undefined; + + constructor(data?: IPrimitiveStepDescription) { + super(data); + this._discriminator = "PrimitiveStepDescription"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["Hyperparams"]) { + this.hyperparams = {}; + for (let key in data["Hyperparams"]) { + if (data["Hyperparams"].hasOwnProperty(key)) + this.hyperparams[key] = data["Hyperparams"][key] ? Value.fromJS(data["Hyperparams"][key]) : undefined; + } + } + } + } + + static fromJS(data: any): PrimitiveStepDescription { + data = typeof data === 'object' ? data : {}; + let result = new PrimitiveStepDescription(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.hyperparams) { + data["Hyperparams"] = {}; + for (let key in this.hyperparams) { + if (this.hyperparams.hasOwnProperty(key)) + data["Hyperparams"][key] = this.hyperparams[key]; + } + } + super.toJSON(data); + return data; + } +} + +export interface IPrimitiveStepDescription extends IStepDescription { + hyperparams?: { [key: string]: Value; } | undefined; +} + +export enum ValueType { + VALUE_TYPE_UNDEFINED = 0, + RAW = 1, + DATASET_URI = 2, + CSV_URI = 3, + PICKLE_URI = 4, + PICKLE_BLOB = 5, + PLASMA_ID = 6, +} + +export class DatamartSearchParameters implements IDatamartSearchParameters { + adapterName?: string | undefined; + queryJson?: string | undefined; + + constructor(data?: IDatamartSearchParameters) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.adapterName = data["AdapterName"]; + this.queryJson = data["QueryJson"]; + } + } + + static fromJS(data: any): DatamartSearchParameters { + data = typeof data === 'object' ? data : {}; + let result = new DatamartSearchParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["AdapterName"] = this.adapterName; + data["QueryJson"] = this.queryJson; + return data; + } +} + +export interface IDatamartSearchParameters { + adapterName?: string | undefined; + queryJson?: string | undefined; +} + +export class DatamartAugmentParameters implements IDatamartAugmentParameters { + adapterName?: string | undefined; + augmentationJson?: string | undefined; + numberOfSamples?: number | undefined; + augmentedAdapterName?: string | undefined; + + constructor(data?: IDatamartAugmentParameters) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.adapterName = data["AdapterName"]; + this.augmentationJson = data["AugmentationJson"]; + this.numberOfSamples = data["NumberOfSamples"]; + this.augmentedAdapterName = data["AugmentedAdapterName"]; + } + } + + static fromJS(data: any): DatamartAugmentParameters { + data = typeof data === 'object' ? data : {}; + let result = new DatamartAugmentParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["AdapterName"] = this.adapterName; + data["AugmentationJson"] = this.augmentationJson; + data["NumberOfSamples"] = this.numberOfSamples; + data["AugmentedAdapterName"] = this.augmentedAdapterName; + return data; + } +} + +export interface IDatamartAugmentParameters { + adapterName?: string | undefined; + augmentationJson?: string | undefined; + numberOfSamples?: number | undefined; + augmentedAdapterName?: string | undefined; +} + +export class RawDataResult extends DistResult implements IRawDataResult { + samples?: { [key: string]: any[]; } | undefined; + weightedWords?: { [key: string]: Word[]; } | undefined; + + constructor(data?: IRawDataResult) { + super(data); + this._discriminator = "RawDataResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["Samples"]) { + this.samples = {}; + for (let key in data["Samples"]) { + if (data["Samples"].hasOwnProperty(key)) + this.samples[key] = data["Samples"][key] !== undefined ? data["Samples"][key] : []; + } + } + if (data["WeightedWords"]) { + this.weightedWords = {}; + for (let key in data["WeightedWords"]) { + if (data["WeightedWords"].hasOwnProperty(key)) + this.weightedWords[key] = data["WeightedWords"][key] ? data["WeightedWords"][key].map((i: any) => Word.fromJS(i)) : []; + } + } + } + } + + static fromJS(data: any): RawDataResult { + data = typeof data === 'object' ? data : {}; + let result = new RawDataResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.samples) { + data["Samples"] = {}; + for (let key in this.samples) { + if (this.samples.hasOwnProperty(key)) + data["Samples"][key] = this.samples[key]; + } + } + if (this.weightedWords) { + data["WeightedWords"] = {}; + for (let key in this.weightedWords) { + if (this.weightedWords.hasOwnProperty(key)) + data["WeightedWords"][key] = this.weightedWords[key]; + } + } + super.toJSON(data); + return data; + } +} + +export interface IRawDataResult extends IDistResult { + samples?: { [key: string]: any[]; } | undefined; + weightedWords?: { [key: string]: Word[]; } | undefined; +} + +export class Word implements IWord { + text?: string | undefined; + occurrences?: number | undefined; + stem?: string | undefined; + isWordGroup?: boolean | undefined; + + constructor(data?: IWord) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.text = data["Text"]; + this.occurrences = data["Occurrences"]; + this.stem = data["Stem"]; + this.isWordGroup = data["IsWordGroup"]; + } + } + + static fromJS(data: any): Word { + data = typeof data === 'object' ? data : {}; + let result = new Word(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Text"] = this.text; + data["Occurrences"] = this.occurrences; + data["Stem"] = this.stem; + data["IsWordGroup"] = this.isWordGroup; + return data; + } +} + +export interface IWord { + text?: string | undefined; + occurrences?: number | undefined; + stem?: string | undefined; + isWordGroup?: boolean | undefined; +} + +export class SampleOperationParameters extends DistOperationParameters implements ISampleOperationParameters { + numSamples?: number | undefined; + attributeParameters?: AttributeParameters[] | undefined; + brushes?: string[] | undefined; + + constructor(data?: ISampleOperationParameters) { + super(data); + this._discriminator = "SampleOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.numSamples = data["NumSamples"]; + if (data["AttributeParameters"] && data["AttributeParameters"].constructor === Array) { + this.attributeParameters = []; + for (let item of data["AttributeParameters"]) + this.attributeParameters.push(AttributeParameters.fromJS(item)); + } + if (data["Brushes"] && data["Brushes"].constructor === Array) { + this.brushes = []; + for (let item of data["Brushes"]) + this.brushes.push(item); + } + } + } + + static fromJS(data: any): SampleOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new SampleOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["NumSamples"] = this.numSamples; + if (this.attributeParameters && this.attributeParameters.constructor === Array) { + data["AttributeParameters"] = []; + for (let item of this.attributeParameters) + data["AttributeParameters"].push(item.toJSON()); + } + if (this.brushes && this.brushes.constructor === Array) { + data["Brushes"] = []; + for (let item of this.brushes) + data["Brushes"].push(item); + } + super.toJSON(data); + return data; + } +} + +export interface ISampleOperationParameters extends IDistOperationParameters { + numSamples?: number | undefined; + attributeParameters?: AttributeParameters[] | undefined; + brushes?: string[] | undefined; +} + +export class SampleResult extends DistResult implements ISampleResult { + samples?: { [key: string]: { [key: string]: number; }; } | undefined; + isTruncated?: boolean | undefined; + + constructor(data?: ISampleResult) { + super(data); + this._discriminator = "SampleResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["Samples"]) { + this.samples = {}; + for (let key in data["Samples"]) { + if (data["Samples"].hasOwnProperty(key)) + this.samples[key] = data["Samples"][key] !== undefined ? data["Samples"][key] : {}; + } + } + this.isTruncated = data["IsTruncated"]; + } + } + + static fromJS(data: any): SampleResult { + data = typeof data === 'object' ? data : {}; + let result = new SampleResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.samples) { + data["Samples"] = {}; + for (let key in this.samples) { + if (this.samples.hasOwnProperty(key)) + data["Samples"][key] = this.samples[key]; + } + } + data["IsTruncated"] = this.isTruncated; + super.toJSON(data); + return data; + } +} + +export interface ISampleResult extends IDistResult { + samples?: { [key: string]: { [key: string]: number; }; } | undefined; + isTruncated?: boolean | undefined; +} + +export class ResultParameters extends UniqueJson implements IResultParameters { + operationReference?: IOperationReference | undefined; + stopOperation?: boolean | undefined; + + protected _discriminator: string; + + constructor(data?: IResultParameters) { + super(data); + this._discriminator = "ResultParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.operationReference = data["OperationReference"] ? IOperationReference.fromJS(data["OperationReference"]) : undefined; + this.stopOperation = data["StopOperation"]; + } + } + + static fromJS(data: any): ResultParameters { + data = typeof data === 'object' ? data : {}; + if (data["discriminator"] === "RecommenderResultParameters") { + let result = new RecommenderResultParameters(); + result.init(data); + return result; + } + let result = new ResultParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["discriminator"] = this._discriminator; + data["OperationReference"] = this.operationReference ? this.operationReference.toJSON() : undefined; + data["StopOperation"] = this.stopOperation; + super.toJSON(data); + return data; + } +} + +export interface IResultParameters extends IUniqueJson { + operationReference?: IOperationReference | undefined; + stopOperation?: boolean | undefined; +} + +export class RecommenderResultParameters extends ResultParameters implements IRecommenderResultParameters { + from?: number | undefined; + to?: number | undefined; + pValueSorting?: Sorting | undefined; + effectSizeFilter?: EffectSize | undefined; + + constructor(data?: IRecommenderResultParameters) { + super(data); + this._discriminator = "RecommenderResultParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.from = data["From"]; + this.to = data["To"]; + this.pValueSorting = data["PValueSorting"]; + this.effectSizeFilter = data["EffectSizeFilter"]; + } + } + + static fromJS(data: any): RecommenderResultParameters { + data = typeof data === 'object' ? data : {}; + let result = new RecommenderResultParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["From"] = this.from; + data["To"] = this.to; + data["PValueSorting"] = this.pValueSorting; + data["EffectSizeFilter"] = this.effectSizeFilter; + super.toJSON(data); + return data; + } +} + +export interface IRecommenderResultParameters extends IResultParameters { + from?: number | undefined; + to?: number | undefined; + pValueSorting?: Sorting | undefined; + effectSizeFilter?: EffectSize | undefined; +} + +export enum Sorting { + Ascending = "Ascending", + Descending = "Descending", +} + +export class AddComparisonParameters extends ModelOperationParameters implements IAddComparisonParameters { + modelId?: ModelId | undefined; + comparisonOrder?: number | undefined; + childOperationParameters?: OperationParameters[] | undefined; + isCachable?: boolean | undefined; + + constructor(data?: IAddComparisonParameters) { + super(data); + this._discriminator = "AddComparisonParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.modelId = data["ModelId"] ? ModelId.fromJS(data["ModelId"]) : undefined; + this.comparisonOrder = data["ComparisonOrder"]; + if (data["ChildOperationParameters"] && data["ChildOperationParameters"].constructor === Array) { + this.childOperationParameters = []; + for (let item of data["ChildOperationParameters"]) + this.childOperationParameters.push(OperationParameters.fromJS(item)); + } + this.isCachable = data["IsCachable"]; + } + } + + static fromJS(data: any): AddComparisonParameters { + data = typeof data === 'object' ? data : {}; + let result = new AddComparisonParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["ModelId"] = this.modelId ? this.modelId.toJSON() : undefined; + data["ComparisonOrder"] = this.comparisonOrder; + if (this.childOperationParameters && this.childOperationParameters.constructor === Array) { + data["ChildOperationParameters"] = []; + for (let item of this.childOperationParameters) + data["ChildOperationParameters"].push(item.toJSON()); + } + data["IsCachable"] = this.isCachable; + super.toJSON(data); + return data; + } +} + +export interface IAddComparisonParameters extends IModelOperationParameters { + modelId?: ModelId | undefined; + comparisonOrder?: number | undefined; + childOperationParameters?: OperationParameters[] | undefined; + isCachable?: boolean | undefined; +} + +export class CDFResult extends DistResult implements ICDFResult { + cDF?: { [key: string]: number; } | undefined; + + constructor(data?: ICDFResult) { + super(data); + this._discriminator = "CDFResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["CDF"]) { + this.cDF = {}; + for (let key in data["CDF"]) { + if (data["CDF"].hasOwnProperty(key)) + this.cDF[key] = data["CDF"][key]; + } + } + } + } + + static fromJS(data: any): CDFResult { + data = typeof data === 'object' ? data : {}; + let result = new CDFResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.cDF) { + data["CDF"] = {}; + for (let key in this.cDF) { + if (this.cDF.hasOwnProperty(key)) + data["CDF"][key] = this.cDF[key]; + } + } + super.toJSON(data); + return data; + } +} + +export interface ICDFResult extends IDistResult { + cDF?: { [key: string]: number; } | undefined; +} + +export class ChiSquaredTestResult extends HypothesisTestResult implements IChiSquaredTestResult { + hs_aligned?: TupleOfDoubleAndDouble[] | undefined; + + constructor(data?: IChiSquaredTestResult) { + super(data); + this._discriminator = "ChiSquaredTestResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["hs_aligned"] && data["hs_aligned"].constructor === Array) { + this.hs_aligned = []; + for (let item of data["hs_aligned"]) + this.hs_aligned.push(TupleOfDoubleAndDouble.fromJS(item)); + } + } + } + + static fromJS(data: any): ChiSquaredTestResult { + data = typeof data === 'object' ? data : {}; + let result = new ChiSquaredTestResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.hs_aligned && this.hs_aligned.constructor === Array) { + data["hs_aligned"] = []; + for (let item of this.hs_aligned) + data["hs_aligned"].push(item.toJSON()); + } + super.toJSON(data); + return data; + } +} + +export interface IChiSquaredTestResult extends IHypothesisTestResult { + hs_aligned?: TupleOfDoubleAndDouble[] | undefined; +} + +export class CorrelationTestResult extends HypothesisTestResult implements ICorrelationTestResult { + degreeOfFreedom?: number | undefined; + sampleCorrelationCoefficient?: number | undefined; + distResult?: EmpiricalDistResult | undefined; + + constructor(data?: ICorrelationTestResult) { + super(data); + this._discriminator = "CorrelationTestResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.degreeOfFreedom = data["DegreeOfFreedom"]; + this.sampleCorrelationCoefficient = data["SampleCorrelationCoefficient"]; + this.distResult = data["DistResult"] ? EmpiricalDistResult.fromJS(data["DistResult"]) : undefined; + } + } + + static fromJS(data: any): CorrelationTestResult { + data = typeof data === 'object' ? data : {}; + let result = new CorrelationTestResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["DegreeOfFreedom"] = this.degreeOfFreedom; + data["SampleCorrelationCoefficient"] = this.sampleCorrelationCoefficient; + data["DistResult"] = this.distResult ? this.distResult.toJSON() : undefined; + super.toJSON(data); + return data; + } +} + +export interface ICorrelationTestResult extends IHypothesisTestResult { + degreeOfFreedom?: number | undefined; + sampleCorrelationCoefficient?: number | undefined; + distResult?: EmpiricalDistResult | undefined; +} + +export class EmpiricalDistResult extends DistResult implements IEmpiricalDistResult { + marginals?: AttributeParameters[] | undefined; + marginalDistParameters?: { [key: string]: DistParameter; } | undefined; + jointDistParameter?: JointDistParameter | undefined; + + constructor(data?: IEmpiricalDistResult) { + super(data); + this._discriminator = "EmpiricalDistResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["Marginals"] && data["Marginals"].constructor === Array) { + this.marginals = []; + for (let item of data["Marginals"]) + this.marginals.push(AttributeParameters.fromJS(item)); + } + if (data["MarginalDistParameters"]) { + this.marginalDistParameters = {}; + for (let key in data["MarginalDistParameters"]) { + if (data["MarginalDistParameters"].hasOwnProperty(key)) + this.marginalDistParameters[key] = data["MarginalDistParameters"][key] ? DistParameter.fromJS(data["MarginalDistParameters"][key]) : new DistParameter(); + } + } + this.jointDistParameter = data["JointDistParameter"] ? JointDistParameter.fromJS(data["JointDistParameter"]) : undefined; + } + } + + static fromJS(data: any): EmpiricalDistResult { + data = typeof data === 'object' ? data : {}; + let result = new EmpiricalDistResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.marginals && this.marginals.constructor === Array) { + data["Marginals"] = []; + for (let item of this.marginals) + data["Marginals"].push(item.toJSON()); + } + if (this.marginalDistParameters) { + data["MarginalDistParameters"] = {}; + for (let key in this.marginalDistParameters) { + if (this.marginalDistParameters.hasOwnProperty(key)) + data["MarginalDistParameters"][key] = this.marginalDistParameters[key]; + } + } + data["JointDistParameter"] = this.jointDistParameter ? this.jointDistParameter.toJSON() : undefined; + super.toJSON(data); + return data; + } +} + +export interface IEmpiricalDistResult extends IDistResult { + marginals?: AttributeParameters[] | undefined; + marginalDistParameters?: { [key: string]: DistParameter; } | undefined; + jointDistParameter?: JointDistParameter | undefined; +} + +export class DistParameter implements IDistParameter { + mean?: number | undefined; + moment2?: number | undefined; + variance?: number | undefined; + varianceEstimate?: number | undefined; + min?: number | undefined; + max?: number | undefined; + + constructor(data?: IDistParameter) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.mean = data["Mean"]; + this.moment2 = data["Moment2"]; + this.variance = data["Variance"]; + this.varianceEstimate = data["VarianceEstimate"]; + this.min = data["Min"]; + this.max = data["Max"]; + } + } + + static fromJS(data: any): DistParameter { + data = typeof data === 'object' ? data : {}; + let result = new DistParameter(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Mean"] = this.mean; + data["Moment2"] = this.moment2; + data["Variance"] = this.variance; + data["VarianceEstimate"] = this.varianceEstimate; + data["Min"] = this.min; + data["Max"] = this.max; + return data; + } +} + +export interface IDistParameter { + mean?: number | undefined; + moment2?: number | undefined; + variance?: number | undefined; + varianceEstimate?: number | undefined; + min?: number | undefined; + max?: number | undefined; +} + +export class JointDistParameter implements IJointDistParameter { + jointDist?: DistParameter | undefined; + covariance?: number | undefined; + + constructor(data?: IJointDistParameter) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.jointDist = data["JointDist"] ? DistParameter.fromJS(data["JointDist"]) : undefined; + this.covariance = data["Covariance"]; + } + } + + static fromJS(data: any): JointDistParameter { + data = typeof data === 'object' ? data : {}; + let result = new JointDistParameter(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["JointDist"] = this.jointDist ? this.jointDist.toJSON() : undefined; + data["Covariance"] = this.covariance; + return data; + } +} + +export interface IJointDistParameter { + jointDist?: DistParameter | undefined; + covariance?: number | undefined; +} + +export enum DistributionType { + Continuous = 0, + Discrete = 1, +} + +export abstract class DistributionTypeExtension implements IDistributionTypeExtension { + + constructor(data?: IDistributionTypeExtension) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + } + } + + static fromJS(data: any): DistributionTypeExtension { + data = typeof data === 'object' ? data : {}; + throw new Error("The abstract class 'DistributionTypeExtension' cannot be instantiated."); + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + return data; + } +} + +export interface IDistributionTypeExtension { +} + +export class GetModelStateParameters extends ModelOperationParameters implements IGetModelStateParameters { + modelId?: ModelId | undefined; + comparisonIds?: ComparisonId[] | undefined; + riskControlType?: RiskControlType | undefined; + + constructor(data?: IGetModelStateParameters) { + super(data); + this._discriminator = "GetModelStateParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.modelId = data["ModelId"] ? ModelId.fromJS(data["ModelId"]) : undefined; + if (data["ComparisonIds"] && data["ComparisonIds"].constructor === Array) { + this.comparisonIds = []; + for (let item of data["ComparisonIds"]) + this.comparisonIds.push(ComparisonId.fromJS(item)); + } + this.riskControlType = data["RiskControlType"]; + } + } + + static fromJS(data: any): GetModelStateParameters { + data = typeof data === 'object' ? data : {}; + let result = new GetModelStateParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["ModelId"] = this.modelId ? this.modelId.toJSON() : undefined; + if (this.comparisonIds && this.comparisonIds.constructor === Array) { + data["ComparisonIds"] = []; + for (let item of this.comparisonIds) + data["ComparisonIds"].push(item.toJSON()); + } + data["RiskControlType"] = this.riskControlType; + super.toJSON(data); + return data; + } +} + +export interface IGetModelStateParameters extends IModelOperationParameters { + modelId?: ModelId | undefined; + comparisonIds?: ComparisonId[] | undefined; + riskControlType?: RiskControlType | undefined; +} + +export class KSTestResult extends HypothesisTestResult implements IKSTestResult { + + constructor(data?: IKSTestResult) { + super(data); + this._discriminator = "KSTestResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + } + } + + static fromJS(data: any): KSTestResult { + data = typeof data === 'object' ? data : {}; + let result = new KSTestResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + super.toJSON(data); + return data; + } +} + +export interface IKSTestResult extends IHypothesisTestResult { +} + +export class ModelWealthParameters extends UniqueJson implements IModelWealthParameters { + modelId?: ModelId | undefined; + riskControlType?: RiskControlType | undefined; + + constructor(data?: IModelWealthParameters) { + super(data); + } + + init(data?: any) { + super.init(data); + if (data) { + this.modelId = data["ModelId"] ? ModelId.fromJS(data["ModelId"]) : undefined; + this.riskControlType = data["RiskControlType"]; + } + } + + static fromJS(data: any): ModelWealthParameters { + data = typeof data === 'object' ? data : {}; + let result = new ModelWealthParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["ModelId"] = this.modelId ? this.modelId.toJSON() : undefined; + data["RiskControlType"] = this.riskControlType; + super.toJSON(data); + return data; + } +} + +export interface IModelWealthParameters extends IUniqueJson { + modelId?: ModelId | undefined; + riskControlType?: RiskControlType | undefined; +} + +export class RootMeanSquareTestResult extends HypothesisTestResult implements IRootMeanSquareTestResult { + simulationCount?: number | undefined; + extremeSimulationCount?: number | undefined; + + constructor(data?: IRootMeanSquareTestResult) { + super(data); + this._discriminator = "RootMeanSquareTestResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.simulationCount = data["SimulationCount"]; + this.extremeSimulationCount = data["ExtremeSimulationCount"]; + } + } + + static fromJS(data: any): RootMeanSquareTestResult { + data = typeof data === 'object' ? data : {}; + let result = new RootMeanSquareTestResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["SimulationCount"] = this.simulationCount; + data["ExtremeSimulationCount"] = this.extremeSimulationCount; + super.toJSON(data); + return data; + } +} + +export interface IRootMeanSquareTestResult extends IHypothesisTestResult { + simulationCount?: number | undefined; + extremeSimulationCount?: number | undefined; +} + +export class TTestResult extends HypothesisTestResult implements ITTestResult { + degreeOfFreedom?: number | undefined; + distResults?: EmpiricalDistResult[] | undefined; + + constructor(data?: ITTestResult) { + super(data); + this._discriminator = "TTestResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.degreeOfFreedom = data["DegreeOfFreedom"]; + if (data["DistResults"] && data["DistResults"].constructor === Array) { + this.distResults = []; + for (let item of data["DistResults"]) + this.distResults.push(EmpiricalDistResult.fromJS(item)); + } + } + } + + static fromJS(data: any): TTestResult { + data = typeof data === 'object' ? data : {}; + let result = new TTestResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["DegreeOfFreedom"] = this.degreeOfFreedom; + if (this.distResults && this.distResults.constructor === Array) { + data["DistResults"] = []; + for (let item of this.distResults) + data["DistResults"].push(item.toJSON()); + } + super.toJSON(data); + return data; + } +} + +export interface ITTestResult extends IHypothesisTestResult { + degreeOfFreedom?: number | undefined; + distResults?: EmpiricalDistResult[] | undefined; +} + +export enum Sorting2 { + Ascending = 0, + Descending = 1, +} + +export class BinLabel implements IBinLabel { + value?: number | undefined; + minValue?: number | undefined; + maxValue?: number | undefined; + label?: string | undefined; + + constructor(data?: IBinLabel) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.value = data["Value"]; + this.minValue = data["MinValue"]; + this.maxValue = data["MaxValue"]; + this.label = data["Label"]; + } + } + + static fromJS(data: any): BinLabel { + data = typeof data === 'object' ? data : {}; + let result = new BinLabel(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Value"] = this.value; + data["MinValue"] = this.minValue; + data["MaxValue"] = this.maxValue; + data["Label"] = this.label; + return data; + } +} + +export interface IBinLabel { + value?: number | undefined; + minValue?: number | undefined; + maxValue?: number | undefined; + label?: string | undefined; +} + +export class PreProcessedString implements IPreProcessedString { + value?: string | undefined; + id?: number | undefined; + stringLookup?: { [key: string]: number; } | undefined; + indexLookup?: { [key: string]: string; } | undefined; + + constructor(data?: IPreProcessedString) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.value = data["Value"]; + this.id = data["Id"]; + if (data["StringLookup"]) { + this.stringLookup = {}; + for (let key in data["StringLookup"]) { + if (data["StringLookup"].hasOwnProperty(key)) + this.stringLookup[key] = data["StringLookup"][key]; + } + } + if (data["IndexLookup"]) { + this.indexLookup = {}; + for (let key in data["IndexLookup"]) { + if (data["IndexLookup"].hasOwnProperty(key)) + this.indexLookup[key] = data["IndexLookup"][key]; + } + } + } + } + + static fromJS(data: any): PreProcessedString { + data = typeof data === 'object' ? data : {}; + let result = new PreProcessedString(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Value"] = this.value; + data["Id"] = this.id; + if (this.stringLookup) { + data["StringLookup"] = {}; + for (let key in this.stringLookup) { + if (this.stringLookup.hasOwnProperty(key)) + data["StringLookup"][key] = this.stringLookup[key]; + } + } + if (this.indexLookup) { + data["IndexLookup"] = {}; + for (let key in this.indexLookup) { + if (this.indexLookup.hasOwnProperty(key)) + data["IndexLookup"][key] = this.indexLookup[key]; + } + } + return data; + } +} + +export interface IPreProcessedString { + value?: string | undefined; + id?: number | undefined; + stringLookup?: { [key: string]: number; } | undefined; + indexLookup?: { [key: string]: string; } | undefined; +} + +export class BitSet implements IBitSet { + length?: number | undefined; + size?: number | undefined; + + constructor(data?: IBitSet) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + this.length = data["Length"]; + this.size = data["Size"]; + } + } + + static fromJS(data: any): BitSet { + data = typeof data === 'object' ? data : {}; + let result = new BitSet(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Length"] = this.length; + data["Size"] = this.size; + return data; + } +} + +export interface IBitSet { + length?: number | undefined; + size?: number | undefined; +} + +export class DateTimeUtil implements IDateTimeUtil { + + constructor(data?: IDateTimeUtil) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(data?: any) { + if (data) { + } + } + + static fromJS(data: any): DateTimeUtil { + data = typeof data === 'object' ? data : {}; + let result = new DateTimeUtil(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + return data; + } +} + +export interface IDateTimeUtil { +} + +export class FrequentItemsetOperationParameters extends DistOperationParameters implements IFrequentItemsetOperationParameters { + filter?: string | undefined; + attributeParameters?: AttributeParameters[] | undefined; + attributeCodeParameters?: AttributeCaclculatedParameters[] | undefined; + + constructor(data?: IFrequentItemsetOperationParameters) { + super(data); + this._discriminator = "FrequentItemsetOperationParameters"; + } + + init(data?: any) { + super.init(data); + if (data) { + this.filter = data["Filter"]; + if (data["AttributeParameters"] && data["AttributeParameters"].constructor === Array) { + this.attributeParameters = []; + for (let item of data["AttributeParameters"]) + this.attributeParameters.push(AttributeParameters.fromJS(item)); + } + if (data["AttributeCodeParameters"] && data["AttributeCodeParameters"].constructor === Array) { + this.attributeCodeParameters = []; + for (let item of data["AttributeCodeParameters"]) + this.attributeCodeParameters.push(AttributeCaclculatedParameters.fromJS(item)); + } + } + } + + static fromJS(data: any): FrequentItemsetOperationParameters { + data = typeof data === 'object' ? data : {}; + let result = new FrequentItemsetOperationParameters(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["Filter"] = this.filter; + if (this.attributeParameters && this.attributeParameters.constructor === Array) { + data["AttributeParameters"] = []; + for (let item of this.attributeParameters) + data["AttributeParameters"].push(item.toJSON()); + } + if (this.attributeCodeParameters && this.attributeCodeParameters.constructor === Array) { + data["AttributeCodeParameters"] = []; + for (let item of this.attributeCodeParameters) + data["AttributeCodeParameters"].push(item.toJSON()); + } + super.toJSON(data); + return data; + } +} + +export interface IFrequentItemsetOperationParameters extends IDistOperationParameters { + filter?: string | undefined; + attributeParameters?: AttributeParameters[] | undefined; + attributeCodeParameters?: AttributeCaclculatedParameters[] | undefined; +} + +export class FrequentItemsetResult extends Result implements IFrequentItemsetResult { + frequentItems?: { [key: string]: number; } | undefined; + + constructor(data?: IFrequentItemsetResult) { + super(data); + this._discriminator = "FrequentItemsetResult"; + } + + init(data?: any) { + super.init(data); + if (data) { + if (data["FrequentItems"]) { + this.frequentItems = {}; + for (let key in data["FrequentItems"]) { + if (data["FrequentItems"].hasOwnProperty(key)) + this.frequentItems[key] = data["FrequentItems"][key]; + } + } + } + } + + static fromJS(data: any): FrequentItemsetResult { + data = typeof data === 'object' ? data : {}; + let result = new FrequentItemsetResult(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.frequentItems) { + data["FrequentItems"] = {}; + for (let key in this.frequentItems) { + if (this.frequentItems.hasOwnProperty(key)) + data["FrequentItems"][key] = this.frequentItems[key]; + } + } + super.toJSON(data); + return data; + } +} + +export interface IFrequentItemsetResult extends IResult { + frequentItems?: { [key: string]: number; } | undefined; +} + diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx index 8a52a501c..ac51a7d87 100644 --- a/src/client/views/Main.tsx +++ b/src/client/views/Main.tsx @@ -43,6 +43,8 @@ import { CurrentUserUtils } from '../../server/authentication/models/current_use import { Field, Opt } from '../../fields/Field'; import { ListField } from '../../fields/ListField'; import { map } from 'bluebird'; +import { Gateway, Settings } from '../northstar/manager/Gateway'; +import { Catalog } from '../northstar/model/idea/idea'; @observer export class Main extends React.Component { @@ -52,6 +54,7 @@ export class Main extends React.Component { @observable private userWorkspaces: Document[] = []; @observable public pwidth: number = 0; @observable public pheight: number = 0; + @observable private _northstarCatalog: Catalog | undefined = undefined; public mainDocId: string | undefined; private currentUser?: DashUserModel; @@ -65,7 +68,9 @@ export class Main extends React.Component { if (window.location.pathname !== RouteStore.home) { let pathname = window.location.pathname.split("/"); this.mainDocId = pathname[pathname.length - 1]; - } + }; + + this.initializeNorthstar(); CurrentUserUtils.loadCurrentUser(); @@ -82,9 +87,26 @@ export class Main extends React.Component { library.add(faMusic); this.initEventListeners(); - Documents.initProtos(() => { - this.initAuthenticationRouters(); + Documents.initProtos(() => this.initAuthenticationRouters()); + } + + @action SetNorthstarCatalog(ctlog: Catalog) { + this._northstarCatalog = ctlog; + if (this._northstarCatalog) { + console.log("CATALOG " + this._northstarCatalog.schemas); + } + } + async initializeNorthstar(): Promise { + let envPath = "assets/env.json"; + const response = await fetch(envPath, { + redirect: "follow", + method: "GET", + credentials: "include" }); + const env = await response.json(); + Settings.Instance.Update(env); + let cat = Gateway.Instance.ClearCatalog(); + cat.then(async () => this.SetNorthstarCatalog(await Gateway.Instance.GetCatalog())); } onHistory = () => { diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx index 50f5e9618..062babe58 100644 --- a/src/client/views/collections/CollectionSchemaView.tsx +++ b/src/client/views/collections/CollectionSchemaView.tsx @@ -9,7 +9,6 @@ import { Field, Opt } from "../../../fields/Field"; import { KeyStore } from "../../../fields/KeyStore"; import { CompileScript, ToField } from "../../util/Scripting"; import { Transform } from "../../util/Transform"; -import { ContextMenu } from "../ContextMenu"; import { EditableView } from "../EditableView"; import { DocumentView } from "../nodes/DocumentView"; import { FieldView, FieldViewProps } from "../nodes/FieldView"; @@ -27,8 +26,7 @@ import { ListField } from "../../../fields/ListField"; @observer class KeyToggle extends React.Component<{ keyId: string, checked: boolean, toggle: (key: Key) => void }> { - @observable - key: Key | undefined; + @observable key: Key | undefined; componentWillReceiveProps() { Server.GetField(this.props.keyId, action((field: Opt) => { diff --git a/src/server/index.ts b/src/server/index.ts index 6226dbfe2..d1eb6847d 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -18,7 +18,7 @@ import { getLogin, postLogin, getSignup, postSignup, getLogout, postReset, getFo const config = require('../../webpack.config'); const compiler = webpack(config); const port = 1050; // default port to listen -const serverPort = 1234; +const serverPort = 4321; import * as expressValidator from 'express-validator'; import expressFlash = require('express-flash'); import flash = require('connect-flash'); diff --git a/webpack.config.js b/webpack.config.js index ff03181c9..5ba9dd4b5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -77,7 +77,7 @@ module.exports = { compress: false, host: "localhost", contentBase: path.join(__dirname, 'deploy'), - port: 1234, + port: 4321, hot: true, https: false, overlay: { -- cgit v1.2.3-70-g09d2