@thi.ng/fuzzy-viz 2.1.122 → 2.1.123

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**: 2024-02-22T11:59:16Z
3
+ - **Last updated**: 2024-02-22T23:15:26Z
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.123](https://github.com/thi-ng/umbrella/tree/@thi.ng/fuzzy-viz@2.1.123) (2024-02-22)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - update object destructuring in all pkgs & examples ([f36aeb0](https://github.com/thi-ng/umbrella/commit/f36aeb0))
17
+
12
18
  ### [2.1.120](https://github.com/thi-ng/umbrella/tree/@thi.ng/fuzzy-viz@2.1.120) (2024-02-19)
13
19
 
14
20
  #### ♻️ Refactoring
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/fuzzy-viz",
3
- "version": "2.1.122",
3
+ "version": "2.1.123",
4
4
  "description": "Visualization, instrumentation & introspection utils for @thi.ng/fuzzy",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -38,10 +38,10 @@
38
38
  "@thi.ng/api": "^8.9.25",
39
39
  "@thi.ng/fuzzy": "^2.1.68",
40
40
  "@thi.ng/hiccup": "^5.1.14",
41
- "@thi.ng/hiccup-svg": "^5.2.14",
41
+ "@thi.ng/hiccup-svg": "^5.2.15",
42
42
  "@thi.ng/math": "^5.10.2",
43
43
  "@thi.ng/strings": "^3.7.16",
44
- "@thi.ng/text-canvas": "^3.0.2"
44
+ "@thi.ng/text-canvas": "^3.0.3"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@microsoft/api-extractor": "^7.40.1",
@@ -91,5 +91,5 @@
91
91
  "parent": "@thi.ng/fuzzy",
92
92
  "year": 2020
93
93
  },
94
- "gitHead": "4513a1c703bdbf0f0867f03e547e47692e415fac\n"
94
+ "gitHead": "16f2b92b5410bd35dcde6c2971c8e62783ebc472\n"
95
95
  }
package/strategy.js CHANGED
@@ -39,13 +39,8 @@ const fuzzySetToHiccup = (opts) => (fn, domain, res) => {
39
39
  return tree;
40
40
  };
41
41
  const fuzzySetToSvg = (opts) => (fn, domain, res) => serialize(convertTree(fuzzySetToHiccup(opts)(fn, domain, res)));
42
- const fuzzySetToAscii = (opts) => (fn, domain, res) => {
43
- const { width, height, empty } = {
44
- width: 100,
45
- height: 16,
46
- empty: ".",
47
- ...opts
48
- };
42
+ const fuzzySetToAscii = (opts = {}) => (fn, domain, res) => {
43
+ const { width = 100, height = 16, empty = "." } = opts;
49
44
  const [min, max] = domain;
50
45
  const delta = (max - min) / width;
51
46
  const vals = [];
package/var.js CHANGED
@@ -5,21 +5,13 @@ import { fit } from "@thi.ng/math/fit";
5
5
  import { inRange } from "@thi.ng/math/interval";
6
6
  const varToHiccup = ({ domain: [min, max], terms }, opts = {}) => {
7
7
  const {
8
- samples,
9
- width,
10
- height,
11
- labels,
12
- stroke: strokeFn,
13
- fill: fillFn
14
- } = {
15
- samples: 200,
16
- width: 600,
17
- height: 100,
18
- labels: true,
19
- stroke: (x) => `hsl(${x * 360 | 0},100%,40%)`,
20
- fill: (x) => `hsla(${x * 360 | 0},100%,50%,20%)`,
21
- ...opts
22
- };
8
+ samples = 200,
9
+ width = 600,
10
+ height = 100,
11
+ labels = true,
12
+ stroke: strokeFn = (x) => `hsl(${x * 360 | 0},100%,40%)`,
13
+ fill: fillFn = (x) => `hsla(${x * 360 | 0},100%,50%,20%)`
14
+ } = opts;
23
15
  const keys = Object.keys(terms);
24
16
  const dt = (max - min) / samples;
25
17
  const ds = width / samples;