diff options
author | bob <bcz@cs.brown.edu> | 2019-02-25 12:39:11 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-02-25 12:39:11 -0500 |
commit | 067eee9293d1016ce6cbd57274bd7cd7f9660c6f (patch) | |
tree | f08b5dafc556113b91ed2b972c2d06e7ed722b81 /src | |
parent | c439f11ba9695703697f7abc53a7cc2fd2d5c1a2 (diff) | |
parent | f8fe6307622439d23d05a7628b3a91851a54797d (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src')
-rw-r--r-- | src/client/util/Transform.ts | 6 | ||||
-rw-r--r-- | src/debug/Viewer.tsx | 2 | ||||
-rw-r--r-- | src/fields/Document.ts | 2 | ||||
-rw-r--r-- | src/server/index.ts | 6 |
4 files changed, 13 insertions, 3 deletions
diff --git a/src/client/util/Transform.ts b/src/client/util/Transform.ts index 9fd4f7bef..3e1039166 100644 --- a/src/client/util/Transform.ts +++ b/src/client/util/Transform.ts @@ -102,6 +102,12 @@ export class Transform { return [x * this._scale, y * this._scale]; } + transformBounds(x: number, y: number, width: number, height: number): { x: number, y: number, width: number, height: number } { + [x, y] = this.transformPoint(x, y); + [width, height] = this.transformDirection(width, height); + return { x, y, width, height }; + } + inverse = () => { return new Transform(-this._translateX / this._scale, -this._translateY / this._scale, 1 / this._scale) } diff --git a/src/debug/Viewer.tsx b/src/debug/Viewer.tsx index aff77fca3..780e9f8f2 100644 --- a/src/debug/Viewer.tsx +++ b/src/debug/Viewer.tsx @@ -17,7 +17,7 @@ configure({ @observer class FieldViewer extends React.Component<{ field: BasicField<any> }> { render() { - return <span>{this.props.field.Data} ({this.props.field.Id})</span>; + return <span>{JSON.stringify(this.props.field.Data)} ({this.props.field.Id})</span>; } } diff --git a/src/fields/Document.ts b/src/fields/Document.ts index 4e68b3b4d..6193ea56c 100644 --- a/src/fields/Document.ts +++ b/src/fields/Document.ts @@ -17,8 +17,6 @@ export class Document extends Field { super(id) if (save) { - var title = (this._proxies.has(KeyStore.Title.Id) ? "???" : this.Title) + "(" + this.Id + ")"; - console.log("Save " + title); Server.UpdateField(this) } } diff --git a/src/server/index.ts b/src/server/index.ts index f5e66b31b..eb0527ee7 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -31,6 +31,12 @@ const MongoStore = require('connect-mongo')(session); const mongoose = require('mongoose'); const bluebird = require('bluebird'); import { performance } from 'perf_hooks' +import * as fs from 'fs'; +import * as request from 'request' + +const download = (url: string, dest: fs.PathLike) => { + request.get(url).pipe(fs.createWriteStream(dest)); +} const mongoUrl = 'mongodb://localhost:27017/Dash'; // mongoose.Promise = bluebird; |