diff options
author | madelinegr <mgriswold99@gmail.com> | 2019-02-12 18:55:11 -0500 |
---|---|---|
committer | madelinegr <mgriswold99@gmail.com> | 2019-02-12 18:55:11 -0500 |
commit | 1d667d19f5402dc9f9069e0a57008dac96f6de2a (patch) | |
tree | 59572ebc84ae0dea9780c96a6d43a811a21fed10 /src/stores/NodeCollectionStore.ts | |
parent | 7a93f60c9529e5d175e617fc7c07145a9b33e572 (diff) |
set up web box classes
Diffstat (limited to 'src/stores/NodeCollectionStore.ts')
-rw-r--r-- | src/stores/NodeCollectionStore.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/stores/NodeCollectionStore.ts b/src/stores/NodeCollectionStore.ts new file mode 100644 index 000000000..ac4f515f1 --- /dev/null +++ b/src/stores/NodeCollectionStore.ts @@ -0,0 +1,25 @@ +import { computed, observable, action } from "mobx"; +import { NodeStore } from "./NodeStore"; +import { Document } from "../fields/Document"; + +export class NodeCollectionStore extends NodeStore { + + @observable + public Scale: number = 1; + + @observable + public Nodes: NodeStore[] = new Array<NodeStore>(); + + @observable + public Docs: Document[] = []; + + @computed + public get Transform(): string { + return "translate(" + this.X + "px," + this.Y + "px) scale(" + this.Scale + "," + this.Scale + ")"; + } + + @action + public AddNodes(stores: NodeStore[]): void { + stores.forEach(store => this.Nodes.push(store)); + } +}
\ No newline at end of file |