@thi.ng/geom 8.1.57 → 8.2.2
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/CHANGELOG.md +7 -1
- package/api/points.d.ts +1 -1
- package/api/points3.d.ts +1 -1
- package/api/polygon.d.ts +1 -1
- package/api/polygon3.d.ts +1 -1
- package/api/quad.d.ts +1 -1
- package/api/quad3.d.ts +1 -1
- package/api/triangle.d.ts +1 -1
- package/api/triangle3.d.ts +1 -1
- package/as-svg.d.ts +44 -15
- package/package.json +30 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2025-07-
|
|
3
|
+
- **Last updated**: 2025-07-21T08:21:58Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -11,6 +11,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
11
11
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
12
12
|
and/or version bumps of transitive dependencies.
|
|
13
13
|
|
|
14
|
+
## [8.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom@8.2.0) (2025-07-20)
|
|
15
|
+
|
|
16
|
+
#### 🚀 Features
|
|
17
|
+
|
|
18
|
+
- update SVGDocAttribs, update docs ([7e4a252](https://github.com/thi-ng/umbrella/commit/7e4a252))
|
|
19
|
+
|
|
14
20
|
### [8.1.39](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom@8.1.39) (2025-04-16)
|
|
15
21
|
|
|
16
22
|
#### 🩹 Bug fixes
|
package/api/points.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ export declare class Points extends APC implements IHiccupShape2<Points> {
|
|
|
8
8
|
copy(): Points;
|
|
9
9
|
copyTransformed(fn: Fn<ReadonlyVec[], Vec[]>): Points;
|
|
10
10
|
withAttribs(attribs: Attribs): Points;
|
|
11
|
-
toHiccup(): (string |
|
|
11
|
+
toHiccup(): (string | Vec<number>[] | Attribs | undefined)[];
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=points.d.ts.map
|
package/api/points3.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ export declare class Points3 extends APC implements IHiccupShape3<Points3> {
|
|
|
8
8
|
copy(): Points3;
|
|
9
9
|
copyTransformed(fn: Fn<ReadonlyVec[], Vec[]>): Points3;
|
|
10
10
|
withAttribs(attribs: Attribs): Points3;
|
|
11
|
-
toHiccup(): (string |
|
|
11
|
+
toHiccup(): (string | Vec<number>[] | Attribs | undefined)[];
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=points3.d.ts.map
|
package/api/polygon.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export declare class Polygon extends APC implements IHiccupShape2<Polygon> {
|
|
|
9
9
|
copy(): Polygon;
|
|
10
10
|
copyTransformed(fn: Fn<ReadonlyVec[], Vec[]>): Polygon;
|
|
11
11
|
withAttribs(attribs: Attribs): Polygon;
|
|
12
|
-
toHiccup(): (string |
|
|
12
|
+
toHiccup(): (string | Vec<number>[] | Attribs | undefined)[];
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=polygon.d.ts.map
|
package/api/polygon3.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export declare class Polygon3 extends APC implements IHiccupShape3<Polygon3> {
|
|
|
9
9
|
copy(): Polygon3;
|
|
10
10
|
copyTransformed(fn: Fn<ReadonlyVec[], Vec[]>): Polygon3;
|
|
11
11
|
withAttribs(attribs: Attribs): Polygon3;
|
|
12
|
-
toHiccup(): (string |
|
|
12
|
+
toHiccup(): (string | Vec<number>[] | Attribs | undefined)[];
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=polygon3.d.ts.map
|
package/api/quad.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export declare class Quad extends APC implements IHiccupShape2<Quad> {
|
|
|
9
9
|
copy(): Quad;
|
|
10
10
|
copyTransformed(fn: Fn<ReadonlyVec[], Vec[]>): Quad;
|
|
11
11
|
withAttribs(attribs: Attribs): Quad;
|
|
12
|
-
toHiccup(): (string |
|
|
12
|
+
toHiccup(): (string | Vec<number>[] | Attribs | undefined)[];
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=quad.d.ts.map
|
package/api/quad3.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export declare class Quad3 extends APC implements IHiccupShape3<Quad3> {
|
|
|
9
9
|
copy(): Quad3;
|
|
10
10
|
copyTransformed(fn: Fn<ReadonlyVec[], Vec[]>): Quad3;
|
|
11
11
|
withAttribs(attribs: Attribs): Quad3;
|
|
12
|
-
toHiccup(): (string |
|
|
12
|
+
toHiccup(): (string | Vec<number>[] | Attribs | undefined)[];
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=quad3.d.ts.map
|
package/api/triangle.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export declare class Triangle extends APC implements IHiccupShape2<Triangle> {
|
|
|
9
9
|
copy(): Triangle;
|
|
10
10
|
copyTransformed(fn: Fn<ReadonlyVec[], Vec[]>): Triangle;
|
|
11
11
|
withAttribs(attribs: Attribs): Triangle;
|
|
12
|
-
toHiccup(): (string |
|
|
12
|
+
toHiccup(): (string | Vec<number>[] | Attribs | undefined)[];
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=triangle.d.ts.map
|
package/api/triangle3.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export declare class Triangle3 extends APC implements IHiccupShape3<Triangle3> {
|
|
|
9
9
|
copy(): Triangle3;
|
|
10
10
|
copyTransformed(fn: Fn<ReadonlyVec[], Vec[]>): Triangle3;
|
|
11
11
|
withAttribs(attribs: Attribs): Triangle3;
|
|
12
|
-
toHiccup(): (string |
|
|
12
|
+
toHiccup(): (string | Vec<number>[] | Attribs | undefined)[];
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=triangle3.d.ts.map
|
package/as-svg.d.ts
CHANGED
|
@@ -16,6 +16,31 @@ export interface SVGDocAttribs extends Attribs {
|
|
|
16
16
|
* @defaultValue 0
|
|
17
17
|
*/
|
|
18
18
|
__margin: number;
|
|
19
|
+
/**
|
|
20
|
+
* Number of fractional digits for floating point values.
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue 3
|
|
23
|
+
*/
|
|
24
|
+
__prec: number;
|
|
25
|
+
/**
|
|
26
|
+
* Marker flag for thi.ng/hiccup-svg to indicate enclosed hiccup needs to be
|
|
27
|
+
* converted from the compact format used by thi.ng/geom.
|
|
28
|
+
*
|
|
29
|
+
* Note: The {@link asSvg} function explicitly converts the given hiccup,
|
|
30
|
+
* therefore the {@link SVG_DEFAULT_ATTRIBS} do NOT specify this flag to
|
|
31
|
+
* avoid double conversion. However, if you wish to serialize a
|
|
32
|
+
* {@link svgDoc} document via other means (e.g. directly via
|
|
33
|
+
* thi.ng/hiccup's `serialize()`), then you should enable this flag
|
|
34
|
+
* manually.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* External references:
|
|
38
|
+
*
|
|
39
|
+
* - [`convertTree()`](https://docs.thi.ng/umbrella/hiccup-svg/functions/convertTree.html)
|
|
40
|
+
* - [`svg()`](https://docs.thi.ng/umbrella/hiccup-svg/functions/svg.html)
|
|
41
|
+
* - [`serialize()`](https://docs.thi.ng/umbrella/hiccup/functions/serialize.html)
|
|
42
|
+
*/
|
|
43
|
+
__convert: boolean;
|
|
19
44
|
}
|
|
20
45
|
/**
|
|
21
46
|
* Default document attribs for {@link svgDoc} (minus XMLNS declarations). Can
|
|
@@ -32,7 +57,18 @@ export declare let SVG_DEFAULT_ATTRIBS: Partial<SVGDocAttribs>;
|
|
|
32
57
|
*/
|
|
33
58
|
export declare const setSvgDefaultAttribs: (attribs: Partial<SVGDocAttribs>, merge?: boolean) => void;
|
|
34
59
|
/**
|
|
35
|
-
* Serializes given hiccup tree to an actual SVG source string.
|
|
60
|
+
* Serializes given hiccup tree to an actual SVG source string. The given hiccup
|
|
61
|
+
* arguments are first converted via
|
|
62
|
+
* [`convertTree()`](https://docs.thi.ng/umbrella/hiccup-svg/functions/convertTree.html)
|
|
63
|
+
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* The actual serialization is performed via the
|
|
66
|
+
* [thi.ng/hiccup](https://thi.ng/hiccup) and
|
|
67
|
+
* [thi.ng/hiccup-svg](https://thi.ng/hiccup-svg) packages. Floating point
|
|
68
|
+
* precision for various point coordinates can be controlled via the
|
|
69
|
+
* {@link SVGDocAttribs.__prec} attribute, either for the entire doc or on a
|
|
70
|
+
* per-shape basis. If omitted, the currently configured precision will be used
|
|
71
|
+
* (default: 3).
|
|
36
72
|
*
|
|
37
73
|
* @param args
|
|
38
74
|
*/
|
|
@@ -40,25 +76,18 @@ export declare const asSvg: (...args: any[]) => string;
|
|
|
40
76
|
/**
|
|
41
77
|
* Creates a hiccup SVG doc element container for given {@link IShape}s and
|
|
42
78
|
* attribs (merged with {@link SVG_DEFAULT_ATTRIBS}). If the attribs do not
|
|
43
|
-
* include a
|
|
44
|
-
* for the case a viewbox needs to be computed), a
|
|
45
|
-
*
|
|
79
|
+
* include a {@link SVGDocAttribs.viewBox}, it will be computed automatically.
|
|
80
|
+
* Furthermore (and only for the case a viewbox needs to be computed), a
|
|
81
|
+
* {@link SVGDocAttribs.__margin} attrib can be provided to include a
|
|
82
|
+
* bleed/margin for the viewbox (in world space units).
|
|
46
83
|
*
|
|
47
84
|
* @remarks
|
|
48
85
|
* Use {@link asSvg} to serialize the resulting doc to an SVG string.
|
|
49
86
|
*
|
|
50
|
-
*
|
|
51
|
-
* [thi.ng/hiccup](https://thi.ng/hiccup) and
|
|
52
|
-
* [thi.ng/hiccup-svg](https://thi.ng/hiccup-svg) packages. Floating point
|
|
53
|
-
* precision for various point coordinates can be controlled via the `__prec`
|
|
54
|
-
* attribute (number of fractional digits), either for the entire doc or on a
|
|
55
|
-
* per-shape basis. If omitted, the currently configured precision will be used
|
|
56
|
-
* (default: 3).
|
|
87
|
+
* References:
|
|
57
88
|
*
|
|
58
|
-
*
|
|
59
|
-
* [`
|
|
60
|
-
* and
|
|
61
|
-
* [`setPrecision`](https://docs.thi.ng/umbrella/hiccup-svg/functions/setPrecision.html).
|
|
89
|
+
* - [`convertTree()`](https://docs.thi.ng/umbrella/hiccup-svg/functions/convertTree.html)
|
|
90
|
+
* - [`setPrecision()`](https://docs.thi.ng/umbrella/hiccup-svg/functions/setPrecision.html)
|
|
62
91
|
*
|
|
63
92
|
* @param attribs
|
|
64
93
|
* @param shapes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/geom",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.2",
|
|
4
4
|
"description": "Functional, polymorphic API for 2D geometry types & SVG generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -40,36 +40,36 @@
|
|
|
40
40
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@thi.ng/adjacency": "^3.0.
|
|
44
|
-
"@thi.ng/api": "^8.11.
|
|
45
|
-
"@thi.ng/arrays": "^2.13.
|
|
46
|
-
"@thi.ng/checks": "^3.7.
|
|
47
|
-
"@thi.ng/defmulti": "^3.0.
|
|
48
|
-
"@thi.ng/equiv": "^2.1.
|
|
49
|
-
"@thi.ng/errors": "^2.5.
|
|
50
|
-
"@thi.ng/geom-arc": "^2.1.
|
|
51
|
-
"@thi.ng/geom-clip-line": "^2.3.
|
|
52
|
-
"@thi.ng/geom-clip-poly": "^2.1.
|
|
53
|
-
"@thi.ng/geom-closest-point": "^2.1.
|
|
54
|
-
"@thi.ng/geom-hull": "^2.1.
|
|
55
|
-
"@thi.ng/geom-isec": "^4.0.
|
|
56
|
-
"@thi.ng/geom-poly-utils": "^3.0.
|
|
57
|
-
"@thi.ng/geom-resample": "^3.0.
|
|
58
|
-
"@thi.ng/geom-splines": "^2.3.
|
|
59
|
-
"@thi.ng/geom-subdiv-curve": "^3.0.
|
|
60
|
-
"@thi.ng/geom-tessellate": "^3.0.
|
|
61
|
-
"@thi.ng/hiccup": "^5.3.
|
|
62
|
-
"@thi.ng/hiccup-svg": "^5.4.
|
|
63
|
-
"@thi.ng/math": "^5.11.
|
|
64
|
-
"@thi.ng/matrices": "^3.0.
|
|
65
|
-
"@thi.ng/object-utils": "^1.2.
|
|
66
|
-
"@thi.ng/random": "^4.1.
|
|
67
|
-
"@thi.ng/strings": "^3.9.
|
|
68
|
-
"@thi.ng/transducers": "^9.6.
|
|
69
|
-
"@thi.ng/vectors": "^8.
|
|
43
|
+
"@thi.ng/adjacency": "^3.0.48",
|
|
44
|
+
"@thi.ng/api": "^8.11.32",
|
|
45
|
+
"@thi.ng/arrays": "^2.13.5",
|
|
46
|
+
"@thi.ng/checks": "^3.7.12",
|
|
47
|
+
"@thi.ng/defmulti": "^3.0.72",
|
|
48
|
+
"@thi.ng/equiv": "^2.1.88",
|
|
49
|
+
"@thi.ng/errors": "^2.5.38",
|
|
50
|
+
"@thi.ng/geom-arc": "^2.1.186",
|
|
51
|
+
"@thi.ng/geom-clip-line": "^2.3.143",
|
|
52
|
+
"@thi.ng/geom-clip-poly": "^2.1.185",
|
|
53
|
+
"@thi.ng/geom-closest-point": "^2.1.181",
|
|
54
|
+
"@thi.ng/geom-hull": "^2.1.181",
|
|
55
|
+
"@thi.ng/geom-isec": "^4.0.53",
|
|
56
|
+
"@thi.ng/geom-poly-utils": "^3.0.53",
|
|
57
|
+
"@thi.ng/geom-resample": "^3.0.53",
|
|
58
|
+
"@thi.ng/geom-splines": "^2.3.53",
|
|
59
|
+
"@thi.ng/geom-subdiv-curve": "^3.0.59",
|
|
60
|
+
"@thi.ng/geom-tessellate": "^3.0.59",
|
|
61
|
+
"@thi.ng/hiccup": "^5.3.18",
|
|
62
|
+
"@thi.ng/hiccup-svg": "^5.4.46",
|
|
63
|
+
"@thi.ng/math": "^5.11.32",
|
|
64
|
+
"@thi.ng/matrices": "^3.0.12",
|
|
65
|
+
"@thi.ng/object-utils": "^1.2.4",
|
|
66
|
+
"@thi.ng/random": "^4.1.23",
|
|
67
|
+
"@thi.ng/strings": "^3.9.18",
|
|
68
|
+
"@thi.ng/transducers": "^9.6.3",
|
|
69
|
+
"@thi.ng/vectors": "^8.4.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"esbuild": "^0.25.
|
|
72
|
+
"esbuild": "^0.25.8",
|
|
73
73
|
"typedoc": "^0.28.7",
|
|
74
74
|
"typescript": "^5.8.3"
|
|
75
75
|
},
|
|
@@ -533,5 +533,5 @@
|
|
|
533
533
|
"tag": "geometry",
|
|
534
534
|
"year": 2013
|
|
535
535
|
},
|
|
536
|
-
"gitHead": "
|
|
536
|
+
"gitHead": "11747c482773d3da03c8b7848b25a56251ccd759\n"
|
|
537
537
|
}
|