diff options
author | bobzel <zzzman@gmail.com> | 2024-03-29 00:16:58 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-03-29 00:16:58 -0400 |
commit | 0772ae0522be1fde19362ab7bb0808e13b4f382c (patch) | |
tree | ace0520ea131fe85297286d3185d2e00ae0ef93f /src/client/views/nodes/FunctionPlotBox.tsx | |
parent | 82a74549a6b1c942fabaf8396c450b70d65e81dd (diff) |
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
Diffstat (limited to 'src/client/views/nodes/FunctionPlotBox.tsx')
-rw-r--r-- | src/client/views/nodes/FunctionPlotBox.tsx | 11 |
1 files changed, 10 insertions, 1 deletions
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<FieldViewProps> .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; |