diff options
author | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-03-03 11:06:54 -0500 |
---|---|---|
committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-03-03 11:06:54 -0500 |
commit | 76da783c2174cba248a058d5bcac5651c29541cd (patch) | |
tree | b1d18cd09689264f7767898b8ef9ef4d6dd22da4 /src/client/documents/Documents.ts | |
parent | 067377e138254c72ad4cf3609b05d5aab2b71a26 (diff) | |
parent | a6e5fdd00fa4f8adcc67d709e95391d3ccaaaf52 (diff) |
:(
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r-- | src/client/documents/Documents.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index f87c7185c..ca5ee9cbd 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -58,6 +58,7 @@ import { SearchBox } from "../views/search/SearchBox"; import { DashWebRTCVideo } from "../views/webcam/DashWebRTCVideo"; import { DocumentType } from "./DocumentTypes"; import { EquationBox } from "../views/nodes/EquationBox"; +import { FunctionPlotBox } from "../views/nodes/FunctionPlotBox"; const path = require('path'); const defaultNativeImageDim = Number(DFLT_IMAGE_NATIVE_DIM.replace("px", "")); @@ -379,6 +380,9 @@ export namespace Docs { [DocumentType.EQUATION, { layout: { view: EquationBox, dataField: defaultDataKey }, }], + [DocumentType.FUNCPLOT, { + layout: { view: FunctionPlotBox, dataField: defaultDataKey }, + }], [DocumentType.BUTTON, { layout: { view: LabelBox, dataField: "onClick" }, }], @@ -899,6 +903,10 @@ export namespace Docs { return InstanceFromProto(Prototypes.get(DocumentType.EQUATION), undefined, { ...(options || {}) }); } + export function FunctionPlotDocument(documents: Array<Doc>, options?: DocumentOptions) { + return InstanceFromProto(Prototypes.get(DocumentType.FUNCPLOT), new List(documents), { ...(options || {}) }); + } + export function ButtonDocument(options?: DocumentOptions) { // const btn = InstanceFromProto(Prototypes.get(DocumentType.BUTTON), undefined, { ...(options || {}), "onClick-rawScript": "-script-" }); // btn.layoutKey = "layout_onClick"; @@ -1229,7 +1237,7 @@ export namespace DocUtils { icon: "eye" }); ContextMenu.Instance.addItem({ - description: ":math", event: () => { + description: ":=math", event: () => { const created = Docs.Create.EquationDocument(); if (created) { created.author = Doc.CurrentUserEmail; |