@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-07-11T22:07:07Z
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 | Attribs | Vec<number>[] | undefined)[];
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 | Attribs | Vec<number>[] | undefined)[];
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 | Attribs | Vec<number>[] | undefined)[];
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 | Attribs | Vec<number>[] | undefined)[];
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 | Attribs | Vec<number>[] | undefined)[];
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 | Attribs | Vec<number>[] | undefined)[];
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 | Attribs | Vec<number>[] | undefined)[];
12
+ toHiccup(): (string | Vec<number>[] | Attribs | undefined)[];
13
13
  }
14
14
  //# sourceMappingURL=triangle.d.ts.map
@@ -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 | Attribs | Vec<number>[] | undefined)[];
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 `viewBox`, it will be computed automatically. Furthermore (and only
44
- * for the case a viewbox needs to be computed), a `__margin` attrib can be
45
- * provided to include a bleed/margin for the viewbox (in world space units).
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
- * The actual serialization is performed via the
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
- * Also see
59
- * [`convertTree`](https://docs.thi.ng/umbrella/hiccup-svg/functions/convertTree.html)
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.1.57",
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.46",
44
- "@thi.ng/api": "^8.11.30",
45
- "@thi.ng/arrays": "^2.13.3",
46
- "@thi.ng/checks": "^3.7.10",
47
- "@thi.ng/defmulti": "^3.0.70",
48
- "@thi.ng/equiv": "^2.1.86",
49
- "@thi.ng/errors": "^2.5.36",
50
- "@thi.ng/geom-arc": "^2.1.183",
51
- "@thi.ng/geom-clip-line": "^2.3.140",
52
- "@thi.ng/geom-clip-poly": "^2.1.182",
53
- "@thi.ng/geom-closest-point": "^2.1.178",
54
- "@thi.ng/geom-hull": "^2.1.178",
55
- "@thi.ng/geom-isec": "^4.0.50",
56
- "@thi.ng/geom-poly-utils": "^3.0.50",
57
- "@thi.ng/geom-resample": "^3.0.50",
58
- "@thi.ng/geom-splines": "^2.3.50",
59
- "@thi.ng/geom-subdiv-curve": "^3.0.56",
60
- "@thi.ng/geom-tessellate": "^3.0.56",
61
- "@thi.ng/hiccup": "^5.3.16",
62
- "@thi.ng/hiccup-svg": "^5.4.43",
63
- "@thi.ng/math": "^5.11.30",
64
- "@thi.ng/matrices": "^3.0.9",
65
- "@thi.ng/object-utils": "^1.2.2",
66
- "@thi.ng/random": "^4.1.21",
67
- "@thi.ng/strings": "^3.9.16",
68
- "@thi.ng/transducers": "^9.6.1",
69
- "@thi.ng/vectors": "^8.3.3"
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.6",
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": "9ec4a5584ed6e59f2b74f4ca9726daef7e766974\n"
536
+ "gitHead": "11747c482773d3da03c8b7848b25a56251ccd759\n"
537
537
  }