aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/Main.tsx
diff options
context:
space:
mode:
authorlaurawilsonri <laura_wilson@brown.edu>2019-02-16 15:45:32 -0500
committerlaurawilsonri <laura_wilson@brown.edu>2019-02-16 15:45:32 -0500
commit784eb6e6ba1daf00d3c74239f88669b669e9739c (patch)
treea036e639a901f2b7a6f00b892448b5a4a4609641 /src/client/views/Main.tsx
parentc835f47a32336c12e6ad7497b72694bb06dc2487 (diff)
parent3f98d6ec6050e7faa15179871f0d9669c1188a78 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into improveText
Diffstat (limited to 'src/client/views/Main.tsx')
-rw-r--r--src/client/views/Main.tsx17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index 31a709744..aec9618ae 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -13,6 +13,7 @@ import "./Main.scss";
import { ContextMenu } from './ContextMenu';
import { DocumentView } from './nodes/DocumentView';
import { ImageField } from '../../fields/ImageField';
+import { Transform } from '../util/Transform';
configure({
@@ -39,17 +40,18 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) {
//runInAction(() =>
{
- let doc1 = Documents.TextDocument({ title: "hello" });
+ let doc1 = Documents.TextDocument({ title: "hello", width: 400, height: 300 });
let doc2 = doc1.MakeDelegate();
doc2.Set(KS.X, new NumberField(150));
doc2.Set(KS.Y, new NumberField(20));
let doc3 = Documents.ImageDocument("https://psmag.com/.image/t_share/MTMyNzc2NzM1MDY1MjgzMDM4/shutterstock_151341212jpg.jpg", {
- x: 450, y: 100, title: "cat 1"
+ x: 450, y: 100, title: "dog", width: 606, height: 386, nativeWidth: 606, nativeHeight: 386
});
//doc3.Set(KeyStore.Data, new ImageField);
const schemaDocs = Array.from(Array(5).keys()).map(v => Documents.ImageDocument("https://psmag.com/.image/t_share/MTMyNzc2NzM1MDY1MjgzMDM4/shutterstock_151341212jpg.jpg", {
- x: 50 + 100 * v, y: 50, width: 100, height: 100, title: "cat" + v
+ x: 50 + 100 * v, y: 50, width: 100, height: 100, title: "cat" + v, nativeWidth: 606, nativeHeight: 386
}));
+ schemaDocs.push(doc3);
schemaDocs[0].SetData(KS.Author, "Tyler", TextField);
schemaDocs[4].SetData(KS.Author, "Bob", TextField);
schemaDocs.push(doc2);
@@ -61,7 +63,7 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) {
// let doc5 = Documents.ImageDocument("https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg", {
// x: 650, y: 500, width: 600, height: 600, title: "cat 2"
// });
- let docset2 = [doc4, doc1, doc3];
+ let docset2 = [doc3, doc4, doc2];
let doc6 = Documents.CollectionDocument(docset2, {
x: 350, y: 100, width: 600, height: 600, title: "docking collection"
});
@@ -75,7 +77,7 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) {
mainNodes.Data.push(doc3);
// mainNodes.Data.push(doc5);
// mainNodes.Data.push(doc1);
- //mainNodes.Data.push(doc2);
+ // mainNodes.Data.push(doc2);
mainNodes.Data.push(doc6);
mainContainer.Set(KeyStore.Data, mainNodes);
}
@@ -84,7 +86,10 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) {
ReactDOM.render((
<div style={{ position: "absolute", width: "100%", height: "100%" }}>
- <DocumentView Document={mainContainer} Scaling={1} ContainingCollectionView={undefined} DocumentView={undefined} />
+ <DocumentView Document={mainContainer}
+ AddDocument={undefined} RemoveDocument={undefined} GetTransform={() => Transform.Identity}
+ ParentScaling={1}
+ ContainingCollectionView={undefined} DocumentView={undefined} />
<DocumentDecorations />
<ContextMenu />
</div>),