@tsparticles/simplex-noise 4.0.0-beta.1 → 4.0.0-beta.11

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/README.md CHANGED
@@ -8,6 +8,12 @@
8
8
 
9
9
  [tsParticles](https://github.com/tsparticles/tsparticles) library for simplex noise movement.
10
10
 
11
+ ## Quick checklist
12
+
13
+ 1. Install `@tsparticles/engine` (or use the CDN bundle below)
14
+ 2. Call the package loader function(s) before `tsParticles.load(...)`
15
+ 3. Apply the package options in your `tsParticles.load(...)` config
16
+
11
17
  ## How to use it
12
18
 
13
19
  ### CDN / Vanilla JS / jQuery
@@ -72,3 +78,14 @@ import { loadSimplexNoisePath } from "@tsparticles/path-simplex-noise";
72
78
  await loadSimplexNoisePath(tsParticles);
73
79
  })();
74
80
  ```
81
+
82
+ ## Common pitfalls
83
+
84
+ - Calling `tsParticles.load(...)` before `loadSimplexNoisePath(...)`
85
+ - Verify required peer packages before enabling advanced options
86
+ - Change one option group at a time to isolate regressions quickly
87
+
88
+ ## Related docs
89
+
90
+ - All packages catalog: <https://github.com/tsparticles/tsparticles>
91
+ - Main docs: <https://particles.js.org/docs/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/simplex-noise",
3
- "version": "4.0.0-beta.1",
3
+ "version": "4.0.0-beta.11",
4
4
  "description": "tsParticles simplex noise library",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -97,8 +97,7 @@
97
97
  "browser": "./browser/index.js",
98
98
  "import": "./esm/index.js",
99
99
  "require": "./cjs/index.js",
100
- "umd": "./umd/index.js",
101
- "default": "./cjs/index.js"
100
+ "default": "./esm/index.js"
102
101
  },
103
102
  "./package.json": "./package.json"
104
103
  },
package/report.html CHANGED
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>@tsparticles/simplex-noise [31 Mar 2026 at 08:44]</title>
6
+ <title>@tsparticles/simplex-noise [8 Apr 2026 at 17:10]</title>
7
7
  <link
8
8
  rel="shortcut icon"
9
9
  href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu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bA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII="
@@ -4,7 +4,7 @@
4
4
  * Demo / Generator : https://particles.js.org/
5
5
  * GitHub : https://www.github.com/matteobruni/tsparticles
6
6
  * How to use? : Check the GitHub README
7
- * v4.0.0-beta.1
7
+ * v4.0.0-beta.11
8
8
  */
9
9
  /*
10
10
  * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
@@ -1,176 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../utils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SimplexNoise2D = void 0;
13
- const utils_js_1 = require("../utils.js");
14
- const half = 0.5;
15
- class SimplexNoise2D {
16
- _NORM_2D;
17
- _SQUISH_2D;
18
- _STRETCH_2D;
19
- _base2D;
20
- _gradients2D;
21
- _lookup;
22
- _lookupPairs2D;
23
- _p2D;
24
- _perm;
25
- _perm2D;
26
- constructor() {
27
- this._NORM_2D = 1 / 47;
28
- this._SQUISH_2D = (Math.sqrt(2 + 1) - 1) * half;
29
- this._STRETCH_2D = (1 / Math.sqrt(2 + 1) - 1) * half;
30
- this._base2D = [
31
- [1, 1, 0, 1, 0, 1, 0, 0, 0],
32
- [1, 1, 0, 1, 0, 1, 2, 1, 1],
33
- ];
34
- this._gradients2D = [
35
- 5,
36
- 2,
37
- 2,
38
- 5,
39
- -5,
40
- 2,
41
- -2,
42
- 5,
43
- 5,
44
- -2,
45
- 2,
46
- -5,
47
- -5,
48
- -2,
49
- -2,
50
- -5,
51
- ];
52
- this._lookup = [];
53
- this._lookupPairs2D = [
54
- 0,
55
- 1,
56
- 1,
57
- 0,
58
- 4,
59
- 1,
60
- 17,
61
- 0,
62
- 20,
63
- 2,
64
- 21,
65
- 2,
66
- 22,
67
- 5,
68
- 23,
69
- 5,
70
- 26,
71
- 4,
72
- 39,
73
- 3,
74
- 42,
75
- 4,
76
- 43,
77
- 3,
78
- ];
79
- this._p2D = [
80
- 0,
81
- 0,
82
- 1,
83
- -1,
84
- 0,
85
- 0,
86
- -1,
87
- 1,
88
- 0,
89
- 2,
90
- 1,
91
- 1,
92
- 1,
93
- 2,
94
- 2,
95
- 0,
96
- 1,
97
- 2,
98
- 0,
99
- 2,
100
- 1,
101
- 0,
102
- 0,
103
- 0,
104
- ];
105
- this._perm = new Uint8Array(256);
106
- this._perm2D = new Uint8Array(256);
107
- }
108
- noise(x, y) {
109
- const { _gradients2D, _NORM_2D, _SQUISH_2D, _STRETCH_2D, _lookup, _perm, _perm2D } = this, stretchOffset = (x + y) * _STRETCH_2D, xs = x + stretchOffset, ys = y + stretchOffset, xsb = Math.floor(xs), ysb = Math.floor(ys), squishOffset = (xsb + ysb) * _SQUISH_2D, dx0 = x - (xsb + squishOffset), dy0 = y - (ysb + squishOffset), xins = xs - xsb, yins = ys - ysb, inSum = xins + yins, hash = (xins - yins + 1) | (inSum << 1) | ((inSum + yins) << 2) | ((inSum + xins) << 4);
110
- let value = 0;
111
- for (let c = _lookup[hash]; c !== undefined; c = c.next) {
112
- const dx = dx0 + c.dx, dy = dy0 + c.dy, attn = 2 - dx * dx - dy * dy;
113
- if (attn <= 0) {
114
- continue;
115
- }
116
- const px = xsb + c.xsb, py = ysb + c.ysb, indexPartA = _perm[px & 0xff], index = _perm2D[(indexPartA + py) & 0xff], valuePart = _gradients2D[index] * dx + _gradients2D[index + 1] * dy;
117
- value += attn * attn * attn * attn * valuePart;
118
- }
119
- return value * _NORM_2D;
120
- }
121
- seed(clientSeed) {
122
- const { _p2D, _base2D, _lookupPairs2D } = this, contributions = [];
123
- for (let i = 0; i < _p2D.length; i += 4) {
124
- const baseSet = _base2D[_p2D[i]];
125
- let previous = null, current = null;
126
- for (let k = 0; k < baseSet.length; k += 3) {
127
- current = this._contribution2D(baseSet[k], baseSet[k + 1], baseSet[k + 2]);
128
- if (previous === null) {
129
- contributions[i / 4] = current;
130
- }
131
- else {
132
- previous.next = current;
133
- }
134
- previous = current;
135
- }
136
- if (current) {
137
- current.next = this._contribution2D(_p2D[i + 1], _p2D[i + 2], _p2D[i + 3]);
138
- }
139
- }
140
- this._lookup = [];
141
- for (let i = 0; i < _lookupPairs2D.length; i += 2) {
142
- this._lookup[_lookupPairs2D[i]] = contributions[_lookupPairs2D[i + 1]];
143
- }
144
- this._perm = new Uint8Array(256);
145
- this._perm2D = new Uint8Array(256);
146
- const source = new Uint8Array(256);
147
- for (let i = 0; i < 256; i++) {
148
- source[i] = i;
149
- }
150
- let seed = new Uint32Array(1);
151
- seed[0] = clientSeed;
152
- seed = (0, utils_js_1.shuffleSeed)((0, utils_js_1.shuffleSeed)((0, utils_js_1.shuffleSeed)(seed)));
153
- for (let i = 255; i >= 0; i--) {
154
- seed = (0, utils_js_1.shuffleSeed)(seed);
155
- const r = new Uint32Array(1);
156
- r[0] = (seed[0] + 31) % (i + 1);
157
- if (r[0] < 0) {
158
- r[0] += i + 1;
159
- }
160
- this._perm[i] = source[r[0]];
161
- this._perm2D[i] = this._perm[i] & 0x0e;
162
- source[r[0]] = source[i];
163
- }
164
- }
165
- _contribution2D(multiplier, xsb, ysb) {
166
- const { _SQUISH_2D } = this;
167
- return {
168
- dx: -xsb - multiplier * _SQUISH_2D,
169
- dy: -ysb - multiplier * _SQUISH_2D,
170
- xsb,
171
- ysb,
172
- };
173
- }
174
- }
175
- exports.SimplexNoise2D = SimplexNoise2D;
176
- });