@tsparticles/perlin-noise 4.0.0-beta.1 → 4.0.0-beta.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/README.md CHANGED
@@ -8,6 +8,12 @@
8
8
 
9
9
  [tsParticles](https://github.com/tsparticles/tsparticles) path plugin for perlin 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 { loadPerlinNoisePath } from "@tsparticles/perlin-noise";
72
78
  await loadPerlinNoisePath(tsParticles);
73
79
  })();
74
80
  ```
81
+
82
+ ## Common pitfalls
83
+
84
+ - Calling `tsParticles.load(...)` before `loadPerlinNoisePath(...)`
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/perlin-noise",
3
- "version": "4.0.0-beta.1",
3
+ "version": "4.0.0-beta.10",
4
4
  "description": "tsParticles perlin 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/perlin-noise [31 Mar 2026 at 08:44]</title>
6
+ <title>@tsparticles/perlin-noise [8 Apr 2026 at 15:54]</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/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvY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jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+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.10
8
8
  */
9
9
  /*
10
10
  * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
package/umd/Grad.js DELETED
@@ -1,35 +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"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Grad = void 0;
13
- class Grad {
14
- w;
15
- x;
16
- y;
17
- z;
18
- constructor(x, y, z, w) {
19
- this.x = x;
20
- this.y = y;
21
- this.z = z;
22
- this.w = w;
23
- }
24
- dot2(x, y) {
25
- return this.x * x + this.y * y;
26
- }
27
- dot3(x, y, z) {
28
- return this.dot2(x, y) + this.z * z;
29
- }
30
- dot4(x, y, z, w) {
31
- return this.dot3(x, y, z) + this.w * w;
32
- }
33
- }
34
- exports.Grad = Grad;
35
- });
@@ -1,376 +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", "./Grad.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.PerlinNoise = void 0;
13
- const Grad_js_1 = require("./Grad.js");
14
- class PerlinNoise {
15
- _grad4;
16
- _gradP;
17
- _p;
18
- _perm;
19
- constructor() {
20
- this._grad4 = [
21
- new Grad_js_1.Grad(0, 1, 1, 1),
22
- new Grad_js_1.Grad(0, 1, 1, -1),
23
- new Grad_js_1.Grad(0, 1, -1, 1),
24
- new Grad_js_1.Grad(0, 1, -1, -1),
25
- new Grad_js_1.Grad(0, -1, 1, 1),
26
- new Grad_js_1.Grad(0, -1, 1, -1),
27
- new Grad_js_1.Grad(0, -1, -1, 1),
28
- new Grad_js_1.Grad(0, -1, -1, -1),
29
- new Grad_js_1.Grad(1, 0, 1, 1),
30
- new Grad_js_1.Grad(1, 0, 1, -1),
31
- new Grad_js_1.Grad(1, 0, -1, 1),
32
- new Grad_js_1.Grad(1, 0, -1, -1),
33
- new Grad_js_1.Grad(-1, 0, 1, 1),
34
- new Grad_js_1.Grad(-1, 0, 1, -1),
35
- new Grad_js_1.Grad(-1, 0, -1, 1),
36
- new Grad_js_1.Grad(-1, 0, -1, -1),
37
- new Grad_js_1.Grad(1, 1, 0, 1),
38
- new Grad_js_1.Grad(1, 1, 0, -1),
39
- new Grad_js_1.Grad(1, -1, 0, 1),
40
- new Grad_js_1.Grad(1, -1, 0, -1),
41
- new Grad_js_1.Grad(-1, 1, 0, 1),
42
- new Grad_js_1.Grad(-1, 1, 0, -1),
43
- new Grad_js_1.Grad(-1, -1, 0, 1),
44
- new Grad_js_1.Grad(-1, -1, 0, -1),
45
- new Grad_js_1.Grad(1, 1, 1, 0),
46
- new Grad_js_1.Grad(1, 1, -1, 0),
47
- new Grad_js_1.Grad(1, -1, 1, 0),
48
- new Grad_js_1.Grad(1, -1, -1, 0),
49
- new Grad_js_1.Grad(-1, 1, 1, 0),
50
- new Grad_js_1.Grad(-1, 1, -1, 0),
51
- new Grad_js_1.Grad(-1, -1, 1, 0),
52
- new Grad_js_1.Grad(-1, -1, -1, 0),
53
- ];
54
- this._p = [
55
- 151,
56
- 160,
57
- 137,
58
- 91,
59
- 90,
60
- 15,
61
- 131,
62
- 13,
63
- 201,
64
- 95,
65
- 96,
66
- 53,
67
- 194,
68
- 233,
69
- 7,
70
- 225,
71
- 140,
72
- 36,
73
- 103,
74
- 30,
75
- 69,
76
- 142,
77
- 8,
78
- 99,
79
- 37,
80
- 240,
81
- 21,
82
- 10,
83
- 23,
84
- 190,
85
- 6,
86
- 148,
87
- 247,
88
- 120,
89
- 234,
90
- 75,
91
- 0,
92
- 26,
93
- 197,
94
- 62,
95
- 94,
96
- 252,
97
- 219,
98
- 203,
99
- 117,
100
- 35,
101
- 11,
102
- 32,
103
- 57,
104
- 177,
105
- 33,
106
- 88,
107
- 237,
108
- 149,
109
- 56,
110
- 87,
111
- 174,
112
- 20,
113
- 125,
114
- 136,
115
- 171,
116
- 168,
117
- 68,
118
- 175,
119
- 74,
120
- 165,
121
- 71,
122
- 134,
123
- 139,
124
- 48,
125
- 27,
126
- 166,
127
- 77,
128
- 146,
129
- 158,
130
- 231,
131
- 83,
132
- 111,
133
- 229,
134
- 122,
135
- 60,
136
- 211,
137
- 133,
138
- 230,
139
- 220,
140
- 105,
141
- 92,
142
- 41,
143
- 55,
144
- 46,
145
- 245,
146
- 40,
147
- 244,
148
- 102,
149
- 143,
150
- 54,
151
- 65,
152
- 25,
153
- 63,
154
- 161,
155
- 1,
156
- 216,
157
- 80,
158
- 73,
159
- 209,
160
- 76,
161
- 132,
162
- 187,
163
- 208,
164
- 89,
165
- 18,
166
- 169,
167
- 200,
168
- 196,
169
- 135,
170
- 130,
171
- 116,
172
- 188,
173
- 159,
174
- 86,
175
- 164,
176
- 100,
177
- 109,
178
- 198,
179
- 173,
180
- 186,
181
- 3,
182
- 64,
183
- 52,
184
- 217,
185
- 226,
186
- 250,
187
- 124,
188
- 123,
189
- 5,
190
- 202,
191
- 38,
192
- 147,
193
- 118,
194
- 126,
195
- 255,
196
- 82,
197
- 85,
198
- 212,
199
- 207,
200
- 206,
201
- 59,
202
- 227,
203
- 47,
204
- 16,
205
- 58,
206
- 17,
207
- 182,
208
- 189,
209
- 28,
210
- 42,
211
- 223,
212
- 183,
213
- 170,
214
- 213,
215
- 119,
216
- 248,
217
- 152,
218
- 2,
219
- 44,
220
- 154,
221
- 163,
222
- 70,
223
- 221,
224
- 153,
225
- 101,
226
- 155,
227
- 167,
228
- 43,
229
- 172,
230
- 9,
231
- 129,
232
- 22,
233
- 39,
234
- 253,
235
- 19,
236
- 98,
237
- 108,
238
- 110,
239
- 79,
240
- 113,
241
- 224,
242
- 232,
243
- 178,
244
- 185,
245
- 112,
246
- 104,
247
- 218,
248
- 246,
249
- 97,
250
- 228,
251
- 251,
252
- 34,
253
- 242,
254
- 193,
255
- 238,
256
- 210,
257
- 144,
258
- 12,
259
- 191,
260
- 179,
261
- 162,
262
- 241,
263
- 81,
264
- 51,
265
- 145,
266
- 235,
267
- 249,
268
- 14,
269
- 239,
270
- 107,
271
- 49,
272
- 192,
273
- 214,
274
- 31,
275
- 181,
276
- 199,
277
- 106,
278
- 157,
279
- 184,
280
- 84,
281
- 204,
282
- 176,
283
- 115,
284
- 121,
285
- 50,
286
- 45,
287
- 127,
288
- 4,
289
- 150,
290
- 254,
291
- 138,
292
- 236,
293
- 205,
294
- 93,
295
- 222,
296
- 114,
297
- 67,
298
- 29,
299
- 24,
300
- 72,
301
- 243,
302
- 141,
303
- 128,
304
- 195,
305
- 78,
306
- 66,
307
- 215,
308
- 61,
309
- 156,
310
- 180,
311
- ];
312
- this._gradP = new Array(512);
313
- this._perm = new Array(512);
314
- }
315
- noise2d(x, y) {
316
- const { _gradP, _perm } = this;
317
- let X = Math.floor(x), Y = Math.floor(y);
318
- x -= X;
319
- y -= Y;
320
- X &= 255;
321
- Y &= 255;
322
- const n00 = _gradP[X + _perm[Y]].dot2(x, y), n01 = _gradP[X + _perm[Y + 1]].dot2(x, y - 1), n10 = _gradP[X + 1 + _perm[Y]].dot2(x - 1, y), n11 = _gradP[X + 1 + _perm[Y + 1]].dot2(x - 1, y - 1), u = this._fade(x);
323
- return this._lerp(this._lerp(n00, n10, u), this._lerp(n01, n11, u), this._fade(y));
324
- }
325
- noise3d(x, y, z) {
326
- const { _gradP: gradP, _perm: perm } = this;
327
- let X = Math.floor(x), Y = Math.floor(y), Z = Math.floor(z);
328
- x = x - X;
329
- y = y - Y;
330
- z = z - Z;
331
- X = X & 255;
332
- Y = Y & 255;
333
- Z = Z & 255;
334
- const n000 = gradP[X + perm[Y + perm[Z]]].dot3(x, y, z), n001 = gradP[X + perm[Y + perm[Z + 1]]].dot3(x, y, z - 1), n010 = gradP[X + perm[Y + 1 + perm[Z]]].dot3(x, y - 1, z), n011 = gradP[X + perm[Y + 1 + perm[Z + 1]]].dot3(x, y - 1, z - 1), n100 = gradP[X + 1 + perm[Y + perm[Z]]].dot3(x - 1, y, z), n101 = gradP[X + 1 + perm[Y + perm[Z + 1]]].dot3(x - 1, y, z - 1), n110 = gradP[X + 1 + perm[Y + 1 + perm[Z]]].dot3(x - 1, y - 1, z), n111 = gradP[X + 1 + perm[Y + 1 + perm[Z + 1]]].dot3(x - 1, y - 1, z - 1), u = this._fade(x), v = this._fade(y), w = this._fade(z);
335
- return this._lerp(this._lerp(this._lerp(n000, n100, u), this._lerp(n001, n101, u), w), this._lerp(this._lerp(n010, n110, u), this._lerp(n011, n111, u), w), v);
336
- }
337
- noise4d(x, y, z, w) {
338
- const { _gradP: gradP, _perm: perm } = this;
339
- let X = Math.floor(x), Y = Math.floor(y), Z = Math.floor(z), W = Math.floor(w);
340
- x -= X;
341
- y -= Y;
342
- z -= Z;
343
- w -= W;
344
- X &= 255;
345
- Y &= 255;
346
- Z &= 255;
347
- W &= 255;
348
- const u = this._fade(x), v = this._fade(y), s = this._fade(z), t = this._fade(w), gi = (i, j, k, l) => gradP[X + i + perm[Y + j + perm[Z + k + perm[W + l]]]], n0000 = gi(0, 0, 0, 0).dot4(x, y, z, w), n0001 = gi(0, 0, 0, 1).dot4(x, y, z, w - 1), n0010 = gi(0, 0, 1, 0).dot4(x, y, z - 1, w), n0011 = gi(0, 0, 1, 1).dot4(x, y, z - 1, w - 1), n0100 = gi(0, 1, 0, 0).dot4(x, y - 1, z, w), n0101 = gi(0, 1, 0, 1).dot4(x, y - 1, z, w - 1), n0110 = gi(0, 1, 1, 0).dot4(x, y - 1, z - 1, w), n0111 = gi(0, 1, 1, 1).dot4(x, y - 1, z - 1, w - 1), n1000 = gi(1, 0, 0, 0).dot4(x - 1, y, z, w), n1001 = gi(1, 0, 0, 1).dot4(x - 1, y, z, w - 1), n1010 = gi(1, 0, 1, 0).dot4(x - 1, y, z - 1, w), n1011 = gi(1, 0, 1, 1).dot4(x - 1, y, z - 1, w - 1), n1100 = gi(1, 1, 0, 0).dot4(x - 1, y - 1, z, w), n1101 = gi(1, 1, 0, 1).dot4(x - 1, y - 1, z, w - 1), n1110 = gi(1, 1, 1, 0).dot4(x - 1, y - 1, z - 1, w), n1111 = gi(1, 1, 1, 1).dot4(x - 1, y - 1, z - 1, w - 1), x00 = this._lerp(n0000, n1000, u), x01 = this._lerp(n0001, n1001, u), x10 = this._lerp(n0010, n1010, u), x11 = this._lerp(n0011, n1011, u), y00 = this._lerp(x00, x10, s), y01 = this._lerp(x01, x11, s), x20 = this._lerp(n0100, n1100, u), x21 = this._lerp(n0101, n1101, u), x30 = this._lerp(n0110, n1110, u), x31 = this._lerp(n0111, n1111, u), y10 = this._lerp(x20, x30, s), y11 = this._lerp(x21, x31, s), z0 = this._lerp(y00, y10, v), z1 = this._lerp(y01, y11, v);
349
- return this._lerp(z0, z1, t);
350
- }
351
- seed(inputSeed) {
352
- const { _grad4: grad4, _gradP: gradP, _perm: perm, _p: p } = this;
353
- let seed = inputSeed;
354
- if (seed > 0 && seed < 1) {
355
- seed *= 65536;
356
- }
357
- seed = Math.floor(seed);
358
- if (seed < 256) {
359
- seed |= seed << 8;
360
- }
361
- const grad4Length = grad4.length;
362
- for (let i = 0; i < 256; i++) {
363
- const v = i & 1 ? p[i] ^ (seed & 255) : p[i] ^ ((seed >> 8) & 255);
364
- perm[i] = perm[i + 256] = v;
365
- gradP[i] = gradP[i + 256] = grad4[v % grad4Length];
366
- }
367
- }
368
- _fade(t) {
369
- return t * t * t * (t * (t * 6 - 15) + 10);
370
- }
371
- _lerp(a, b, t) {
372
- return (1 - t) * a + t * b;
373
- }
374
- }
375
- exports.PerlinNoise = PerlinNoise;
376
- });
package/umd/index.js DELETED
@@ -1,15 +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", "./PerlinNoise.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.PerlinNoise = void 0;
13
- var PerlinNoise_js_1 = require("./PerlinNoise.js");
14
- Object.defineProperty(exports, "PerlinNoise", { enumerable: true, get: function () { return PerlinNoise_js_1.PerlinNoise; } });
15
- });