aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/documents')
-rw-r--r--src/client/documents/DocumentTypes.ts3
-rw-r--r--src/client/documents/Documents.ts10
2 files changed, 11 insertions, 2 deletions
diff --git a/src/client/documents/DocumentTypes.ts b/src/client/documents/DocumentTypes.ts
index 20dbc6f25..58b120e7d 100644
--- a/src/client/documents/DocumentTypes.ts
+++ b/src/client/documents/DocumentTypes.ts
@@ -21,7 +21,8 @@ export enum DocumentType {
PDFANNO = "pdfanno", // pdf text selection (could be just a collection?)
DATE = "date", // calendar view of a date
SCRIPTING = "script", // script editor
- EQUATION = "equation", // equation edtior
+ EQUATION = "equation", // equation editor
+ FUNCPLOT = "funcplot", // function plotter
// special purpose wrappers that either take no data or are compositions of lower level types
LINK = "link", // link (view of a document that acts as a link)
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;