From 0772ae0522be1fde19362ab7bb0808e13b4f382c Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 29 Mar 2024 00:16:58 -0400 Subject: fixed equation box resizing to stay in place. fixedlightbox to have a black foreground color so equations can be seen. fixed function plots to translate more of the math syntax --- src/client/views/nodes/FunctionPlotBox.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/client/views/nodes/FunctionPlotBox.tsx') diff --git a/src/client/views/nodes/FunctionPlotBox.tsx b/src/client/views/nodes/FunctionPlotBox.tsx index 67445e552..a86bdbd79 100644 --- a/src/client/views/nodes/FunctionPlotBox.tsx +++ b/src/client/views/nodes/FunctionPlotBox.tsx @@ -51,7 +51,16 @@ export class FunctionPlotBox extends ViewBoxAnnotatableComponent .map(d => LinkManager.getOppositeAnchor(d, this.Document)) .filter(d => d) .map(d => d!); - return links.concat(DocListCast(this.dataDoc[this.fieldKey])).map(doc => StrCast(doc.text, 'x^2').replace(/\\frac\{(.*)\}\{(.*)\}/, '($1/$2)')); + const funcs = links.concat(DocListCast(this.dataDoc[this.fieldKey])).map(doc => + StrCast(doc.text, 'x^2') + .replace(/\\sqrt/g, 'sqrt') + .replace(/\\frac\{(.*)\}\{(.*)\}/g, '($1/$2)') + .replace(/\\left/g, '') + .replace(/\\right/g, '') + .replace(/\{/g, '') + .replace(/\}/g, '') + ); + return funcs; } createGraph = (ele?: HTMLDivElement) => { this._plotEle = ele || this._plotEle; -- cgit v1.2.3-70-g09d2