@thi.ng/fuzzy-viz 2.1.40 → 2.1.42
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 +1 -1
- package/README.md +7 -10
- package/api.d.ts +1 -1
- package/package.json +15 -15
- package/strategy.d.ts +7 -5
- package/strategy.js +7 -5
- package/var.d.ts +5 -4
- package/var.js +5 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
2
|
|
|
3
|
-
# 
|
|
3
|
+
# 
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thi.ng/fuzzy-viz)
|
|
6
6
|

|
|
7
|
-
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
This project is part of the
|
|
10
10
|
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
|
|
@@ -21,7 +21,7 @@ This project is part of the
|
|
|
21
21
|
|
|
22
22
|
## About
|
|
23
23
|
|
|
24
|
-
Visualization, instrumentation & introspection utils for
|
|
24
|
+
Visualization, instrumentation & introspection utils for @thi.ng/fuzzy
|
|
25
25
|
|
|
26
26
|
## Status
|
|
27
27
|
|
|
@@ -45,11 +45,8 @@ ES module import:
|
|
|
45
45
|
|
|
46
46
|
For Node.js REPL:
|
|
47
47
|
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
node --experimental-repl-await
|
|
51
|
-
|
|
52
|
-
> const fuzzyViz = await import("@thi.ng/fuzzy-viz");
|
|
48
|
+
```js
|
|
49
|
+
const fuzzyViz = await import("@thi.ng/fuzzy-viz");
|
|
53
50
|
```
|
|
54
51
|
|
|
55
52
|
Package sizes (brotli'd, pre-treeshake): ESM: 1.00 KB
|
|
@@ -149,7 +146,7 @@ created following the same pattern as above:
|
|
|
149
146
|
|
|
150
147
|
## Authors
|
|
151
148
|
|
|
152
|
-
Karsten Schmidt
|
|
149
|
+
- [Karsten Schmidt](https://thi.ng)
|
|
153
150
|
|
|
154
151
|
If this project contributes to an academic publication, please cite it as:
|
|
155
152
|
|
|
@@ -164,4 +161,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
164
161
|
|
|
165
162
|
## License
|
|
166
163
|
|
|
167
|
-
© 2020 - 2022 Karsten Schmidt // Apache
|
|
164
|
+
© 2020 - 2022 Karsten Schmidt // Apache License 2.0
|
package/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Fn, Fn3 } from "@thi.ng/api";
|
|
2
2
|
import type { FuzzyFn, LVarDomain } from "@thi.ng/fuzzy";
|
|
3
|
-
export
|
|
3
|
+
export type InstrumentFn<T> = Fn3<FuzzyFn, LVarDomain, number, T>;
|
|
4
4
|
export interface AsciiVizOpts {
|
|
5
5
|
/**
|
|
6
6
|
* Width in characters
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/fuzzy-viz",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.42",
|
|
4
4
|
"description": "Visualization, instrumentation & introspection utils for @thi.ng/fuzzy",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/thi-ng/umbrella.git"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://github.com/thi-ng/umbrella/tree/
|
|
13
|
+
"homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy-viz#readme",
|
|
14
14
|
"funding": [
|
|
15
15
|
{
|
|
16
16
|
"type": "github",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"url": "https://patreon.com/thing_umbrella"
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
|
-
"author": "Karsten Schmidt
|
|
24
|
+
"author": "Karsten Schmidt (https://thi.ng)",
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "yarn clean && tsc --declaration",
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.
|
|
38
|
-
"@thi.ng/fuzzy": "^2.1.
|
|
39
|
-
"@thi.ng/hiccup": "^4.2.
|
|
40
|
-
"@thi.ng/hiccup-svg": "^4.3.
|
|
41
|
-
"@thi.ng/math": "^5.3.
|
|
42
|
-
"@thi.ng/strings": "^3.3.
|
|
43
|
-
"@thi.ng/text-canvas": "^2.4.
|
|
37
|
+
"@thi.ng/api": "^8.6.1",
|
|
38
|
+
"@thi.ng/fuzzy": "^2.1.21",
|
|
39
|
+
"@thi.ng/hiccup": "^4.2.27",
|
|
40
|
+
"@thi.ng/hiccup-svg": "^4.3.25",
|
|
41
|
+
"@thi.ng/math": "^5.3.17",
|
|
42
|
+
"@thi.ng/strings": "^3.3.21",
|
|
43
|
+
"@thi.ng/text-canvas": "^2.4.22"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@microsoft/api-extractor": "^7.33.
|
|
47
|
-
"@thi.ng/testament": "^0.3.
|
|
46
|
+
"@microsoft/api-extractor": "^7.33.7",
|
|
47
|
+
"@thi.ng/testament": "^0.3.7",
|
|
48
48
|
"rimraf": "^3.0.2",
|
|
49
49
|
"tools": "^0.0.1",
|
|
50
|
-
"typedoc": "^0.23.
|
|
51
|
-
"typescript": "^4.
|
|
50
|
+
"typedoc": "^0.23.22",
|
|
51
|
+
"typescript": "^4.9.4"
|
|
52
52
|
},
|
|
53
53
|
"keywords": [
|
|
54
54
|
"area plot",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"parent": "@thi.ng/fuzzy",
|
|
92
92
|
"year": 2020
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
|
|
95
95
|
}
|
package/strategy.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import type { Fn3, IClear, IDeref } from "@thi.ng/api";
|
|
|
2
2
|
import type { DefuzzStrategy, FuzzyFn, LVarDomain } from "@thi.ng/fuzzy";
|
|
3
3
|
import type { AsciiVizOpts, InstrumentFn, VizualizeVarOpts } from "./api.js";
|
|
4
4
|
/**
|
|
5
|
-
* Higher order function. Takes an existing
|
|
5
|
+
* Higher order function. Takes an existing
|
|
6
|
+
* [`DefuzzStrategy`](https://docs.thi.ng/umbrella/fuzzy/types/DefuzzStrategy.html)
|
|
6
7
|
* and an instrumentation function. Returns new `DefuzzStrategy` which first
|
|
7
8
|
* executes original `strategy`, then calls `instrument` with the same args AND
|
|
8
9
|
* the computed result obtained from `strategy`. Returns result of original
|
|
@@ -11,10 +12,11 @@ import type { AsciiVizOpts, InstrumentFn, VizualizeVarOpts } from "./api.js";
|
|
|
11
12
|
* @remarks
|
|
12
13
|
* The instrumentation function is intended to perform side effects (e.g. debug
|
|
13
14
|
* outputs) and/or produce secondary results (e.g. visualizations). The latter
|
|
14
|
-
* can be obtained through the
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* can be obtained through the
|
|
16
|
+
* [`IDeref`](https://docs.thi.ng/umbrella/api/interfaces/IDeref.html) mechanism
|
|
17
|
+
* implemented by the returned function. Since {@link defuzz} might call the
|
|
18
|
+
* strategy multiple times (i.e. if there are multiple output vars used),
|
|
19
|
+
* `.deref()` will always return an array of secondary results.
|
|
18
20
|
*
|
|
19
21
|
* Note: The secondary results from the instrumentation function will persist &
|
|
20
22
|
* accumulate. If re-using the instrumented strategy for multiple `defuzz()`
|
package/strategy.js
CHANGED
|
@@ -6,7 +6,8 @@ import { repeat } from "@thi.ng/strings/repeat";
|
|
|
6
6
|
import { barChartHLines } from "@thi.ng/text-canvas/bars";
|
|
7
7
|
import { varToHiccup } from "./var.js";
|
|
8
8
|
/**
|
|
9
|
-
* Higher order function. Takes an existing
|
|
9
|
+
* Higher order function. Takes an existing
|
|
10
|
+
* [`DefuzzStrategy`](https://docs.thi.ng/umbrella/fuzzy/types/DefuzzStrategy.html)
|
|
10
11
|
* and an instrumentation function. Returns new `DefuzzStrategy` which first
|
|
11
12
|
* executes original `strategy`, then calls `instrument` with the same args AND
|
|
12
13
|
* the computed result obtained from `strategy`. Returns result of original
|
|
@@ -15,10 +16,11 @@ import { varToHiccup } from "./var.js";
|
|
|
15
16
|
* @remarks
|
|
16
17
|
* The instrumentation function is intended to perform side effects (e.g. debug
|
|
17
18
|
* outputs) and/or produce secondary results (e.g. visualizations). The latter
|
|
18
|
-
* can be obtained through the
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* can be obtained through the
|
|
20
|
+
* [`IDeref`](https://docs.thi.ng/umbrella/api/interfaces/IDeref.html) mechanism
|
|
21
|
+
* implemented by the returned function. Since {@link defuzz} might call the
|
|
22
|
+
* strategy multiple times (i.e. if there are multiple output vars used),
|
|
23
|
+
* `.deref()` will always return an array of secondary results.
|
|
22
24
|
*
|
|
23
25
|
* Note: The secondary results from the instrumentation function will persist &
|
|
24
26
|
* accumulate. If re-using the instrumented strategy for multiple `defuzz()`
|
package/var.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { LVar } from "@thi.ng/fuzzy";
|
|
2
2
|
import type { VizualizeVarOpts } from "./api.js";
|
|
3
3
|
/**
|
|
4
|
-
* Takes an
|
|
5
|
-
* of the var's fuzzy sets in the var's
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Takes an [`LVar`](https://docs.thi.ng/umbrella/fuzzy/interfaces/LVar.html)
|
|
5
|
+
* and visualization options. Evaluates all of the var's fuzzy sets in the var's
|
|
6
|
+
* value domain and visualizes them as polygons. Returns a
|
|
7
|
+
* [thi.ng/hiccup-canvas](https://thi.ng/thi.ng/hiccup-canvas) compatible shape
|
|
8
|
+
* component tree.
|
|
8
9
|
*
|
|
9
10
|
* @param var -
|
|
10
11
|
* @param opts -
|
package/var.js
CHANGED
|
@@ -4,10 +4,11 @@ import { serialize } from "@thi.ng/hiccup/serialize";
|
|
|
4
4
|
import { fit } from "@thi.ng/math/fit";
|
|
5
5
|
import { inRange } from "@thi.ng/math/interval";
|
|
6
6
|
/**
|
|
7
|
-
* Takes an
|
|
8
|
-
* of the var's fuzzy sets in the var's
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Takes an [`LVar`](https://docs.thi.ng/umbrella/fuzzy/interfaces/LVar.html)
|
|
8
|
+
* and visualization options. Evaluates all of the var's fuzzy sets in the var's
|
|
9
|
+
* value domain and visualizes them as polygons. Returns a
|
|
10
|
+
* [thi.ng/hiccup-canvas](https://thi.ng/thi.ng/hiccup-canvas) compatible shape
|
|
11
|
+
* component tree.
|
|
11
12
|
*
|
|
12
13
|
* @param var -
|
|
13
14
|
* @param opts -
|