diff options
| author | bobzel <zzzman@gmail.com> | 2021-03-03 10:32:12 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2021-03-03 10:32:12 -0500 |
| commit | a6e5fdd00fa4f8adcc67d709e95391d3ccaaaf52 (patch) | |
| tree | 1827d029a156bf817136636125fc89d3bd6837d7 /src/client/documents | |
| parent | 1b481cd441cc8bb200906b246b43e4bc5dc53b4e (diff) | |
added functionPlot. trying to make fitWidth make sense everywhere (lightbox, stacking panels with autosize columns, etc).
Diffstat (limited to 'src/client/documents')
| -rw-r--r-- | src/client/documents/DocumentTypes.ts | 3 | ||||
| -rw-r--r-- | src/client/documents/Documents.ts | 10 |
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; |
