@thi.ng/fuzzy-viz 2.1.7 → 2.1.10
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/README.md +1 -1
- package/package.json +17 -17
- package/strategy.d.ts +2 -2
- package/strategy.js +3 -3
- package/var.d.ts +3 -3
- package/var.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**:
|
|
3
|
+
- **Last updated**: 2022-04-07T14:17:30Z
|
|
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,12 @@ 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
|
+
### [2.1.9](https://github.com/thi-ng/umbrella/tree/@thi.ng/fuzzy-viz@2.1.9) (2022-04-07)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- replace deprecated .substr() w/ .substring() ([0710509](https://github.com/thi-ng/umbrella/commit/0710509))
|
|
17
|
+
|
|
12
18
|
## [2.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/fuzzy-viz@2.1.0) (2021-11-17)
|
|
13
19
|
|
|
14
20
|
#### 🚀 Features
|
package/README.md
CHANGED
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.10",
|
|
4
4
|
"description": "Visualization, instrumentation & introspection utils for @thi.ng/fuzzy",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.3.
|
|
38
|
-
"@thi.ng/fuzzy": "^2.1.
|
|
39
|
-
"@thi.ng/hiccup": "^4.2.
|
|
40
|
-
"@thi.ng/hiccup-svg": "^4.2.
|
|
41
|
-
"@thi.ng/math": "^5.
|
|
42
|
-
"@thi.ng/strings": "^3.3.
|
|
43
|
-
"@thi.ng/text-canvas": "^2.
|
|
37
|
+
"@thi.ng/api": "^8.3.5",
|
|
38
|
+
"@thi.ng/fuzzy": "^2.1.5",
|
|
39
|
+
"@thi.ng/hiccup": "^4.2.6",
|
|
40
|
+
"@thi.ng/hiccup-svg": "^4.2.10",
|
|
41
|
+
"@thi.ng/math": "^5.3.1",
|
|
42
|
+
"@thi.ng/strings": "^3.3.3",
|
|
43
|
+
"@thi.ng/text-canvas": "^2.3.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@microsoft/api-extractor": "^7.19.
|
|
47
|
-
"@thi.ng/testament": "^0.2.
|
|
46
|
+
"@microsoft/api-extractor": "^7.19.4",
|
|
47
|
+
"@thi.ng/testament": "^0.2.5",
|
|
48
48
|
"rimraf": "^3.0.2",
|
|
49
49
|
"tools": "^0.0.1",
|
|
50
|
-
"typedoc": "^0.22.
|
|
51
|
-
"typescript": "^4.
|
|
50
|
+
"typedoc": "^0.22.13",
|
|
51
|
+
"typescript": "^4.6.2"
|
|
52
52
|
},
|
|
53
53
|
"keywords": [
|
|
54
54
|
"area plot",
|
|
@@ -75,21 +75,21 @@
|
|
|
75
75
|
],
|
|
76
76
|
"exports": {
|
|
77
77
|
".": {
|
|
78
|
-
"
|
|
78
|
+
"default": "./index.js"
|
|
79
79
|
},
|
|
80
80
|
"./api": {
|
|
81
|
-
"
|
|
81
|
+
"default": "./api.js"
|
|
82
82
|
},
|
|
83
83
|
"./strategy": {
|
|
84
|
-
"
|
|
84
|
+
"default": "./strategy.js"
|
|
85
85
|
},
|
|
86
86
|
"./var": {
|
|
87
|
-
"
|
|
87
|
+
"default": "./var.js"
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
90
|
"thi.ng": {
|
|
91
91
|
"parent": "@thi.ng/fuzzy",
|
|
92
92
|
"year": 2020
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "542bf14bd0c7a56b4e6297718189eea772a824b7\n"
|
|
95
95
|
}
|
package/strategy.d.ts
CHANGED
|
@@ -46,8 +46,8 @@ import type { AsciiVizOpts, InstrumentFn, VizualizeVarOpts } from "./api.js";
|
|
|
46
46
|
* strategy.clear();
|
|
47
47
|
* ```
|
|
48
48
|
*
|
|
49
|
-
* @param strategy
|
|
50
|
-
* @param instrument
|
|
49
|
+
* @param strategy -
|
|
50
|
+
* @param instrument -
|
|
51
51
|
*/
|
|
52
52
|
export declare const instrumentStrategy: <T>(strategy: DefuzzStrategy, instrument: Fn3<import("@thi.ng/api").FnN, import("@thi.ng/api").Range, number, T>) => DefuzzStrategy & IClear & IDeref<T[]>;
|
|
53
53
|
export declare const fuzzySetToHiccup: (opts?: Partial<VizualizeVarOpts> | undefined) => InstrumentFn<any[]>;
|
package/strategy.js
CHANGED
|
@@ -50,8 +50,8 @@ import { varToHiccup } from "./var.js";
|
|
|
50
50
|
* strategy.clear();
|
|
51
51
|
* ```
|
|
52
52
|
*
|
|
53
|
-
* @param strategy
|
|
54
|
-
* @param instrument
|
|
53
|
+
* @param strategy -
|
|
54
|
+
* @param instrument -
|
|
55
55
|
*/
|
|
56
56
|
export const instrumentStrategy = (strategy, instrument) => {
|
|
57
57
|
const acc = [];
|
|
@@ -102,7 +102,7 @@ export const fuzzySetToAscii = (opts) => (fn, domain, res) => {
|
|
|
102
102
|
}
|
|
103
103
|
const index = Math.round(fit(res, min, max, 0, vals.length));
|
|
104
104
|
let chart = barChartHLines(height, vals, 0, 1)
|
|
105
|
-
.map((line) => line.
|
|
105
|
+
.map((line) => line.substring(0, index) + "|" + line.substring(index + 1))
|
|
106
106
|
.join("\n")
|
|
107
107
|
.replace(/ /g, empty);
|
|
108
108
|
const legend = repeat(" ", index) + "^ " + res.toFixed(2);
|
package/var.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ import type { VizualizeVarOpts } from "./api.js";
|
|
|
6
6
|
* polygons. Returns a {@link @thi.ng/hiccup-canvas#} compatible shape component
|
|
7
7
|
* tree.
|
|
8
8
|
*
|
|
9
|
-
* @param var
|
|
10
|
-
* @param opts
|
|
9
|
+
* @param var -
|
|
10
|
+
* @param opts -
|
|
11
11
|
*/
|
|
12
12
|
export declare const varToHiccup: ({ domain: [min, max], terms }: LVar<any>, opts?: Partial<VizualizeVarOpts>) => any[];
|
|
13
13
|
/**
|
|
@@ -15,7 +15,7 @@ export declare const varToHiccup: ({ domain: [min, max], terms }: LVar<any>, opt
|
|
|
15
15
|
* actual SVG string.
|
|
16
16
|
*
|
|
17
17
|
* @param $var
|
|
18
|
-
* @param opts
|
|
18
|
+
* @param opts -
|
|
19
19
|
*/
|
|
20
20
|
export declare const varToSvg: ($var: LVar<any>, opts: Partial<VizualizeVarOpts>) => string;
|
|
21
21
|
//# sourceMappingURL=var.d.ts.map
|
package/var.js
CHANGED
|
@@ -9,8 +9,8 @@ import { inRange } from "@thi.ng/math/interval";
|
|
|
9
9
|
* polygons. Returns a {@link @thi.ng/hiccup-canvas#} compatible shape component
|
|
10
10
|
* tree.
|
|
11
11
|
*
|
|
12
|
-
* @param var
|
|
13
|
-
* @param opts
|
|
12
|
+
* @param var -
|
|
13
|
+
* @param opts -
|
|
14
14
|
*/
|
|
15
15
|
export const varToHiccup = ({ domain: [min, max], terms }, opts = {}) => {
|
|
16
16
|
const { samples, width, height, labels, stroke: strokeFn, fill: fillFn, } = {
|
|
@@ -97,6 +97,6 @@ export const varToHiccup = ({ domain: [min, max], terms }, opts = {}) => {
|
|
|
97
97
|
* actual SVG string.
|
|
98
98
|
*
|
|
99
99
|
* @param $var
|
|
100
|
-
* @param opts
|
|
100
|
+
* @param opts -
|
|
101
101
|
*/
|
|
102
102
|
export const varToSvg = ($var, opts) => serialize(convertTree(varToHiccup($var, opts)));
|