@thi.ng/grid-iterators 3.1.1 → 4.0.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/CHANGELOG.md +17 -1
- package/README.md +5 -4
- package/api.d.ts +14 -6
- package/column-ends.d.ts +2 -2
- package/columns.d.ts +2 -2
- package/diagonal-ends.d.ts +3 -3
- package/diagonal-slope.d.ts +4 -4
- package/diagonal.d.ts +2 -2
- package/filters.d.ts +18 -0
- package/filters.js +22 -0
- package/hilbert.d.ts +2 -2
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/interleave.d.ts +4 -4
- package/package.json +15 -12
- package/random.d.ts +3 -3
- package/row-ends.d.ts +2 -2
- package/rows.d.ts +2 -2
- package/spiral.d.ts +2 -2
- package/transforms.d.ts +7 -7
- package/utils.d.ts +3 -3
- package/zcurve.d.ts +2 -2
- package/zigzag-columns.d.ts +2 -2
- package/zigzag-diagonal.d.ts +2 -2
- package/zigzag-rows.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2023-
|
|
3
|
+
- **Last updated**: 2023-04-08T11:09:50Z
|
|
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.
|
|
@@ -9,6 +9,22 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
# [4.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/grid-iterators@4.0.0) (2023-04-08)
|
|
13
|
+
|
|
14
|
+
#### 🛑 Breaking changes
|
|
15
|
+
|
|
16
|
+
- add/rename types/opts ([bc3ea21](https://github.com/thi-ng/umbrella/commit/bc3ea21))
|
|
17
|
+
- BREAKING CHANGE: rename various option types (add 2D/3D suffixes)
|
|
18
|
+
|
|
19
|
+
#### 🚀 Features
|
|
20
|
+
|
|
21
|
+
- add filter predicates ([81abf60](https://github.com/thi-ng/umbrella/commit/81abf60))
|
|
22
|
+
- add isDiagonal/Alt() filters
|
|
23
|
+
|
|
24
|
+
#### 🩹 Bug fixes
|
|
25
|
+
|
|
26
|
+
- fix imports ([353bc3d](https://github.com/thi-ng/umbrella/commit/353bc3d))
|
|
27
|
+
|
|
12
28
|
## [3.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/grid-iterators@3.1.0) (2023-03-25)
|
|
13
29
|
|
|
14
30
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -240,7 +240,7 @@ For Node.js REPL:
|
|
|
240
240
|
const gridIterators = await import("@thi.ng/grid-iterators");
|
|
241
241
|
```
|
|
242
242
|
|
|
243
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 2.
|
|
243
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 2.57 KB
|
|
244
244
|
|
|
245
245
|
## Dependencies
|
|
246
246
|
|
|
@@ -261,9 +261,10 @@ directory are using this package.
|
|
|
261
261
|
|
|
262
262
|
A selection:
|
|
263
263
|
|
|
264
|
-
| Screenshot | Description
|
|
265
|
-
|
|
266
|
-
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/grid-iterators.png" width="240"/> | Visualization of different grid iterator strategies
|
|
264
|
+
| Screenshot | Description | Live demo | Source |
|
|
265
|
+
|:----------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------|:-----------------------------------------------------|:----------------------------------------------------------------------------------|
|
|
266
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/grid-iterators.png" width="240"/> | Visualization of different grid iterator strategies | [Demo](https://demo.thi.ng/umbrella/grid-iterators/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/grid-iterators) |
|
|
267
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/trace-bitmap.jpg" width="240"/> | Multi-layer vectorization & dithering of bitmap images | [Demo](https://demo.thi.ng/umbrella/trace-bitmap/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/trace-bitmap) |
|
|
267
268
|
|
|
268
269
|
## API
|
|
269
270
|
|
package/api.d.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import type { Fn, FnU2 } from "@thi.ng/api";
|
|
1
|
+
import type { Fn, FnU2, FnU3 } from "@thi.ng/api";
|
|
2
|
+
export type GridCoord2D = [number, number];
|
|
3
|
+
export type GridCoord3D = [number, number, number];
|
|
2
4
|
/**
|
|
3
5
|
* Higher order point coordinate transformation function. First is called with
|
|
4
6
|
* grid resolution (cols,rows), then returns a function which is applied to each
|
|
5
7
|
* generated grid coordinate.
|
|
6
8
|
*/
|
|
7
|
-
export type
|
|
8
|
-
|
|
9
|
+
export type PointTransform2D = FnU2<number, FnU2<number, GridCoord2D>>;
|
|
10
|
+
/**
|
|
11
|
+
* Higher order point coordinate transformation function. First is called with
|
|
12
|
+
* grid resolution (cols,rows,slices), then returns a function which is applied
|
|
13
|
+
* to each generated grid coordinate.
|
|
14
|
+
*/
|
|
15
|
+
export type PointTransform3D = FnU3<number, FnU3<number, GridCoord3D>>;
|
|
16
|
+
export interface GridIterOpts2D {
|
|
9
17
|
/**
|
|
10
18
|
* Number of grid columns
|
|
11
19
|
*/
|
|
@@ -20,8 +28,8 @@ export interface GridIterOpts {
|
|
|
20
28
|
*
|
|
21
29
|
* @defaultValue {@link ident}
|
|
22
30
|
*/
|
|
23
|
-
tx?:
|
|
31
|
+
tx?: PointTransform2D;
|
|
24
32
|
}
|
|
25
|
-
export type GridIterator2D = Fn<
|
|
26
|
-
export type GridIterator3D = Fn<
|
|
33
|
+
export type GridIterator2D = Fn<GridIterOpts2D, Iterable<GridCoord2D>>;
|
|
34
|
+
export type GridIterator3D = Fn<GridIterOpts2D, Iterable<GridCoord3D>>;
|
|
27
35
|
//# sourceMappingURL=api.d.ts.map
|
package/column-ends.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Filtered version of {@link columns2d}, only including end points of
|
|
4
4
|
* each column.
|
|
5
5
|
*
|
|
6
6
|
* @param opts -
|
|
7
7
|
*/
|
|
8
|
-
export declare function columnEnds2d(opts:
|
|
8
|
+
export declare function columnEnds2d(opts: GridIterOpts2D): Generator<import("./api.js").GridCoord2D, void, unknown>;
|
|
9
9
|
//# sourceMappingURL=column-ends.d.ts.map
|
package/columns.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Yields sequence of 2D grid coordinates in column-major order.
|
|
4
4
|
*
|
|
5
5
|
* @param opts -
|
|
6
6
|
*/
|
|
7
|
-
export declare const columns2d: (opts:
|
|
7
|
+
export declare const columns2d: (opts: GridIterOpts2D) => IterableIterator<import("./api.js").GridCoord2D>;
|
|
8
8
|
//# sourceMappingURL=columns.d.ts.map
|
package/diagonal-ends.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Filtered version of {@link diagonal2d}, only including end points of the
|
|
4
4
|
* diagonals. Unless `all` option is enabled (default: false), the very first
|
|
@@ -9,7 +9,7 @@ import type { GridIterOpts } from "./api.js";
|
|
|
9
9
|
*
|
|
10
10
|
* @param opts -
|
|
11
11
|
*/
|
|
12
|
-
export declare function diagonalEnds2d(opts:
|
|
12
|
+
export declare function diagonalEnds2d(opts: GridIterOpts2D & {
|
|
13
13
|
all?: boolean;
|
|
14
|
-
}): Generator<
|
|
14
|
+
}): Generator<import("./api.js").GridCoord2D, void, unknown>;
|
|
15
15
|
//# sourceMappingURL=diagonal-ends.d.ts.map
|
package/diagonal-slope.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
interface DiagonalSlopeOpts extends
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
|
+
interface DiagonalSlopeOpts extends GridIterOpts2D {
|
|
3
3
|
/**
|
|
4
4
|
* Diagonal slope / step size
|
|
5
5
|
*/
|
|
@@ -30,7 +30,7 @@ interface DiagonalSlopeOpts extends GridIterOpts {
|
|
|
30
30
|
*
|
|
31
31
|
* @param opts -
|
|
32
32
|
*/
|
|
33
|
-
export declare function diagonalSlopeY(opts: DiagonalSlopeOpts): Generator<
|
|
33
|
+
export declare function diagonalSlopeY(opts: DiagonalSlopeOpts): Generator<import("./api.js").GridCoord2D, void, unknown>;
|
|
34
34
|
/**
|
|
35
35
|
* Similar to {@link diagonalSlopeY}. Yields sequence of 2D grid coordinates in
|
|
36
36
|
* diagonal order with configurable slope, starting at [step-1,0]. Each
|
|
@@ -39,6 +39,6 @@ export declare function diagonalSlopeY(opts: DiagonalSlopeOpts): Generator<[numb
|
|
|
39
39
|
*
|
|
40
40
|
* @param opts -
|
|
41
41
|
*/
|
|
42
|
-
export declare function diagonalSlopeX(opts: DiagonalSlopeOpts): Generator<
|
|
42
|
+
export declare function diagonalSlopeX(opts: DiagonalSlopeOpts): Generator<import("./api.js").GridCoord2D, void, unknown>;
|
|
43
43
|
export {};
|
|
44
44
|
//# sourceMappingURL=diagonal-slope.d.ts.map
|
package/diagonal.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Yields sequence of 2D grid coordinates in diagonal order starting at [0,0]
|
|
4
4
|
* and using given `cols` and `rows`. Each diagonal starts at y=0 and progresses
|
|
@@ -9,5 +9,5 @@ import type { GridIterOpts } from "./api.js";
|
|
|
9
9
|
*
|
|
10
10
|
* @param opts -
|
|
11
11
|
*/
|
|
12
|
-
export declare function diagonal2d(opts:
|
|
12
|
+
export declare function diagonal2d(opts: GridIterOpts2D): Generator<import("./api.js").GridCoord2D, void, unknown>;
|
|
13
13
|
//# sourceMappingURL=diagonal.d.ts.map
|
package/filters.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { GridCoord2D } from "./api.js";
|
|
2
|
+
/**
|
|
3
|
+
* Returns true if x,y is on a right-to-left diagonal with spacing `n`.
|
|
4
|
+
*
|
|
5
|
+
* @param x
|
|
6
|
+
* @param y
|
|
7
|
+
* @param n
|
|
8
|
+
*/
|
|
9
|
+
export declare const isOnDiagonal: ([x, y]: GridCoord2D, n: number) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Returns true if x,y is on a left-to-right diagonal with spacing `n`.
|
|
12
|
+
*
|
|
13
|
+
* @param x
|
|
14
|
+
* @param y
|
|
15
|
+
* @param n
|
|
16
|
+
*/
|
|
17
|
+
export declare const isOnDiagonalAlt: ([x, y]: GridCoord2D, N: number) => boolean;
|
|
18
|
+
//# sourceMappingURL=filters.d.ts.map
|
package/filters.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if x,y is on a right-to-left diagonal with spacing `n`.
|
|
3
|
+
*
|
|
4
|
+
* @param x
|
|
5
|
+
* @param y
|
|
6
|
+
* @param n
|
|
7
|
+
*/
|
|
8
|
+
export const isOnDiagonal = ([x, y], n) => {
|
|
9
|
+
const d = ((x + y) / n) | 0;
|
|
10
|
+
return y === d * n - x;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Returns true if x,y is on a left-to-right diagonal with spacing `n`.
|
|
14
|
+
*
|
|
15
|
+
* @param x
|
|
16
|
+
* @param y
|
|
17
|
+
* @param n
|
|
18
|
+
*/
|
|
19
|
+
export const isOnDiagonalAlt = ([x, y], N) => {
|
|
20
|
+
const d = ((x - y) / N) | 0;
|
|
21
|
+
return -y === d * N - x;
|
|
22
|
+
};
|
package/hilbert.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Yields sequence of 2D grid coordinates along 2D Hilbert curve using given
|
|
4
4
|
* `cols` and `rows` (each max. 32768 (2^15)).
|
|
@@ -8,5 +8,5 @@ import type { GridIterOpts } from "./api.js";
|
|
|
8
8
|
*
|
|
9
9
|
* @param opts -
|
|
10
10
|
*/
|
|
11
|
-
export declare function hilbert2d(opts:
|
|
11
|
+
export declare function hilbert2d(opts: GridIterOpts2D): Generator<import("./api.js").GridCoord2D, void, unknown>;
|
|
12
12
|
//# sourceMappingURL=hilbert.d.ts.map
|
package/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./diagonal.js";
|
|
|
7
7
|
export * from "./diagonal-ends.js";
|
|
8
8
|
export * from "./diagonal-slope.js";
|
|
9
9
|
export * from "./diamond-square.js";
|
|
10
|
+
export * from "./filters.js";
|
|
10
11
|
export * from "./flood-fill.js";
|
|
11
12
|
export * from "./hilbert.js";
|
|
12
13
|
export * from "./hvline.js";
|
package/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./diagonal.js";
|
|
|
7
7
|
export * from "./diagonal-ends.js";
|
|
8
8
|
export * from "./diagonal-slope.js";
|
|
9
9
|
export * from "./diamond-square.js";
|
|
10
|
+
export * from "./filters.js";
|
|
10
11
|
export * from "./flood-fill.js";
|
|
11
12
|
export * from "./hilbert.js";
|
|
12
13
|
export * from "./hvline.js";
|
package/interleave.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
interface
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
|
+
interface InterleaveOpts2D extends GridIterOpts2D {
|
|
3
3
|
/**
|
|
4
4
|
* Row or column stride.
|
|
5
5
|
*
|
|
@@ -22,7 +22,7 @@ interface InterleaveOpts extends GridIterOpts {
|
|
|
22
22
|
*
|
|
23
23
|
* @param opts -
|
|
24
24
|
*/
|
|
25
|
-
export declare function interleaveColumns2d(opts:
|
|
25
|
+
export declare function interleaveColumns2d(opts: InterleaveOpts2D): Generator<import("./api.js").GridCoord2D, void, undefined>;
|
|
26
26
|
/**
|
|
27
27
|
* Similar to {@link interleaveColumns2d}, but yields 2D grid coordinates in
|
|
28
28
|
* the order of interleaved rows with configurable `step` size (default:
|
|
@@ -37,6 +37,6 @@ export declare function interleaveColumns2d(opts: InterleaveOpts): Generator<[nu
|
|
|
37
37
|
*
|
|
38
38
|
* @param opts -
|
|
39
39
|
*/
|
|
40
|
-
export declare function interleaveRows2d(opts:
|
|
40
|
+
export declare function interleaveRows2d(opts: InterleaveOpts2D): Generator<import("./api.js").GridCoord2D, void, undefined>;
|
|
41
41
|
export {};
|
|
42
42
|
//# sourceMappingURL=interleave.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/grid-iterators",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "2D grid and shape iterators w/ multiple orderings",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -36,22 +36,22 @@
|
|
|
36
36
|
"tool:assets": "tools:node-esm tools/build-assets.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.7.
|
|
40
|
-
"@thi.ng/arrays": "^2.5.
|
|
41
|
-
"@thi.ng/binary": "^3.3.
|
|
42
|
-
"@thi.ng/bitfield": "^2.2.
|
|
43
|
-
"@thi.ng/errors": "^2.2.
|
|
44
|
-
"@thi.ng/morton": "^3.1.
|
|
45
|
-
"@thi.ng/random": "^3.3.
|
|
46
|
-
"@thi.ng/transducers": "^8.4.
|
|
39
|
+
"@thi.ng/api": "^8.7.6",
|
|
40
|
+
"@thi.ng/arrays": "^2.5.10",
|
|
41
|
+
"@thi.ng/binary": "^3.3.23",
|
|
42
|
+
"@thi.ng/bitfield": "^2.2.26",
|
|
43
|
+
"@thi.ng/errors": "^2.2.15",
|
|
44
|
+
"@thi.ng/morton": "^3.1.34",
|
|
45
|
+
"@thi.ng/random": "^3.3.29",
|
|
46
|
+
"@thi.ng/transducers": "^8.4.2"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@microsoft/api-extractor": "^7.34.4",
|
|
50
|
-
"@thi.ng/testament": "^0.3.
|
|
50
|
+
"@thi.ng/testament": "^0.3.15",
|
|
51
51
|
"rimraf": "^4.4.1",
|
|
52
52
|
"tools": "^0.0.1",
|
|
53
53
|
"typedoc": "^0.23.28",
|
|
54
|
-
"typescript": "^5.0.
|
|
54
|
+
"typescript": "^5.0.4"
|
|
55
55
|
},
|
|
56
56
|
"keywords": [
|
|
57
57
|
"2d",
|
|
@@ -112,6 +112,9 @@
|
|
|
112
112
|
"./diamond-square": {
|
|
113
113
|
"default": "./diamond-square.js"
|
|
114
114
|
},
|
|
115
|
+
"./filters": {
|
|
116
|
+
"default": "./filters.js"
|
|
117
|
+
},
|
|
115
118
|
"./flood-fill": {
|
|
116
119
|
"default": "./flood-fill.js"
|
|
117
120
|
},
|
|
@@ -163,5 +166,5 @@
|
|
|
163
166
|
],
|
|
164
167
|
"year": 2019
|
|
165
168
|
},
|
|
166
|
-
"gitHead": "
|
|
169
|
+
"gitHead": "abcedd9e4e06a4b631f363610eec572f79b571c1\n"
|
|
167
170
|
}
|
package/random.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IRandom } from "@thi.ng/random";
|
|
2
|
-
import type {
|
|
3
|
-
interface
|
|
2
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
3
|
+
interface RandomOpts2D extends GridIterOpts2D {
|
|
4
4
|
/**
|
|
5
5
|
* PRNG instance to use
|
|
6
6
|
*
|
|
@@ -17,6 +17,6 @@ interface Random2DOpts extends GridIterOpts {
|
|
|
17
17
|
*
|
|
18
18
|
* @param opts -
|
|
19
19
|
*/
|
|
20
|
-
export declare function random2d(opts:
|
|
20
|
+
export declare function random2d(opts: RandomOpts2D): Generator<import("./api.js").GridCoord2D, void, unknown>;
|
|
21
21
|
export {};
|
|
22
22
|
//# sourceMappingURL=random.d.ts.map
|
package/row-ends.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Filtered version of {@link rows2d}, only including end points of
|
|
4
4
|
* each row.
|
|
5
5
|
*
|
|
6
6
|
* @param opts -
|
|
7
7
|
*/
|
|
8
|
-
export declare function rowEnds2d(opts:
|
|
8
|
+
export declare function rowEnds2d(opts: GridIterOpts2D): Generator<import("./api.js").GridCoord2D, void, unknown>;
|
|
9
9
|
//# sourceMappingURL=row-ends.d.ts.map
|
package/rows.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Yields sequence of 2D grid coordinates in row-major order. Same as
|
|
4
4
|
* [`range2d()`](https://docs.thi.ng/umbrella/transducers/functions/range2d.html).
|
|
5
5
|
*
|
|
6
6
|
* @param opts -
|
|
7
7
|
*/
|
|
8
|
-
export declare const rows2d: (opts:
|
|
8
|
+
export declare const rows2d: (opts: GridIterOpts2D) => IterableIterator<import("./api.js").GridCoord2D>;
|
|
9
9
|
//# sourceMappingURL=rows.d.ts.map
|
package/spiral.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Yields sequence of 2D grid coordinates in outward spiral order starting from
|
|
4
4
|
* the center, given `cols` and `rows`.
|
|
@@ -8,5 +8,5 @@ import type { GridIterOpts } from "./api.js";
|
|
|
8
8
|
*
|
|
9
9
|
* @param opts -
|
|
10
10
|
*/
|
|
11
|
-
export declare function spiral2d(opts:
|
|
11
|
+
export declare function spiral2d(opts: GridIterOpts2D): Generator<import("./api.js").GridCoord2D, void, unknown>;
|
|
12
12
|
//# sourceMappingURL=spiral.d.ts.map
|
package/transforms.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PointTransform2D } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* No-op / identity {@link PointTransform}.
|
|
4
4
|
*/
|
|
5
|
-
export declare const ident:
|
|
6
|
-
export declare const flipX:
|
|
7
|
-
export declare const flipY:
|
|
8
|
-
export declare const flipXY:
|
|
5
|
+
export declare const ident: PointTransform2D;
|
|
6
|
+
export declare const flipX: PointTransform2D;
|
|
7
|
+
export declare const flipY: PointTransform2D;
|
|
8
|
+
export declare const flipXY: PointTransform2D;
|
|
9
9
|
/**
|
|
10
10
|
* {@link PointTransform} to swaps X & Y coords.
|
|
11
11
|
*/
|
|
12
|
-
export declare const swapXY:
|
|
12
|
+
export declare const swapXY: PointTransform2D;
|
|
13
13
|
/**
|
|
14
14
|
* Higher order {@link PointTransform} to compose given transforms in
|
|
15
15
|
* left-to-right order.
|
|
@@ -17,5 +17,5 @@ export declare const swapXY: PointTransform;
|
|
|
17
17
|
* @param a
|
|
18
18
|
* @param b
|
|
19
19
|
*/
|
|
20
|
-
export declare const compTransforms: (a:
|
|
20
|
+
export declare const compTransforms: (a: PointTransform2D, b: PointTransform2D) => PointTransform2D;
|
|
21
21
|
//# sourceMappingURL=transforms.d.ts.map
|
package/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const __opts: (opts:
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
|
+
export declare const __opts: (opts: GridIterOpts2D) => {
|
|
3
3
|
cols: number;
|
|
4
4
|
rows: number;
|
|
5
|
-
tx: import("@thi.ng/api").FnU2<number,
|
|
5
|
+
tx: import("@thi.ng/api").FnU2<number, import("./api.js").GridCoord2D>;
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=utils.d.ts.map
|
package/zcurve.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Yields 2D grid coordinates in Z-curve (Morton) order. A perfect
|
|
4
4
|
* Z-curve is only generated if `cols` AND `rows` are equal and a power
|
|
@@ -7,5 +7,5 @@ import type { GridIterOpts } from "./api.js";
|
|
|
7
7
|
*
|
|
8
8
|
* @param opts -
|
|
9
9
|
*/
|
|
10
|
-
export declare function zcurve2d(opts:
|
|
10
|
+
export declare function zcurve2d(opts: GridIterOpts2D): Generator<import("./api.js").GridCoord2D, void, unknown>;
|
|
11
11
|
//# sourceMappingURL=zcurve.d.ts.map
|
package/zigzag-columns.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Yields sequence of 2D grid coordinates in zigzag column order starting from
|
|
4
4
|
* [0,0], given `cols` and `rows`.
|
|
@@ -8,5 +8,5 @@ import type { GridIterOpts } from "./api.js";
|
|
|
8
8
|
*
|
|
9
9
|
* @param opts -
|
|
10
10
|
*/
|
|
11
|
-
export declare function zigzagColumns2d(opts:
|
|
11
|
+
export declare function zigzagColumns2d(opts: GridIterOpts2D): Generator<import("./api.js").GridCoord2D, void, unknown>;
|
|
12
12
|
//# sourceMappingURL=zigzag-columns.d.ts.map
|
package/zigzag-diagonal.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Similar to {@link diagonal2d}, but yields 2D grid coordinates in zigzag
|
|
4
4
|
* diagonal order starting at [0,0] and using given `cols` and `rows`.
|
|
5
5
|
*
|
|
6
6
|
* @param opts -
|
|
7
7
|
*/
|
|
8
|
-
export declare function zigzagDiagonal2d(opts:
|
|
8
|
+
export declare function zigzagDiagonal2d(opts: GridIterOpts2D): Generator<import("./api.js").GridCoord2D, void, unknown>;
|
|
9
9
|
//# sourceMappingURL=zigzag-diagonal.d.ts.map
|
package/zigzag-rows.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GridIterOpts2D } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Yields sequence of 2D grid coordinates in zigzag row order starting from
|
|
4
4
|
* [0,0], given `cols` and `rows`.
|
|
@@ -8,5 +8,5 @@ import type { GridIterOpts } from "./api.js";
|
|
|
8
8
|
*
|
|
9
9
|
* @param opts -
|
|
10
10
|
*/
|
|
11
|
-
export declare function zigzagRows2d(opts:
|
|
11
|
+
export declare function zigzagRows2d(opts: GridIterOpts2D): Generator<import("./api.js").GridCoord2D, void, unknown>;
|
|
12
12
|
//# sourceMappingURL=zigzag-rows.d.ts.map
|