figureone 1.2.1 → 1.4.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/figureone.min.js +1 -1
- package/index.js +189 -46
- package/package.json +1 -1
- package/types/js/figure/Element.d.ts +1 -0
- package/types/js/figure/Equation/Elements/BaseAnnotationFunction.d.ts +1 -0
- package/types/js/figure/Equation/Elements/BaseEquationFunction.d.ts +1 -0
- package/types/js/figure/Equation/Equation.d.ts +24 -0
- package/types/js/figure/Equation/EquationFunctions.d.ts +27 -0
|
@@ -170,6 +170,9 @@ export type TypeEquationPhrase = string | number | {
|
|
|
170
170
|
* @property {boolean} [fullContentBounds] - (`false`)
|
|
171
171
|
* @property {boolean} [showContent] - if `false`, a container will be created
|
|
172
172
|
* around the content, but the content will not be shown (`true`)
|
|
173
|
+
* @property {string} [name] - optional identifier (available on every equation
|
|
174
|
+
* function). Has no effect on layout, but allows the function's contents to be
|
|
175
|
+
* looked up later with {@link Equation.getElementsInForm} (`null`)
|
|
173
176
|
*
|
|
174
177
|
* @see To test examples, append them to the
|
|
175
178
|
* <a href="#drawing-boilerplate">boilerplate</a>
|
|
@@ -236,6 +239,7 @@ export type EQN_Container = {
|
|
|
236
239
|
scale?: number;
|
|
237
240
|
fullContentBounds?: boolean;
|
|
238
241
|
showContent?: boolean;
|
|
242
|
+
name?: string;
|
|
239
243
|
} | [
|
|
240
244
|
TypeEquationPhrase,
|
|
241
245
|
(number | null | undefined),
|
|
@@ -288,6 +292,7 @@ export type EQN_Offset = {
|
|
|
288
292
|
offset?: TypeParsablePoint;
|
|
289
293
|
inSize?: boolean;
|
|
290
294
|
fullContentBounds?: boolean;
|
|
295
|
+
name?: string;
|
|
291
296
|
} | [
|
|
292
297
|
TypeEquationPhrase,
|
|
293
298
|
(TypeParsablePoint | null | undefined),
|
|
@@ -411,6 +416,7 @@ export type EQN_Fraction = {
|
|
|
411
416
|
offsetY?: number;
|
|
412
417
|
baseline?: 'numerator' | 'denominator' | 'vinculum';
|
|
413
418
|
fullContentBounds?: boolean;
|
|
419
|
+
name?: string;
|
|
414
420
|
} | [
|
|
415
421
|
TypeEquationPhrase,
|
|
416
422
|
string,
|
|
@@ -486,6 +492,7 @@ export type EQN_Scale = {
|
|
|
486
492
|
content: TypeEquationPhrase;
|
|
487
493
|
scale?: number;
|
|
488
494
|
fullContentBounds?: boolean;
|
|
495
|
+
name?: string;
|
|
489
496
|
} | [
|
|
490
497
|
TypeEquationPhrase,
|
|
491
498
|
(number | null | undefined),
|
|
@@ -564,6 +571,7 @@ export type EQN_Color = {
|
|
|
564
571
|
content: TypeEquationPhrase;
|
|
565
572
|
color: TypeColor;
|
|
566
573
|
fullContentBounds?: boolean;
|
|
574
|
+
name?: string;
|
|
567
575
|
} | [
|
|
568
576
|
TypeEquationPhrase,
|
|
569
577
|
TypeColor,
|
|
@@ -677,6 +685,7 @@ export type EQN_Bracket = {
|
|
|
677
685
|
descent?: number;
|
|
678
686
|
fullContentBounds?: boolean;
|
|
679
687
|
useFullBounds?: boolean;
|
|
688
|
+
name?: string;
|
|
680
689
|
} | [
|
|
681
690
|
string,
|
|
682
691
|
TypeEquationPhrase,
|
|
@@ -812,6 +821,7 @@ export type EQN_Root = {
|
|
|
812
821
|
rootScale?: number;
|
|
813
822
|
fullContentBounds?: boolean;
|
|
814
823
|
useFullBounds?: boolean;
|
|
824
|
+
name?: string;
|
|
815
825
|
} | [
|
|
816
826
|
string,
|
|
817
827
|
TypeEquationPhrase,
|
|
@@ -928,6 +938,7 @@ export type EQN_Strike = {
|
|
|
928
938
|
leftSpace?: number;
|
|
929
939
|
fullContentBounds?: boolean;
|
|
930
940
|
useFullBounds?: boolean;
|
|
941
|
+
name?: string;
|
|
931
942
|
} | [
|
|
932
943
|
TypeEquationPhrase,
|
|
933
944
|
string,
|
|
@@ -1045,6 +1056,7 @@ export type EQN_Box = {
|
|
|
1045
1056
|
leftSpace?: number;
|
|
1046
1057
|
fullContentBounds?: boolean;
|
|
1047
1058
|
useFullBounds?: boolean;
|
|
1059
|
+
name?: string;
|
|
1048
1060
|
} | [
|
|
1049
1061
|
TypeEquationPhrase,
|
|
1050
1062
|
string,
|
|
@@ -1092,6 +1104,7 @@ export type EQN_TouchBox = {
|
|
|
1092
1104
|
rightSpace?: number;
|
|
1093
1105
|
bottomSpace?: number;
|
|
1094
1106
|
leftSpace?: number;
|
|
1107
|
+
name?: string;
|
|
1095
1108
|
} | [
|
|
1096
1109
|
TypeEquationPhrase,
|
|
1097
1110
|
string,
|
|
@@ -1232,6 +1245,7 @@ export type EQN_Bar = {
|
|
|
1232
1245
|
descent?: number;
|
|
1233
1246
|
fullContentBounds?: boolean;
|
|
1234
1247
|
useFullBounds?: boolean;
|
|
1248
|
+
name?: string;
|
|
1235
1249
|
} | [
|
|
1236
1250
|
TypeEquationPhrase,
|
|
1237
1251
|
(string | null | undefined),
|
|
@@ -1403,6 +1417,7 @@ export type EQN_Integral = {
|
|
|
1403
1417
|
toYAlign?: 'bottom' | 'top' | 'middle' | 'baseline' | number;
|
|
1404
1418
|
fullBoundsContent?: boolean;
|
|
1405
1419
|
useFullBounds?: boolean;
|
|
1420
|
+
name?: string;
|
|
1406
1421
|
} | [
|
|
1407
1422
|
(string | null | undefined),
|
|
1408
1423
|
(TypeEquationPhrase | null | undefined),
|
|
@@ -1543,6 +1558,7 @@ export type EQN_SumOf = {
|
|
|
1543
1558
|
toOffset?: TypeParsablePoint;
|
|
1544
1559
|
fullBoundsContent?: boolean;
|
|
1545
1560
|
useFullBounds?: boolean;
|
|
1561
|
+
name?: string;
|
|
1546
1562
|
} | [
|
|
1547
1563
|
(string | null | undefined),
|
|
1548
1564
|
TypeEquationPhrase,
|
|
@@ -1675,6 +1691,7 @@ export type EQN_ProdOf = {
|
|
|
1675
1691
|
toOffset?: TypeParsablePoint;
|
|
1676
1692
|
fullBoundsContent?: boolean;
|
|
1677
1693
|
useFullBounds?: boolean;
|
|
1694
|
+
name?: string;
|
|
1678
1695
|
} | [
|
|
1679
1696
|
(string | null | undefined),
|
|
1680
1697
|
TypeEquationPhrase,
|
|
@@ -1764,6 +1781,7 @@ export type EQN_Subscript = {
|
|
|
1764
1781
|
scale?: number;
|
|
1765
1782
|
offset?: TypeParsablePoint;
|
|
1766
1783
|
inSize: boolean;
|
|
1784
|
+
name?: string;
|
|
1767
1785
|
} | [
|
|
1768
1786
|
TypeEquationPhrase,
|
|
1769
1787
|
TypeEquationPhrase,
|
|
@@ -1831,6 +1849,7 @@ export type EQN_Superscript = {
|
|
|
1831
1849
|
scale?: number;
|
|
1832
1850
|
offset?: TypeParsablePoint;
|
|
1833
1851
|
inSize: boolean;
|
|
1852
|
+
name?: string;
|
|
1834
1853
|
} | [
|
|
1835
1854
|
TypeEquationPhrase,
|
|
1836
1855
|
TypeEquationPhrase,
|
|
@@ -1900,6 +1919,7 @@ export type EQN_SuperscriptSubscript = {
|
|
|
1900
1919
|
superscriptOffset?: TypeParsablePoint;
|
|
1901
1920
|
subscriptOffset?: TypeParsablePoint;
|
|
1902
1921
|
inSize?: boolean;
|
|
1922
|
+
name?: string;
|
|
1903
1923
|
} | [
|
|
1904
1924
|
TypeEquationPhrase,
|
|
1905
1925
|
TypeEquationPhrase,
|
|
@@ -2012,6 +2032,7 @@ export type EQN_Comment = {
|
|
|
2012
2032
|
inSize?: boolean;
|
|
2013
2033
|
fullContentBounds?: boolean;
|
|
2014
2034
|
useFullBounds?: boolean;
|
|
2035
|
+
name?: string;
|
|
2015
2036
|
} | [
|
|
2016
2037
|
TypeEquationPhrase,
|
|
2017
2038
|
TypeEquationPhrase,
|
|
@@ -2108,6 +2129,7 @@ export type EQN_StrikeComment = {
|
|
|
2108
2129
|
space?: number;
|
|
2109
2130
|
scale?: number;
|
|
2110
2131
|
commentSpace?: number;
|
|
2132
|
+
name?: string;
|
|
2111
2133
|
} | [
|
|
2112
2134
|
(TypeEquationPhrase | null | undefined),
|
|
2113
2135
|
(string | null | undefined),
|
|
@@ -2184,6 +2206,7 @@ export type EQN_Pad = {
|
|
|
2184
2206
|
right?: number;
|
|
2185
2207
|
bottom?: number;
|
|
2186
2208
|
left?: number;
|
|
2209
|
+
name?: string;
|
|
2187
2210
|
} | [
|
|
2188
2211
|
TypeEquationPhrase,
|
|
2189
2212
|
(number | null | undefined),
|
|
@@ -2306,6 +2329,7 @@ export type EQN_Matrix = {
|
|
|
2306
2329
|
yAlign?: 'baseline' | 'middle';
|
|
2307
2330
|
brac?: EQN_Bracket;
|
|
2308
2331
|
fullContentBounds?: boolean;
|
|
2332
|
+
name?: string;
|
|
2309
2333
|
} | [
|
|
2310
2334
|
([number, number] | null | undefined),
|
|
2311
2335
|
(string | null | undefined),
|
|
@@ -2460,6 +2484,7 @@ export type EQN_Lines = {
|
|
|
2460
2484
|
space?: number;
|
|
2461
2485
|
yAlign?: 'bottom' | 'top' | 'middle' | number;
|
|
2462
2486
|
fullContentBounds?: boolean;
|
|
2487
|
+
name?: string;
|
|
2463
2488
|
};
|
|
2464
2489
|
/**
|
|
2465
2490
|
* Annotation options object.
|
|
@@ -3214,6 +3239,7 @@ export type EQN_Annotate = {
|
|
|
3214
3239
|
leftSpace?: number;
|
|
3215
3240
|
rightSpace?: number;
|
|
3216
3241
|
contentScale?: number;
|
|
3242
|
+
name?: string;
|
|
3217
3243
|
};
|
|
3218
3244
|
/**
|
|
3219
3245
|
* Equation Functions.
|
|
@@ -3247,6 +3273,7 @@ export declare class EquationFunctions {
|
|
|
3247
3273
|
parseContent(content: TypeEquationPhrase | null | undefined): any;
|
|
3248
3274
|
contentToElement(content: TypeEquationPhrase | Elements | FigureElementPrimitive | FigureElementCollection): Elements;
|
|
3249
3275
|
eqnMethod(name: string, params: any): BaseAnnotationFunction | Fraction | Matrix | Lines | Scale | Container | Offset | Color | null;
|
|
3276
|
+
dispatchEqnMethod(name: string, params: any): BaseAnnotationFunction | Fraction | Matrix | Lines | Scale | Container | Offset | Color | null;
|
|
3250
3277
|
/**
|
|
3251
3278
|
* Equation container function
|
|
3252
3279
|
* @see {@link EQN_Container} for description and examples
|