velo-plot 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -15
- package/dist/ChartCore-AnR_3Xkb.js +7338 -0
- package/dist/ChartCore-AnR_3Xkb.js.map +1 -0
- package/dist/GpuChartRenderer-Dxc0hrQA.js +75 -0
- package/dist/GpuChartRenderer-Dxc0hrQA.js.map +1 -0
- package/dist/{index.core-BmZe2jRQ.js → PluginRegistry-CzMHebYP.js} +19 -33
- package/dist/PluginRegistry-CzMHebYP.js.map +1 -0
- package/dist/angular-hooks.js +1 -1
- package/dist/angular.js +8 -8
- package/dist/{axisFormat-CzumxpCL.js → axisFormat-Sz4WIJfQ.js} +2 -2
- package/dist/{axisFormat-CzumxpCL.js.map → axisFormat-Sz4WIJfQ.js.map} +1 -1
- package/dist/{chartSyncBridge-DbWrwtyP.js → chartSyncBridge-D_rCtbFq.js} +12 -11
- package/dist/{chartSyncBridge-DbWrwtyP.js.map → chartSyncBridge-D_rCtbFq.js.map} +1 -1
- package/dist/core/ChartStatistics.d.ts +1 -1
- package/dist/core/chart/ChartCore.d.ts +12 -17
- package/dist/core/chart/ChartFeatureHooks.d.ts +7 -0
- package/dist/core/chart/chartExportPatch.d.ts +2 -0
- package/dist/core/chart/overlaySeriesRegistry.d.ts +7 -0
- package/dist/core/chart/series/SeriesActions.d.ts +1 -0
- package/dist/core/chart/series/SeriesBufferLite.d.ts +13 -0
- package/dist/core/chart/series/seriesOptionsRegistry.d.ts +8 -0
- package/dist/core/chart/series/seriesTypeRegistry.d.ts +5 -0
- package/dist/createStackedChart-DqcLCFGS.js +1338 -0
- package/dist/createStackedChart-DqcLCFGS.js.map +1 -0
- package/dist/{hooks-CYPCxoZx.js → hooks-DH-3bewj.js} +7 -7
- package/dist/{hooks-CYPCxoZx.js.map → hooks-DH-3bewj.js.map} +1 -1
- package/dist/{index-qunX30Xu.js → index-B7PTX94B.js} +2133 -2133
- package/dist/index-B7PTX94B.js.map +1 -0
- package/dist/{index-BMiZoKmm.js → index-BgrvqltV.js} +67 -67
- package/dist/index-BgrvqltV.js.map +1 -0
- package/dist/index-Cv6ZDLWf.js +521 -0
- package/dist/index-Cv6ZDLWf.js.map +1 -0
- package/dist/index-qhscKTDy.js.map +1 -1
- package/dist/index.core.d.ts +8 -6
- package/dist/index.d.ts +1 -14
- package/dist/plugins/3d.js +3 -1
- package/dist/plugins/3d.js.map +1 -1
- package/dist/plugins/analysis.js.map +1 -1
- package/dist/plugins/createPlugin.d.ts +8 -0
- package/dist/plugins/debug.js +32 -32
- package/dist/plugins/debug.js.map +1 -1
- package/dist/plugins/gpu.js +2033 -209
- package/dist/plugins/gpu.js.map +1 -1
- package/dist/plugins/i18n.js +286 -23
- package/dist/plugins/i18n.js.map +1 -1
- package/dist/plugins/latex.js +766 -207
- package/dist/plugins/latex.js.map +1 -1
- package/dist/plugins/loading/index.d.ts +1 -2
- package/dist/plugins/loading.js +3 -4
- package/dist/plugins/offscreen.js +11 -10
- package/dist/plugins/offscreen.js.map +1 -1
- package/dist/plugins/regression.js +254 -256
- package/dist/plugins/regression.js.map +1 -1
- package/dist/plugins/streaming.js +1 -1
- package/dist/plugins/tools.js +1 -1
- package/dist/react.js +55 -58
- package/dist/react.js.map +1 -1
- package/dist/renderer/NativeWebGLRenderer.d.ts +2 -1
- package/dist/renderer/native/NativeWebGLRenderer.d.ts +5 -1
- package/dist/renderer/native/draw.d.ts +2 -47
- package/dist/renderer/native/drawCore.d.ts +27 -0
- package/dist/renderer/native/drawExtended.d.ts +29 -0
- package/dist/renderer/native/frameRenderExtended.d.ts +1 -0
- package/dist/renderer/native/frameRenderRegistry.d.ts +27 -0
- package/dist/renderer/native/programFactoryCore.d.ts +6 -0
- package/dist/renderer/native/programFactoryExtended.d.ts +4 -0
- package/dist/renderer/native/utils.d.ts +3 -29
- package/dist/renderer/native/utilsCore.d.ts +14 -0
- package/dist/renderer/native/utilsExtended.d.ts +17 -0
- package/dist/renderer/overlaySeriesExtended.d.ts +1 -0
- package/dist/renderer/registerExtendedSeries.d.ts +1 -0
- package/dist/renderer/registerWebGPU.d.ts +2 -0
- package/dist/renderer/seriesBufferExtended.d.ts +4 -0
- package/dist/scientific/index.d.ts +1 -5
- package/dist/scientific/registerScientific.d.ts +1 -0
- package/dist/scientific.js +41 -41
- package/dist/solid.js +56 -59
- package/dist/solid.js.map +1 -1
- package/dist/svelte.js +26 -29
- package/dist/svelte.js.map +1 -1
- package/dist/trading/index.d.ts +1 -4
- package/dist/trading/registerTrading.d.ts +3 -0
- package/dist/trading.js +42 -42
- package/dist/types.d.ts +3 -3
- package/dist/velo-plot.full.js +2212 -1351
- package/dist/velo-plot.full.js.map +1 -1
- package/dist/velo-plot.js +33 -28
- package/dist/velo-plot.js.map +1 -1
- package/dist/vue/index.d.ts +2 -2
- package/dist/vue.js +17 -20
- package/dist/vue.js.map +1 -1
- package/package.json +9 -1
- package/dist/ChartCore-BpzRvN4Y.js +0 -8467
- package/dist/ChartCore-BpzRvN4Y.js.map +0 -1
- package/dist/createStackedChart-Dm-YqUT7.js +0 -756
- package/dist/createStackedChart-Dm-YqUT7.js.map +0 -1
- package/dist/gpuRenderer-BpaMYz-k.js +0 -1848
- package/dist/gpuRenderer-BpaMYz-k.js.map +0 -1
- package/dist/index-BMiZoKmm.js.map +0 -1
- package/dist/index-qunX30Xu.js.map +0 -1
- package/dist/index-x4stH3jD.js +0 -282
- package/dist/index-x4stH3jD.js.map +0 -1
- package/dist/index.core-BmZe2jRQ.js.map +0 -1
- package/dist/mockDatafeed-DHIDPcpX.js +0 -515
- package/dist/mockDatafeed-DHIDPcpX.js.map +0 -1
- package/dist/symbols-DT0eLlpW.js +0 -568
- package/dist/symbols-DT0eLlpW.js.map +0 -1
package/dist/plugins/latex.js
CHANGED
|
@@ -1,115 +1,674 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const B = {
|
|
2
|
+
alpha: "α",
|
|
3
|
+
beta: "β",
|
|
4
|
+
gamma: "γ",
|
|
5
|
+
delta: "δ",
|
|
6
|
+
epsilon: "ε",
|
|
7
|
+
zeta: "ζ",
|
|
8
|
+
eta: "η",
|
|
9
|
+
theta: "θ",
|
|
10
|
+
iota: "ι",
|
|
11
|
+
kappa: "κ",
|
|
12
|
+
lambda: "λ",
|
|
13
|
+
mu: "μ",
|
|
14
|
+
nu: "ν",
|
|
15
|
+
xi: "ξ",
|
|
16
|
+
omicron: "ο",
|
|
17
|
+
pi: "π",
|
|
18
|
+
rho: "ρ",
|
|
19
|
+
sigma: "σ",
|
|
20
|
+
tau: "τ",
|
|
21
|
+
upsilon: "υ",
|
|
22
|
+
phi: "φ",
|
|
23
|
+
chi: "χ",
|
|
24
|
+
psi: "ψ",
|
|
25
|
+
omega: "ω"
|
|
26
|
+
}, F = {
|
|
27
|
+
Alpha: "Α",
|
|
28
|
+
Beta: "Β",
|
|
29
|
+
Gamma: "Γ",
|
|
30
|
+
Delta: "Δ",
|
|
31
|
+
Epsilon: "Ε",
|
|
32
|
+
Zeta: "Ζ",
|
|
33
|
+
Eta: "Η",
|
|
34
|
+
Theta: "Θ",
|
|
35
|
+
Iota: "Ι",
|
|
36
|
+
Kappa: "Κ",
|
|
37
|
+
Lambda: "Λ",
|
|
38
|
+
Mu: "Μ",
|
|
39
|
+
Nu: "Ν",
|
|
40
|
+
Xi: "Ξ",
|
|
41
|
+
Omicron: "Ο",
|
|
42
|
+
Pi: "Π",
|
|
43
|
+
Rho: "Ρ",
|
|
44
|
+
Sigma: "Σ",
|
|
45
|
+
Tau: "Τ",
|
|
46
|
+
Upsilon: "Υ",
|
|
47
|
+
Phi: "Φ",
|
|
48
|
+
Chi: "Χ",
|
|
49
|
+
Psi: "Ψ",
|
|
50
|
+
Omega: "Ω"
|
|
51
|
+
}, X = {
|
|
52
|
+
sum: "∑",
|
|
53
|
+
prod: "∏",
|
|
54
|
+
int: "∫",
|
|
55
|
+
oint: "∮",
|
|
56
|
+
partial: "∂",
|
|
57
|
+
nabla: "∇",
|
|
58
|
+
infty: "∞",
|
|
59
|
+
hbar: "ℏ",
|
|
60
|
+
pm: "±",
|
|
61
|
+
mp: "∓",
|
|
62
|
+
times: "×",
|
|
63
|
+
div: "÷",
|
|
64
|
+
cdot: "·",
|
|
65
|
+
ast: "∗",
|
|
66
|
+
star: "⋆",
|
|
67
|
+
circ: "∘",
|
|
68
|
+
bullet: "•",
|
|
69
|
+
cap: "∩",
|
|
70
|
+
cup: "∪",
|
|
71
|
+
vee: "∨",
|
|
72
|
+
wedge: "∧",
|
|
73
|
+
oplus: "⊕",
|
|
74
|
+
otimes: "⊗",
|
|
75
|
+
equiv: "≡",
|
|
76
|
+
cong: "≅",
|
|
77
|
+
approx: "≈",
|
|
78
|
+
propto: "∝",
|
|
79
|
+
neq: "≠",
|
|
80
|
+
leq: "≤",
|
|
81
|
+
geq: "≥",
|
|
82
|
+
ll: "≪",
|
|
83
|
+
gg: "≫",
|
|
84
|
+
subset: "⊂",
|
|
85
|
+
supset: "⊃",
|
|
86
|
+
subseteq: "⊆",
|
|
87
|
+
supseteq: "⊇",
|
|
88
|
+
in: "∈",
|
|
89
|
+
notin: "∉",
|
|
90
|
+
ni: "∋",
|
|
91
|
+
forall: "∀",
|
|
92
|
+
exists: "∃",
|
|
93
|
+
emptyset: "∅",
|
|
94
|
+
neg: "¬",
|
|
95
|
+
angle: "∠",
|
|
96
|
+
perp: "⊥",
|
|
97
|
+
parallel: "∥",
|
|
98
|
+
rightarrow: "→",
|
|
99
|
+
leftarrow: "←",
|
|
100
|
+
leftrightarrow: "↔",
|
|
101
|
+
Rightarrow: "⇒",
|
|
102
|
+
Leftarrow: "⇐",
|
|
103
|
+
Leftrightarrow: "⇔",
|
|
104
|
+
mapsto: "↦",
|
|
105
|
+
to: "→",
|
|
106
|
+
langle: "⟨",
|
|
107
|
+
rangle: "⟩",
|
|
108
|
+
rightleftharpoons: "⇌",
|
|
109
|
+
log: "log",
|
|
110
|
+
ln: "ln",
|
|
111
|
+
sin: "sin",
|
|
112
|
+
cos: "cos",
|
|
113
|
+
tan: "tan"
|
|
114
|
+
}, W = {
|
|
115
|
+
varepsilon: "ϵ",
|
|
116
|
+
vartheta: "ϑ",
|
|
117
|
+
varkappa: "ϰ",
|
|
118
|
+
varphi: "φ",
|
|
119
|
+
varpi: "ϖ",
|
|
120
|
+
varrho: "ϱ",
|
|
121
|
+
varsigma: "ς",
|
|
122
|
+
digamma: "ϝ",
|
|
123
|
+
varDelta: "Δ",
|
|
124
|
+
varGamma: "Γ",
|
|
125
|
+
varSigma: "Σ",
|
|
126
|
+
varOmega: "Ω",
|
|
127
|
+
varPhi: "Φ",
|
|
128
|
+
varPi: "Π",
|
|
129
|
+
varLambda: "Λ",
|
|
130
|
+
varTheta: "Θ",
|
|
131
|
+
varUpsilon: "Υ",
|
|
132
|
+
varXi: "Ξ",
|
|
133
|
+
varPsi: "Ψ"
|
|
134
|
+
}, N = {
|
|
135
|
+
uparrow: "↑",
|
|
136
|
+
downarrow: "↓",
|
|
137
|
+
updownarrow: "↕",
|
|
138
|
+
Uparrow: "⇑",
|
|
139
|
+
Downarrow: "⇓",
|
|
140
|
+
Updownarrow: "⇕",
|
|
141
|
+
nearrow: "↗",
|
|
142
|
+
searrow: "↘",
|
|
143
|
+
swarrow: "↙",
|
|
144
|
+
nwarrow: "↖",
|
|
145
|
+
longrightarrow: "⟶",
|
|
146
|
+
longleftarrow: "⟵",
|
|
147
|
+
longleftrightarrow: "⟷",
|
|
148
|
+
Longrightarrow: "⟹",
|
|
149
|
+
Longleftarrow: "⟸",
|
|
150
|
+
Longleftrightarrow: "⟺",
|
|
151
|
+
implies: "⟹",
|
|
152
|
+
impliedby: "⟸",
|
|
153
|
+
iff: "⟺",
|
|
154
|
+
hookrightarrow: "↪",
|
|
155
|
+
hookleftarrow: "↩",
|
|
156
|
+
twoheadrightarrow: "↠",
|
|
157
|
+
twoheadleftarrow: "↞",
|
|
158
|
+
rightarrowtail: "↣",
|
|
159
|
+
leftarrowtail: "↢",
|
|
160
|
+
rightleftarrows: "⇄",
|
|
161
|
+
leftrightarrows: "⇆",
|
|
162
|
+
rightrightarrows: "⇉",
|
|
163
|
+
leftleftarrows: "⇇",
|
|
164
|
+
upuparrows: "⇈",
|
|
165
|
+
downdownarrows: "⇊",
|
|
166
|
+
leadsto: "⇝",
|
|
167
|
+
rightsquigarrow: "⇝",
|
|
168
|
+
leftrightsquigarrow: "↭",
|
|
169
|
+
circlearrowleft: "↺",
|
|
170
|
+
circlearrowright: "↻",
|
|
171
|
+
curvearrowleft: "↶",
|
|
172
|
+
curvearrowright: "↷",
|
|
173
|
+
Rrightarrow: "⇛",
|
|
174
|
+
Lleftarrow: "⇚",
|
|
175
|
+
dashrightarrow: "⇢",
|
|
176
|
+
dashleftarrow: "⇠",
|
|
177
|
+
nrightarrow: "↛",
|
|
178
|
+
nleftarrow: "↚",
|
|
179
|
+
nLeftrightarrow: "⇎",
|
|
180
|
+
nRightarrow: "⇏",
|
|
181
|
+
nLeftarrow: "⇍",
|
|
182
|
+
restriction: "↾",
|
|
183
|
+
upharpoonright: "↾",
|
|
184
|
+
upharpoonleft: "↿",
|
|
185
|
+
downharpoonright: "⇂",
|
|
186
|
+
downharpoonleft: "⇃",
|
|
187
|
+
leftharpoonup: "↼",
|
|
188
|
+
leftharpoondown: "↽",
|
|
189
|
+
rightharpoonup: "⇀",
|
|
190
|
+
rightharpoondown: "⇁",
|
|
191
|
+
leftrightharpoons: "⇋"
|
|
192
|
+
}, _ = {
|
|
193
|
+
sim: "∼",
|
|
194
|
+
simeq: "≃",
|
|
195
|
+
asymp: "≍",
|
|
196
|
+
approxeq: "≊",
|
|
197
|
+
doteq: "≐",
|
|
198
|
+
prec: "≺",
|
|
199
|
+
succ: "≻",
|
|
200
|
+
preceq: "⪯",
|
|
201
|
+
succeq: "⪰",
|
|
202
|
+
precsim: "≾",
|
|
203
|
+
succsim: "≿",
|
|
204
|
+
ll: "≪",
|
|
205
|
+
gg: "≫",
|
|
206
|
+
lll: "⋘",
|
|
207
|
+
ggg: "⋙",
|
|
208
|
+
models: "⊨",
|
|
209
|
+
vdash: "⊢",
|
|
210
|
+
dashv: "⊣",
|
|
211
|
+
vDash: "⊨",
|
|
212
|
+
Vdash: "⊩",
|
|
213
|
+
Vvdash: "⊪",
|
|
214
|
+
smile: "⌣",
|
|
215
|
+
frown: "⌢",
|
|
216
|
+
bowtie: "⋈",
|
|
217
|
+
sqsubset: "⊏",
|
|
218
|
+
sqsupset: "⊐",
|
|
219
|
+
sqsubseteq: "⊑",
|
|
220
|
+
sqsupseteq: "⊒",
|
|
221
|
+
subsetneq: "⊊",
|
|
222
|
+
supsetneq: "⊋",
|
|
223
|
+
Subset: "⋐",
|
|
224
|
+
Supset: "⋑",
|
|
225
|
+
between: "≬",
|
|
226
|
+
pitchfork: "⋔",
|
|
227
|
+
therefore: "∴",
|
|
228
|
+
because: "∵",
|
|
229
|
+
eqcirc: "≖",
|
|
230
|
+
circeq: "≗",
|
|
231
|
+
triangleq: "≜",
|
|
232
|
+
gtrless: "≷",
|
|
233
|
+
lessgtr: "≶",
|
|
234
|
+
lesssim: "≲",
|
|
235
|
+
gtrsim: "≳",
|
|
236
|
+
lessdot: "⋖",
|
|
237
|
+
gtrdot: "⋗",
|
|
238
|
+
ne: "≠",
|
|
239
|
+
nless: "≮",
|
|
240
|
+
ngtr: "≯",
|
|
241
|
+
nleq: "≰",
|
|
242
|
+
ngeq: "≱",
|
|
243
|
+
nsim: "≁",
|
|
244
|
+
nmid: "∤",
|
|
245
|
+
nparallel: "∦",
|
|
246
|
+
nsubseteq: "⊈",
|
|
247
|
+
nsupseteq: "⊉",
|
|
248
|
+
nsubset: "⊄",
|
|
249
|
+
nsupset: "⊅",
|
|
250
|
+
nvdash: "⊬",
|
|
251
|
+
nvDash: "⊭",
|
|
252
|
+
precnsim: "⋨",
|
|
253
|
+
succnsim: "⋩",
|
|
254
|
+
mid: "∣",
|
|
255
|
+
shortmid: "∣",
|
|
256
|
+
varpropto: "∝",
|
|
257
|
+
backsim: "∽",
|
|
258
|
+
eqsim: "≂",
|
|
259
|
+
Doteq: "≑",
|
|
260
|
+
fallingdotseq: "≒",
|
|
261
|
+
risingdotseq: "≓"
|
|
262
|
+
}, G = {
|
|
263
|
+
setminus: "∖",
|
|
264
|
+
smallsetminus: "∖",
|
|
265
|
+
wr: "≀",
|
|
266
|
+
amalg: "⨿",
|
|
267
|
+
uplus: "⊎",
|
|
268
|
+
sqcap: "⊓",
|
|
269
|
+
sqcup: "⊔",
|
|
270
|
+
triangleleft: "◁",
|
|
271
|
+
triangleright: "▷",
|
|
272
|
+
bigtriangleup: "△",
|
|
273
|
+
bigtriangledown: "▽",
|
|
274
|
+
triangledown: "▿",
|
|
275
|
+
diamond: "⋄",
|
|
276
|
+
ominus: "⊖",
|
|
277
|
+
oslash: "⊘",
|
|
278
|
+
odot: "⊙",
|
|
279
|
+
bigcirc: "◯",
|
|
280
|
+
boxplus: "⊞",
|
|
281
|
+
boxminus: "⊟",
|
|
282
|
+
boxtimes: "⊠",
|
|
283
|
+
boxdot: "⊡",
|
|
284
|
+
ltimes: "⋉",
|
|
285
|
+
rtimes: "⋊",
|
|
286
|
+
divideontimes: "⋇",
|
|
287
|
+
dagger: "†",
|
|
288
|
+
ddagger: "‡",
|
|
289
|
+
intercal: "⊺",
|
|
290
|
+
curlyvee: "⋎",
|
|
291
|
+
curlywedge: "⋏",
|
|
292
|
+
barwedge: "⊼",
|
|
293
|
+
veebar: "⊻",
|
|
294
|
+
doublebarwedge: "⩞",
|
|
295
|
+
circledast: "⊛",
|
|
296
|
+
circledcirc: "⊚",
|
|
297
|
+
circleddash: "⊝",
|
|
298
|
+
lesseqgtr: "⋚",
|
|
299
|
+
gtreqless: "⋛",
|
|
300
|
+
dotplus: "∔",
|
|
301
|
+
centerdot: "·"
|
|
302
|
+
}, H = {
|
|
303
|
+
bigcup: "⋃",
|
|
304
|
+
bigcap: "⋂",
|
|
305
|
+
bigsqcup: "⨆",
|
|
306
|
+
biguplus: "⨄",
|
|
307
|
+
bigvee: "⋁",
|
|
308
|
+
bigwedge: "⋀",
|
|
309
|
+
bigoplus: "⨁",
|
|
310
|
+
bigotimes: "⨂",
|
|
311
|
+
bigodot: "⨀",
|
|
312
|
+
coprod: "∐",
|
|
313
|
+
iint: "∬",
|
|
314
|
+
iiint: "∭",
|
|
315
|
+
iiiint: "⨌",
|
|
316
|
+
oiint: "∯",
|
|
317
|
+
oiiint: "∰"
|
|
318
|
+
}, Y = {
|
|
319
|
+
aleph: "ℵ",
|
|
320
|
+
beth: "ℶ",
|
|
321
|
+
gimel: "ℷ",
|
|
322
|
+
daleth: "ℸ",
|
|
323
|
+
ell: "ℓ",
|
|
324
|
+
wp: "℘",
|
|
325
|
+
Re: "ℜ",
|
|
326
|
+
Im: "ℑ",
|
|
327
|
+
imath: "ı",
|
|
328
|
+
jmath: "ȷ",
|
|
329
|
+
hslash: "ℏ",
|
|
330
|
+
surd: "√",
|
|
331
|
+
top: "⊤",
|
|
332
|
+
bot: "⊥",
|
|
333
|
+
measuredangle: "∡",
|
|
334
|
+
sphericalangle: "∢",
|
|
335
|
+
triangle: "△",
|
|
336
|
+
blacktriangle: "▲",
|
|
337
|
+
blacktriangledown: "▼",
|
|
338
|
+
blacktriangleleft: "◀",
|
|
339
|
+
blacktriangleright: "▶",
|
|
340
|
+
square: "□",
|
|
341
|
+
blacksquare: "■",
|
|
342
|
+
lozenge: "◊",
|
|
343
|
+
blacklozenge: "⧫",
|
|
344
|
+
bigstar: "★",
|
|
345
|
+
backslash: "\\",
|
|
346
|
+
prime: "′",
|
|
347
|
+
dprime: "″",
|
|
348
|
+
backprime: "‵",
|
|
349
|
+
varnothing: "∅",
|
|
350
|
+
complement: "∁",
|
|
351
|
+
degree: "°",
|
|
352
|
+
flat: "♭",
|
|
353
|
+
natural: "♮",
|
|
354
|
+
sharp: "♯",
|
|
355
|
+
clubsuit: "♣",
|
|
356
|
+
diamondsuit: "♢",
|
|
357
|
+
heartsuit: "♡",
|
|
358
|
+
spadesuit: "♠",
|
|
359
|
+
checkmark: "✓",
|
|
360
|
+
maltese: "✠",
|
|
361
|
+
copyright: "©",
|
|
362
|
+
circledR: "®",
|
|
363
|
+
circledS: "Ⓢ",
|
|
364
|
+
pounds: "£",
|
|
365
|
+
yen: "¥",
|
|
366
|
+
euro: "€",
|
|
367
|
+
cent: "¢",
|
|
368
|
+
S: "§",
|
|
369
|
+
P: "¶",
|
|
370
|
+
dag: "†",
|
|
371
|
+
ddag: "‡",
|
|
372
|
+
sun: "☉",
|
|
373
|
+
mercury: "☿",
|
|
374
|
+
venus: "♀",
|
|
375
|
+
earth: "♁",
|
|
376
|
+
mars: "♂",
|
|
377
|
+
jupiter: "♃",
|
|
378
|
+
saturn: "♄",
|
|
379
|
+
partialdiff: "∂",
|
|
380
|
+
Finv: "Ⅎ",
|
|
381
|
+
Game: "⅁",
|
|
382
|
+
mho: "℧",
|
|
383
|
+
eth: "ð",
|
|
384
|
+
hbar2: "ℏ",
|
|
385
|
+
nexists: "∄",
|
|
386
|
+
angstrom: "Å",
|
|
387
|
+
micro: "µ",
|
|
388
|
+
ohm: "Ω",
|
|
389
|
+
perthousand: "‰",
|
|
390
|
+
numero: "№"
|
|
391
|
+
}, K = {
|
|
392
|
+
ldots: "…",
|
|
393
|
+
cdots: "⋯",
|
|
394
|
+
vdots: "⋮",
|
|
395
|
+
ddots: "⋱",
|
|
396
|
+
dots: "…",
|
|
397
|
+
dotsc: "…",
|
|
398
|
+
dotsb: "⋯",
|
|
399
|
+
dotsm: "⋯",
|
|
400
|
+
dotsi: "⋯"
|
|
401
|
+
}, U = {
|
|
402
|
+
lfloor: "⌊",
|
|
403
|
+
rfloor: "⌋",
|
|
404
|
+
lceil: "⌈",
|
|
405
|
+
rceil: "⌉",
|
|
406
|
+
lbrace: "{",
|
|
407
|
+
rbrace: "}",
|
|
408
|
+
lbrack: "[",
|
|
409
|
+
rbrack: "]",
|
|
410
|
+
lvert: "|",
|
|
411
|
+
rvert: "|",
|
|
412
|
+
lVert: "‖",
|
|
413
|
+
rVert: "‖",
|
|
414
|
+
vert: "|",
|
|
415
|
+
Vert: "‖",
|
|
416
|
+
ulcorner: "⌜",
|
|
417
|
+
urcorner: "⌝",
|
|
418
|
+
llcorner: "⌞",
|
|
419
|
+
lrcorner: "⌟",
|
|
420
|
+
lgroup: "⟮",
|
|
421
|
+
rgroup: "⟯",
|
|
422
|
+
lmoustache: "⎰",
|
|
423
|
+
rmoustache: "⎱",
|
|
424
|
+
llbracket: "⟦",
|
|
425
|
+
rrbracket: "⟧"
|
|
426
|
+
}, V = {
|
|
427
|
+
sec: "sec",
|
|
428
|
+
csc: "csc",
|
|
429
|
+
cot: "cot",
|
|
430
|
+
sinh: "sinh",
|
|
431
|
+
cosh: "cosh",
|
|
432
|
+
tanh: "tanh",
|
|
433
|
+
coth: "coth",
|
|
434
|
+
arcsin: "arcsin",
|
|
435
|
+
arccos: "arccos",
|
|
436
|
+
arctan: "arctan",
|
|
437
|
+
arcsec: "arcsec",
|
|
438
|
+
arccsc: "arccsc",
|
|
439
|
+
arccot: "arccot",
|
|
440
|
+
exp: "exp",
|
|
441
|
+
det: "det",
|
|
442
|
+
dim: "dim",
|
|
443
|
+
ker: "ker",
|
|
444
|
+
deg: "deg",
|
|
445
|
+
gcd: "gcd",
|
|
446
|
+
hom: "hom",
|
|
447
|
+
lim: "lim",
|
|
448
|
+
liminf: "lim inf",
|
|
449
|
+
limsup: "lim sup",
|
|
450
|
+
max: "max",
|
|
451
|
+
min: "min",
|
|
452
|
+
sup: "sup",
|
|
453
|
+
inf: "inf",
|
|
454
|
+
arg: "arg",
|
|
455
|
+
Pr: "Pr",
|
|
456
|
+
lg: "lg",
|
|
457
|
+
mod: "mod",
|
|
458
|
+
bmod: "mod"
|
|
459
|
+
}, A = {
|
|
460
|
+
...B,
|
|
461
|
+
...F,
|
|
462
|
+
...W,
|
|
463
|
+
...X,
|
|
464
|
+
...N,
|
|
465
|
+
..._,
|
|
466
|
+
...G,
|
|
467
|
+
...H,
|
|
468
|
+
...Y,
|
|
469
|
+
...K,
|
|
470
|
+
...U,
|
|
471
|
+
...V
|
|
472
|
+
}, $ = {
|
|
473
|
+
A: "𝔸",
|
|
474
|
+
B: "𝔹",
|
|
475
|
+
C: "ℂ",
|
|
476
|
+
D: "𝔻",
|
|
477
|
+
E: "𝔼",
|
|
478
|
+
F: "𝔽",
|
|
479
|
+
G: "𝔾",
|
|
480
|
+
H: "ℍ",
|
|
481
|
+
I: "𝕀",
|
|
482
|
+
J: "𝕁",
|
|
483
|
+
K: "𝕂",
|
|
484
|
+
L: "𝕃",
|
|
485
|
+
M: "𝕄",
|
|
486
|
+
N: "ℕ",
|
|
487
|
+
O: "𝕆",
|
|
488
|
+
P: "ℙ",
|
|
489
|
+
Q: "ℚ",
|
|
490
|
+
R: "ℝ",
|
|
491
|
+
S: "𝕊",
|
|
492
|
+
T: "𝕋",
|
|
493
|
+
U: "𝕌",
|
|
494
|
+
V: "𝕍",
|
|
495
|
+
W: "𝕎",
|
|
496
|
+
X: "𝕏",
|
|
497
|
+
Y: "𝕐",
|
|
498
|
+
Z: "ℤ"
|
|
499
|
+
}, J = {
|
|
500
|
+
A: "𝒜",
|
|
501
|
+
B: "ℬ",
|
|
502
|
+
C: "𝒞",
|
|
503
|
+
D: "𝒟",
|
|
504
|
+
E: "ℰ",
|
|
505
|
+
F: "ℱ",
|
|
506
|
+
G: "𝒢",
|
|
507
|
+
H: "ℋ",
|
|
508
|
+
I: "ℐ",
|
|
509
|
+
J: "𝒥",
|
|
510
|
+
K: "𝒦",
|
|
511
|
+
L: "ℒ",
|
|
512
|
+
M: "ℳ",
|
|
513
|
+
N: "𝒩",
|
|
514
|
+
O: "𝒪",
|
|
515
|
+
P: "𝒫",
|
|
516
|
+
Q: "𝒬",
|
|
517
|
+
R: "ℛ",
|
|
518
|
+
S: "𝒮",
|
|
519
|
+
T: "𝒯",
|
|
520
|
+
U: "𝒰",
|
|
521
|
+
V: "𝒱",
|
|
522
|
+
W: "𝒲",
|
|
523
|
+
X: "𝒳",
|
|
524
|
+
Y: "𝒴",
|
|
525
|
+
Z: "𝒵"
|
|
526
|
+
}, Z = {
|
|
527
|
+
A: "𝔄",
|
|
528
|
+
B: "𝔅",
|
|
529
|
+
C: "ℭ",
|
|
530
|
+
D: "𝔇",
|
|
531
|
+
E: "𝔈",
|
|
532
|
+
F: "𝔉",
|
|
533
|
+
G: "𝔊",
|
|
534
|
+
H: "ℌ",
|
|
535
|
+
I: "ℑ",
|
|
536
|
+
J: "𝔍",
|
|
537
|
+
K: "𝔎",
|
|
538
|
+
L: "𝔏",
|
|
539
|
+
M: "𝔐",
|
|
540
|
+
N: "𝔑",
|
|
541
|
+
O: "𝔒",
|
|
542
|
+
P: "𝔓",
|
|
543
|
+
Q: "𝔔",
|
|
544
|
+
R: "ℜ",
|
|
545
|
+
S: "𝔖",
|
|
546
|
+
T: "𝔗",
|
|
547
|
+
U: "𝔘",
|
|
548
|
+
V: "𝔙",
|
|
549
|
+
W: "𝔚",
|
|
550
|
+
X: "𝔛",
|
|
551
|
+
Y: "𝔜",
|
|
552
|
+
Z: "ℨ"
|
|
553
|
+
};
|
|
554
|
+
Object.keys(A).length;
|
|
555
|
+
function L(r) {
|
|
556
|
+
return A[r];
|
|
557
|
+
}
|
|
558
|
+
function j(r) {
|
|
559
|
+
return r in A;
|
|
560
|
+
}
|
|
561
|
+
const Q = {
|
|
3
562
|
matrix: ["", ""],
|
|
4
563
|
pmatrix: ["(", ")"],
|
|
5
564
|
bmatrix: ["[", "]"],
|
|
6
565
|
Bmatrix: ["{", "}"],
|
|
7
566
|
vmatrix: ["|", "|"],
|
|
8
567
|
Vmatrix: ["‖", "‖"]
|
|
9
|
-
},
|
|
10
|
-
mathbb:
|
|
11
|
-
mathcal:
|
|
12
|
-
mathfrak:
|
|
568
|
+
}, M = {
|
|
569
|
+
mathbb: $,
|
|
570
|
+
mathcal: J,
|
|
571
|
+
mathfrak: Z
|
|
13
572
|
};
|
|
14
|
-
function P(
|
|
15
|
-
const t =
|
|
16
|
-
return
|
|
573
|
+
function P(r) {
|
|
574
|
+
const t = ee(r);
|
|
575
|
+
return R(t);
|
|
17
576
|
}
|
|
18
|
-
function
|
|
577
|
+
function z(r) {
|
|
19
578
|
let t = "";
|
|
20
|
-
for (const e of
|
|
21
|
-
e.type === "text" || e.type === "textgroup" || e.type === "symbol" ? t += e.content || "" : e.children && (t +=
|
|
579
|
+
for (const e of r)
|
|
580
|
+
e.type === "text" || e.type === "textgroup" || e.type === "symbol" ? t += e.content || "" : e.children && (t += z(e.children));
|
|
22
581
|
return t;
|
|
23
582
|
}
|
|
24
|
-
function
|
|
583
|
+
function ee(r) {
|
|
25
584
|
const t = [];
|
|
26
585
|
let e = 0;
|
|
27
|
-
for (; e <
|
|
28
|
-
const n =
|
|
586
|
+
for (; e < r.length; ) {
|
|
587
|
+
const n = r[e];
|
|
29
588
|
if (n === "\\") {
|
|
30
|
-
let
|
|
31
|
-
for (e++; e <
|
|
32
|
-
|
|
33
|
-
|
|
589
|
+
let s = "";
|
|
590
|
+
for (e++; e < r.length && /[a-zA-Z]/.test(r[e]); )
|
|
591
|
+
s += r[e], e++;
|
|
592
|
+
s ? t.push("\\" + s) : e < r.length && (t.push("\\" + r[e]), e++);
|
|
34
593
|
} else if (n === "{" || n === "}" || n === "^" || n === "_")
|
|
35
594
|
t.push(n), e++;
|
|
36
595
|
else if (/\s/.test(n))
|
|
37
|
-
for (t.push(" "), e++; e <
|
|
596
|
+
for (t.push(" "), e++; e < r.length && /\s/.test(r[e]); )
|
|
38
597
|
e++;
|
|
39
598
|
else
|
|
40
599
|
t.push(n), e++;
|
|
41
600
|
}
|
|
42
601
|
return t;
|
|
43
602
|
}
|
|
44
|
-
function
|
|
603
|
+
function R(r) {
|
|
45
604
|
const t = [];
|
|
46
605
|
let e = 0;
|
|
47
|
-
for (; e <
|
|
48
|
-
const n =
|
|
606
|
+
for (; e < r.length; ) {
|
|
607
|
+
const n = r[e];
|
|
49
608
|
if (n === "^") {
|
|
50
609
|
e++;
|
|
51
|
-
const
|
|
610
|
+
const s = T(r, e);
|
|
52
611
|
t.push({
|
|
53
612
|
type: "superscript",
|
|
54
|
-
children:
|
|
55
|
-
}), e =
|
|
613
|
+
children: s.nodes
|
|
614
|
+
}), e = s.nextIndex;
|
|
56
615
|
} else if (n === "_") {
|
|
57
616
|
e++;
|
|
58
|
-
const
|
|
617
|
+
const s = T(r, e);
|
|
59
618
|
t.push({
|
|
60
619
|
type: "subscript",
|
|
61
|
-
children:
|
|
62
|
-
}), e =
|
|
620
|
+
children: s.nodes
|
|
621
|
+
}), e = s.nextIndex;
|
|
63
622
|
} else if (n.startsWith("\\")) {
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
623
|
+
const s = n.substring(1);
|
|
624
|
+
if (s === "frac") {
|
|
66
625
|
e++;
|
|
67
|
-
const o =
|
|
626
|
+
const o = T(r, e);
|
|
68
627
|
e = o.nextIndex;
|
|
69
|
-
const l =
|
|
628
|
+
const l = T(r, e);
|
|
70
629
|
e = l.nextIndex, t.push({
|
|
71
630
|
type: "fraction",
|
|
72
631
|
numerator: o.nodes,
|
|
73
632
|
denominator: l.nodes
|
|
74
633
|
});
|
|
75
|
-
} else if (
|
|
634
|
+
} else if (s === "sqrt") {
|
|
76
635
|
e++;
|
|
77
|
-
const o =
|
|
636
|
+
const o = T(r, e);
|
|
78
637
|
t.push({
|
|
79
638
|
type: "sqrt",
|
|
80
639
|
children: o.nodes
|
|
81
640
|
}), e = o.nextIndex;
|
|
82
|
-
} else if (
|
|
641
|
+
} else if (s === "text" || s === "mathrm" || s === "mathbf" || s === "mathit" || s === "operatorname") {
|
|
83
642
|
e++;
|
|
84
|
-
const o =
|
|
643
|
+
const o = T(r, e), l = z(o.nodes);
|
|
85
644
|
t.push({
|
|
86
645
|
type: "textgroup",
|
|
87
646
|
content: l
|
|
88
647
|
}), e = o.nextIndex;
|
|
89
|
-
} else if (
|
|
648
|
+
} else if (s in M) {
|
|
90
649
|
e++;
|
|
91
|
-
const o =
|
|
650
|
+
const o = T(r, e);
|
|
92
651
|
e = o.nextIndex;
|
|
93
|
-
const l =
|
|
652
|
+
const l = M[s], i = z(o.nodes);
|
|
94
653
|
let c = "";
|
|
95
|
-
for (const
|
|
654
|
+
for (const h of i) c += l[h] ?? h;
|
|
96
655
|
t.push({ type: "text", content: c });
|
|
97
|
-
} else
|
|
656
|
+
} else s === "begin" ? e = te(r, e, t) : j(s) ? (t.push({
|
|
98
657
|
type: "symbol",
|
|
99
|
-
content:
|
|
100
|
-
}), e++) :
|
|
658
|
+
content: L(s)
|
|
659
|
+
}), e++) : s === "times" || s === "cdot" || s === "pm" || s === "mp" ? (t.push({
|
|
101
660
|
type: "symbol",
|
|
102
|
-
content:
|
|
661
|
+
content: L(s)
|
|
103
662
|
}), e++) : (t.push({
|
|
104
663
|
type: "text",
|
|
105
664
|
content: n
|
|
106
665
|
}), e++);
|
|
107
666
|
} else if (n === "{") {
|
|
108
|
-
const
|
|
667
|
+
const s = T(r, e);
|
|
109
668
|
t.push({
|
|
110
669
|
type: "group",
|
|
111
|
-
children:
|
|
112
|
-
}), e =
|
|
670
|
+
children: s.nodes
|
|
671
|
+
}), e = s.nextIndex;
|
|
113
672
|
} else
|
|
114
673
|
t.push({
|
|
115
674
|
type: "text",
|
|
@@ -118,152 +677,152 @@ function M(s) {
|
|
|
118
677
|
}
|
|
119
678
|
return t;
|
|
120
679
|
}
|
|
121
|
-
function
|
|
122
|
-
let n = t + 1,
|
|
123
|
-
if (
|
|
124
|
-
for (n++; n <
|
|
125
|
-
|
|
126
|
-
|
|
680
|
+
function te(r, t, e) {
|
|
681
|
+
let n = t + 1, s = "";
|
|
682
|
+
if (r[n] === "{") {
|
|
683
|
+
for (n++; n < r.length && r[n] !== "}"; )
|
|
684
|
+
s += r[n], n++;
|
|
685
|
+
r[n] === "}" && n++;
|
|
127
686
|
}
|
|
128
687
|
const o = [];
|
|
129
688
|
let l = 1;
|
|
130
|
-
for (; n <
|
|
131
|
-
const a =
|
|
689
|
+
for (; n < r.length && l > 0; ) {
|
|
690
|
+
const a = r[n];
|
|
132
691
|
if (a === "\\begin")
|
|
133
692
|
l++, o.push(a), n++;
|
|
134
693
|
else if (a === "\\end")
|
|
135
694
|
if (l--, l === 0) {
|
|
136
|
-
if (n++,
|
|
137
|
-
for (n++; n <
|
|
138
|
-
|
|
695
|
+
if (n++, r[n] === "{") {
|
|
696
|
+
for (n++; n < r.length && r[n] !== "}"; ) n++;
|
|
697
|
+
r[n] === "}" && n++;
|
|
139
698
|
}
|
|
140
699
|
} else
|
|
141
700
|
o.push(a), n++;
|
|
142
701
|
else
|
|
143
702
|
o.push(a), n++;
|
|
144
703
|
}
|
|
145
|
-
const
|
|
146
|
-
let c = [],
|
|
704
|
+
const i = [];
|
|
705
|
+
let c = [], h = [];
|
|
147
706
|
const p = () => {
|
|
148
|
-
c.push(
|
|
149
|
-
},
|
|
150
|
-
p(),
|
|
707
|
+
c.push(R(h)), h = [];
|
|
708
|
+
}, g = () => {
|
|
709
|
+
p(), i.push(c), c = [];
|
|
151
710
|
};
|
|
152
711
|
for (const a of o)
|
|
153
|
-
a === "&" ? p() : a === "\\\\" ?
|
|
154
|
-
(
|
|
155
|
-
const m =
|
|
156
|
-
return e.push({ type: "matrix", rows:
|
|
712
|
+
a === "&" ? p() : a === "\\\\" ? g() : h.push(a);
|
|
713
|
+
(h.length > 0 || c.length > 0) && g();
|
|
714
|
+
const m = Q[s] ?? ["", ""];
|
|
715
|
+
return e.push({ type: "matrix", rows: i, delimiters: m }), n;
|
|
157
716
|
}
|
|
158
|
-
function
|
|
159
|
-
if (
|
|
717
|
+
function T(r, t) {
|
|
718
|
+
if (r[t] !== "{")
|
|
160
719
|
return {
|
|
161
720
|
nodes: [
|
|
162
721
|
{
|
|
163
722
|
type: "text",
|
|
164
|
-
content:
|
|
723
|
+
content: r[t] || ""
|
|
165
724
|
}
|
|
166
725
|
],
|
|
167
726
|
nextIndex: t + 1
|
|
168
727
|
};
|
|
169
728
|
let e = t + 1;
|
|
170
729
|
const n = [];
|
|
171
|
-
let
|
|
172
|
-
for (; e <
|
|
173
|
-
const o =
|
|
174
|
-
o === "{" ? (
|
|
730
|
+
let s = 1;
|
|
731
|
+
for (; e < r.length && s > 0; ) {
|
|
732
|
+
const o = r[e];
|
|
733
|
+
o === "{" ? (s++, n.push(o)) : o === "}" ? (s--, s > 0 && n.push(o)) : n.push(o), e++;
|
|
175
734
|
}
|
|
176
735
|
return {
|
|
177
|
-
nodes:
|
|
736
|
+
nodes: R(n),
|
|
178
737
|
nextIndex: e
|
|
179
738
|
};
|
|
180
739
|
}
|
|
181
|
-
function
|
|
182
|
-
let e = t.x, n = 0,
|
|
183
|
-
for (let o = 0; o <
|
|
184
|
-
const l =
|
|
185
|
-
if (
|
|
186
|
-
const m =
|
|
187
|
-
e +=
|
|
740
|
+
function v(r, t) {
|
|
741
|
+
let e = t.x, n = 0, s = 0;
|
|
742
|
+
for (let o = 0; o < r.length; o++) {
|
|
743
|
+
const l = r[o], i = l.type === "subscript", c = l.type === "superscript", h = r[o + 1], p = (h == null ? void 0 : h.type) === "subscript", g = (h == null ? void 0 : h.type) === "superscript";
|
|
744
|
+
if (i && g || c && p) {
|
|
745
|
+
const m = q(l, { ...t, x: e }), a = q(h, { ...t, x: e }), d = Math.max(m.width, a.width);
|
|
746
|
+
e += d + t.fontSize * 0.15, n = Math.max(n, m.baseline, a.baseline), s = Math.max(s, m.height - m.baseline, a.height - a.baseline), o++;
|
|
188
747
|
} else {
|
|
189
|
-
const m =
|
|
190
|
-
e += m.width, (
|
|
748
|
+
const m = q(l, { ...t, x: e });
|
|
749
|
+
e += m.width, (i || c) && (e += t.fontSize * 0.12), n = Math.max(n, m.baseline), s = Math.max(s, m.height - m.baseline);
|
|
191
750
|
}
|
|
192
751
|
}
|
|
193
752
|
return {
|
|
194
753
|
width: e - t.x,
|
|
195
|
-
height: n +
|
|
754
|
+
height: n + s,
|
|
196
755
|
baseline: n
|
|
197
756
|
};
|
|
198
757
|
}
|
|
199
|
-
function
|
|
200
|
-
switch (
|
|
758
|
+
function q(r, t) {
|
|
759
|
+
switch (r.type) {
|
|
201
760
|
case "text":
|
|
202
|
-
return
|
|
761
|
+
return k(r.content || "", t);
|
|
203
762
|
case "textgroup":
|
|
204
|
-
return
|
|
763
|
+
return k(r.content || "", t);
|
|
205
764
|
case "symbol":
|
|
206
|
-
return
|
|
765
|
+
return re(r.content || "", t);
|
|
207
766
|
case "superscript":
|
|
208
|
-
return
|
|
767
|
+
return se(r.children || [], t);
|
|
209
768
|
case "subscript":
|
|
210
|
-
return
|
|
769
|
+
return oe(r.children || [], t);
|
|
211
770
|
case "fraction":
|
|
212
|
-
return
|
|
213
|
-
|
|
214
|
-
|
|
771
|
+
return ie(
|
|
772
|
+
r.numerator || [],
|
|
773
|
+
r.denominator || [],
|
|
215
774
|
t
|
|
216
775
|
);
|
|
217
776
|
case "sqrt":
|
|
218
|
-
return
|
|
777
|
+
return ae(r.children || [], t);
|
|
219
778
|
case "group":
|
|
220
|
-
return
|
|
779
|
+
return v(r.children || [], t);
|
|
221
780
|
case "matrix":
|
|
222
|
-
return
|
|
781
|
+
return ne(r.rows || [], r.delimiters || ["", ""], t);
|
|
223
782
|
default:
|
|
224
783
|
return { width: 0, height: 0, baseline: 0 };
|
|
225
784
|
}
|
|
226
785
|
}
|
|
227
|
-
function
|
|
228
|
-
const n =
|
|
229
|
-
if (n === 0 ||
|
|
786
|
+
function ne(r, t, e) {
|
|
787
|
+
const n = r.length, s = r.reduce((u, f) => Math.max(u, f.length), 0);
|
|
788
|
+
if (n === 0 || s === 0)
|
|
230
789
|
return { width: 0, height: 0, baseline: 0 };
|
|
231
|
-
const o = e.fontSize * 0.35, l = e.fontSize * 0.25,
|
|
232
|
-
for (let
|
|
233
|
-
for (let
|
|
234
|
-
const
|
|
235
|
-
f
|
|
790
|
+
const o = e.fontSize * 0.35, l = e.fontSize * 0.25, i = e.fontSize * 0.35, c = r.map((u) => u.map((f) => C(f, e))), h = new Array(s).fill(0), p = new Array(n).fill(0), g = new Array(n).fill(0);
|
|
791
|
+
for (let u = 0; u < n; u++)
|
|
792
|
+
for (let f = 0; f < r[u].length; f++) {
|
|
793
|
+
const b = c[u][f];
|
|
794
|
+
h[f] = Math.max(h[f], b.width), p[u] = Math.max(p[u], b.baseline), g[u] = Math.max(g[u], b.height - b.baseline);
|
|
236
795
|
}
|
|
237
|
-
const m = p.map((
|
|
238
|
-
|
|
239
|
-
let S =
|
|
240
|
-
for (let
|
|
241
|
-
let
|
|
242
|
-
for (let
|
|
243
|
-
const
|
|
244
|
-
if (
|
|
245
|
-
const
|
|
246
|
-
|
|
796
|
+
const m = p.map((u, f) => u + g[f]), a = m.reduce((u, f) => u + f, 0) + l * 2 * n, y = h.reduce((u, f) => u + f, 0) + o * 2 * s + i * 2, w = e.y - a / 2;
|
|
797
|
+
I(e, t[0], e.x, w, a, i, "left"), I(e, t[1], e.x + y - i, w, a, i, "right");
|
|
798
|
+
let S = w + l;
|
|
799
|
+
for (let u = 0; u < n; u++) {
|
|
800
|
+
let f = e.x + i + o;
|
|
801
|
+
for (let b = 0; b < s; b++) {
|
|
802
|
+
const E = r[u][b];
|
|
803
|
+
if (E) {
|
|
804
|
+
const D = c[u][b], O = f + (h[b] - D.width) / 2, x = S + p[u];
|
|
805
|
+
v(E, { ...e, x: O, y: x });
|
|
247
806
|
}
|
|
248
|
-
|
|
807
|
+
f += h[b] + o * 2;
|
|
249
808
|
}
|
|
250
|
-
S += m[
|
|
809
|
+
S += m[u] + l * 2;
|
|
251
810
|
}
|
|
252
|
-
return { width:
|
|
811
|
+
return { width: y, height: a, baseline: a / 2 };
|
|
253
812
|
}
|
|
254
|
-
function
|
|
813
|
+
function I(r, t, e, n, s, o, l) {
|
|
255
814
|
if (!t) return;
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
const c = n +
|
|
259
|
-
|
|
260
|
-
},
|
|
261
|
-
|
|
262
|
-
}, m = (
|
|
263
|
-
|
|
264
|
-
}, a = (
|
|
265
|
-
const
|
|
266
|
-
|
|
815
|
+
const i = r.ctx;
|
|
816
|
+
i.save(), i.strokeStyle = r.color, i.lineWidth = Math.max(1, r.fontSize * 0.05), i.lineCap = "round", i.lineJoin = "round";
|
|
817
|
+
const c = n + s, h = o * 0.7, p = (d) => {
|
|
818
|
+
i.beginPath(), d ? (i.moveTo(e + o, n), i.quadraticCurveTo(e, (n + c) / 2, e + o, c)) : (i.moveTo(e, n), i.quadraticCurveTo(e + o, (n + c) / 2, e, c)), i.stroke();
|
|
819
|
+
}, g = (d) => {
|
|
820
|
+
i.beginPath(), d ? (i.moveTo(e + h, n), i.lineTo(e, n), i.lineTo(e, c), i.lineTo(e + h, c)) : (i.moveTo(e + o - h, n), i.lineTo(e + o, n), i.lineTo(e + o, c), i.lineTo(e + o - h, c)), i.stroke();
|
|
821
|
+
}, m = (d) => {
|
|
822
|
+
i.beginPath(), i.moveTo(e + d, n), i.lineTo(e + d, c), i.stroke();
|
|
823
|
+
}, a = (d) => {
|
|
824
|
+
const y = (n + c) / 2, w = d ? e + o : e, S = d ? e : e + o;
|
|
825
|
+
i.beginPath(), i.moveTo(w, n), i.quadraticCurveTo(S, n + s * 0.25, (w + S) / 2, n + s * 0.4), i.quadraticCurveTo(S, y - 1, S, y), i.quadraticCurveTo(S, y + 1, (w + S) / 2, c - s * 0.4), i.quadraticCurveTo(S, c - s * 0.25, w, c), i.stroke();
|
|
267
826
|
};
|
|
268
827
|
switch (t) {
|
|
269
828
|
case "(":
|
|
@@ -273,10 +832,10 @@ function X(s, t, e, n, i, o, l) {
|
|
|
273
832
|
p(!1);
|
|
274
833
|
break;
|
|
275
834
|
case "[":
|
|
276
|
-
|
|
835
|
+
g(!0);
|
|
277
836
|
break;
|
|
278
837
|
case "]":
|
|
279
|
-
|
|
838
|
+
g(!1);
|
|
280
839
|
break;
|
|
281
840
|
case "{":
|
|
282
841
|
a(!0);
|
|
@@ -291,155 +850,155 @@ function X(s, t, e, n, i, o, l) {
|
|
|
291
850
|
m(o * 0.3), m(o * 0.7);
|
|
292
851
|
break;
|
|
293
852
|
}
|
|
294
|
-
|
|
853
|
+
i.restore();
|
|
295
854
|
}
|
|
296
|
-
function
|
|
855
|
+
function k(r, t) {
|
|
297
856
|
t.ctx.save(), t.ctx.font = `${t.fontSize}px ${t.fontFamily}`, t.ctx.fillStyle = t.color, t.ctx.textAlign = "left", t.ctx.textBaseline = "alphabetic";
|
|
298
|
-
const e = t.ctx.measureText(
|
|
299
|
-
t.ctx.fillText(
|
|
300
|
-
const n = t.fontSize,
|
|
857
|
+
const e = t.ctx.measureText(r);
|
|
858
|
+
t.ctx.fillText(r, t.x, t.y), t.ctx.restore();
|
|
859
|
+
const n = t.fontSize, s = n * 0.75;
|
|
301
860
|
return {
|
|
302
861
|
width: e.width,
|
|
303
862
|
height: n,
|
|
304
|
-
baseline:
|
|
863
|
+
baseline: s
|
|
305
864
|
};
|
|
306
865
|
}
|
|
307
|
-
function
|
|
866
|
+
function re(r, t) {
|
|
308
867
|
t.ctx.save(), t.ctx.font = `${t.fontSize * 1.1}px ${t.fontFamily}`, t.ctx.fillStyle = t.color, t.ctx.textAlign = "left", t.ctx.textBaseline = "alphabetic";
|
|
309
|
-
const e = t.ctx.measureText(
|
|
310
|
-
t.ctx.fillText(
|
|
311
|
-
const n = t.fontSize * 1.1,
|
|
868
|
+
const e = t.ctx.measureText(r);
|
|
869
|
+
t.ctx.fillText(r, t.x, t.y), t.ctx.restore();
|
|
870
|
+
const n = t.fontSize * 1.1, s = n * 0.75;
|
|
312
871
|
return {
|
|
313
872
|
width: e.width,
|
|
314
873
|
height: n,
|
|
315
|
-
baseline:
|
|
874
|
+
baseline: s
|
|
316
875
|
};
|
|
317
876
|
}
|
|
318
|
-
function
|
|
319
|
-
const e = t.fontSize * 0.7, n = -t.fontSize * 0.4,
|
|
877
|
+
function se(r, t) {
|
|
878
|
+
const e = t.fontSize * 0.7, n = -t.fontSize * 0.4, s = v(r, {
|
|
320
879
|
...t,
|
|
321
880
|
fontSize: e,
|
|
322
881
|
y: t.y + n
|
|
323
|
-
}), o =
|
|
882
|
+
}), o = s.baseline, l = s.height - s.baseline;
|
|
324
883
|
return {
|
|
325
|
-
width:
|
|
884
|
+
width: s.width,
|
|
326
885
|
height: o - n + (l + n),
|
|
327
886
|
baseline: o - n
|
|
328
887
|
};
|
|
329
888
|
}
|
|
330
|
-
function
|
|
331
|
-
const e = t.fontSize * 0.7, n = t.fontSize * 0.3,
|
|
889
|
+
function oe(r, t) {
|
|
890
|
+
const e = t.fontSize * 0.7, n = t.fontSize * 0.3, s = v(r, {
|
|
332
891
|
...t,
|
|
333
892
|
fontSize: e,
|
|
334
893
|
y: t.y + n
|
|
335
|
-
}), o =
|
|
894
|
+
}), o = s.baseline, l = s.height - s.baseline;
|
|
336
895
|
return {
|
|
337
|
-
width:
|
|
896
|
+
width: s.width,
|
|
338
897
|
height: o - n + (l + n),
|
|
339
898
|
baseline: o - n
|
|
340
899
|
};
|
|
341
900
|
}
|
|
342
|
-
function
|
|
343
|
-
const n = e.fontSize * 0.85,
|
|
901
|
+
function ie(r, t, e) {
|
|
902
|
+
const n = e.fontSize * 0.85, s = Math.max(1, e.fontSize * 0.05), o = e.fontSize * 0.1, l = C(r, {
|
|
344
903
|
...e,
|
|
345
904
|
fontSize: n
|
|
346
|
-
}),
|
|
905
|
+
}), i = C(t, {
|
|
347
906
|
...e,
|
|
348
907
|
fontSize: n
|
|
349
|
-
}), c = Math.max(l.width,
|
|
350
|
-
|
|
908
|
+
}), c = Math.max(l.width, i.width), h = l.height + i.height + o * 2 + s, p = e.x + (c - l.width) / 2, g = e.y - o - s / 2;
|
|
909
|
+
v(r, {
|
|
351
910
|
...e,
|
|
352
911
|
x: p,
|
|
353
|
-
y:
|
|
912
|
+
y: g,
|
|
354
913
|
fontSize: n
|
|
355
914
|
}), e.ctx.fillStyle = e.color, e.ctx.fillRect(
|
|
356
915
|
e.x,
|
|
357
|
-
e.y -
|
|
916
|
+
e.y - s / 2,
|
|
358
917
|
c,
|
|
359
|
-
|
|
918
|
+
s
|
|
360
919
|
);
|
|
361
|
-
const m = e.x + (c -
|
|
362
|
-
return
|
|
920
|
+
const m = e.x + (c - i.width) / 2, a = e.y + i.baseline + o + s / 2;
|
|
921
|
+
return v(t, {
|
|
363
922
|
...e,
|
|
364
923
|
x: m,
|
|
365
924
|
y: a,
|
|
366
925
|
fontSize: n
|
|
367
926
|
}), {
|
|
368
927
|
width: c,
|
|
369
|
-
height:
|
|
370
|
-
baseline:
|
|
928
|
+
height: h,
|
|
929
|
+
baseline: h / 2
|
|
371
930
|
};
|
|
372
931
|
}
|
|
373
|
-
function
|
|
374
|
-
const e =
|
|
932
|
+
function ae(r, t) {
|
|
933
|
+
const e = v(r, {
|
|
375
934
|
...t,
|
|
376
935
|
x: t.x + t.fontSize * 0.4
|
|
377
|
-
}), n = e.width + t.fontSize * 0.5,
|
|
378
|
-
return t.ctx.save(), t.ctx.strokeStyle = t.color, t.ctx.lineWidth = Math.max(1, t.fontSize * 0.05), t.ctx.lineCap = "round", t.ctx.lineJoin = "miter", t.ctx.beginPath(), t.ctx.moveTo(t.x, t.y -
|
|
936
|
+
}), n = e.width + t.fontSize * 0.5, s = e.height * 1.1;
|
|
937
|
+
return t.ctx.save(), t.ctx.strokeStyle = t.color, t.ctx.lineWidth = Math.max(1, t.fontSize * 0.05), t.ctx.lineCap = "round", t.ctx.lineJoin = "miter", t.ctx.beginPath(), t.ctx.moveTo(t.x, t.y - s * 0.3), t.ctx.lineTo(t.x + t.fontSize * 0.15, t.y), t.ctx.lineTo(t.x + t.fontSize * 0.3, t.y - s * 0.9), t.ctx.lineTo(t.x + n, t.y - s * 0.9), t.ctx.stroke(), t.ctx.restore(), {
|
|
379
938
|
width: n,
|
|
380
|
-
height:
|
|
939
|
+
height: s,
|
|
381
940
|
baseline: e.baseline
|
|
382
941
|
};
|
|
383
942
|
}
|
|
384
|
-
function
|
|
943
|
+
function C(r, t) {
|
|
385
944
|
const n = document.createElement("canvas").getContext("2d");
|
|
386
|
-
return n ?
|
|
945
|
+
return n ? v(r, { ...t, ctx: n, x: 0, y: 0 }) : { width: 0, height: 0, baseline: 0 };
|
|
387
946
|
}
|
|
388
|
-
function
|
|
947
|
+
function le(r = {}) {
|
|
389
948
|
const e = { ...{
|
|
390
949
|
fontSize: 14,
|
|
391
950
|
fontFamily: "serif",
|
|
392
951
|
color: "#000000",
|
|
393
952
|
enableCache: !0,
|
|
394
953
|
customSymbols: {}
|
|
395
|
-
}, ...
|
|
396
|
-
function
|
|
954
|
+
}, ...r }, n = 1e3;
|
|
955
|
+
function s(a) {
|
|
397
956
|
if (a.size > n) {
|
|
398
|
-
const
|
|
399
|
-
|
|
957
|
+
const d = a.keys().next().value;
|
|
958
|
+
d !== void 0 && a.delete(d);
|
|
400
959
|
}
|
|
401
960
|
}
|
|
402
961
|
const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
403
|
-
function
|
|
962
|
+
function i() {
|
|
404
963
|
o.clear(), l.clear();
|
|
405
964
|
}
|
|
406
965
|
function c(a) {
|
|
407
966
|
if (!e.enableCache)
|
|
408
967
|
return P(a);
|
|
409
|
-
let
|
|
410
|
-
return
|
|
968
|
+
let d = o.get(a);
|
|
969
|
+
return d || (d = P(a), o.set(a, d), s(o)), d;
|
|
411
970
|
}
|
|
412
|
-
function
|
|
413
|
-
const
|
|
414
|
-
return
|
|
415
|
-
ctx:
|
|
416
|
-
x:
|
|
417
|
-
y,
|
|
418
|
-
fontSize:
|
|
419
|
-
fontFamily:
|
|
420
|
-
color:
|
|
971
|
+
function h(a, d, y, w, S = {}) {
|
|
972
|
+
const u = { ...e, ...S }, f = c(a);
|
|
973
|
+
return v(f, {
|
|
974
|
+
ctx: d,
|
|
975
|
+
x: y,
|
|
976
|
+
y: w,
|
|
977
|
+
fontSize: u.fontSize,
|
|
978
|
+
fontFamily: u.fontFamily,
|
|
979
|
+
color: u.color,
|
|
421
980
|
scale: 1
|
|
422
981
|
});
|
|
423
982
|
}
|
|
424
|
-
function p(a,
|
|
425
|
-
const
|
|
426
|
-
if (e.enableCache && l.has(
|
|
427
|
-
return l.get(
|
|
428
|
-
const
|
|
429
|
-
if (!
|
|
983
|
+
function p(a, d = {}) {
|
|
984
|
+
const y = `${a}:${d.fontSize || e.fontSize}`;
|
|
985
|
+
if (e.enableCache && l.has(y))
|
|
986
|
+
return l.get(y);
|
|
987
|
+
const w = { ...e, ...d }, S = c(a), f = document.createElement("canvas").getContext("2d");
|
|
988
|
+
if (!f)
|
|
430
989
|
return { width: 0, height: 0, baseline: 0 };
|
|
431
|
-
const
|
|
432
|
-
ctx:
|
|
990
|
+
const b = v(S, {
|
|
991
|
+
ctx: f,
|
|
433
992
|
x: 0,
|
|
434
993
|
y: 0,
|
|
435
|
-
fontSize:
|
|
436
|
-
fontFamily:
|
|
437
|
-
color:
|
|
994
|
+
fontSize: w.fontSize,
|
|
995
|
+
fontFamily: w.fontFamily,
|
|
996
|
+
color: w.color,
|
|
438
997
|
scale: 1
|
|
439
998
|
});
|
|
440
|
-
return e.enableCache && (l.set(
|
|
999
|
+
return e.enableCache && (l.set(y, b), s(l)), b;
|
|
441
1000
|
}
|
|
442
|
-
function
|
|
1001
|
+
function g() {
|
|
443
1002
|
return {
|
|
444
1003
|
parseCache: o.size,
|
|
445
1004
|
measureCache: l.size,
|
|
@@ -458,17 +1017,17 @@ function V(s = {}) {
|
|
|
458
1017
|
a.log.info("LaTeX plugin initialized");
|
|
459
1018
|
},
|
|
460
1019
|
onDestroy(a) {
|
|
461
|
-
|
|
1020
|
+
i(), a.log.info("LaTeX plugin destroyed");
|
|
462
1021
|
},
|
|
463
1022
|
api: {
|
|
464
|
-
render:
|
|
1023
|
+
render: h,
|
|
465
1024
|
measure: p,
|
|
466
|
-
clearCache:
|
|
467
|
-
getCacheStats:
|
|
1025
|
+
clearCache: i,
|
|
1026
|
+
getCacheStats: g
|
|
468
1027
|
}
|
|
469
1028
|
};
|
|
470
1029
|
}
|
|
471
1030
|
export {
|
|
472
|
-
|
|
1031
|
+
le as PluginLaTeX
|
|
473
1032
|
};
|
|
474
1033
|
//# sourceMappingURL=latex.js.map
|