From a6e5fdd00fa4f8adcc67d709e95391d3ccaaaf52 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 3 Mar 2021 10:32:12 -0500 Subject: added functionPlot. trying to make fitWidth make sense everywhere (lightbox, stacking panels with autosize columns, etc). --- src/client/documents/Documents.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/client/documents/Documents.ts') 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, 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; -- cgit v1.2.3-70-g09d2