@tsparticles/fractal-noise 4.0.0-beta.0 → 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 fractal 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 { loadFractalNoisePath } from "@tsparticles/fractal-noise";
72
78
  await loadFractalNoisePath(tsParticles);
73
79
  })();
74
80
  ```
81
+
82
+ ## Common pitfalls
83
+
84
+ - Calling `tsParticles.load(...)` before `loadFractalNoisePath(...)`
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/>
@@ -4,7 +4,7 @@ export class FractalNoise {
4
4
  constructor() {
5
5
  this._smoothValueNoise = new SmoothValueNoise();
6
6
  }
7
- noise2d(x, y, octaves = 5, persistence = 0.5, lacunarity = 2.0) {
7
+ noise2d(x, y, octaves = 5, persistence = 0.5, lacunarity = 2) {
8
8
  let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
9
9
  for (let i = 0; i < octaves; i++) {
10
10
  total += this._smoothValueNoise.noise2d(x * frequency, y * frequency) * amplitude;
@@ -14,7 +14,7 @@ export class FractalNoise {
14
14
  }
15
15
  return total / maxValue;
16
16
  }
17
- noise3d(x, y, z, octaves = 5, persistence = 0.5, lacunarity = 2.0) {
17
+ noise3d(x, y, z, octaves = 5, persistence = 0.5, lacunarity = 2) {
18
18
  let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
19
19
  for (let i = 0; i < octaves; i++) {
20
20
  total += this._smoothValueNoise.noise3d(x * frequency, y * frequency, z * frequency) * amplitude;
@@ -24,7 +24,7 @@ export class FractalNoise {
24
24
  }
25
25
  return total / maxValue;
26
26
  }
27
- noise4d(x, y, z, w, octaves = 5, persistence = 0.5, lacunarity = 2.0) {
27
+ noise4d(x, y, z, w, octaves = 5, persistence = 0.5, lacunarity = 2) {
28
28
  let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
29
29
  for (let i = 0; i < octaves; i++) {
30
30
  total += this._smoothValueNoise.noise4d(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;
@@ -4,7 +4,7 @@ export class FractalNoise {
4
4
  constructor() {
5
5
  this._smoothValueNoise = new SmoothValueNoise();
6
6
  }
7
- noise2d(x, y, octaves = 5, persistence = 0.5, lacunarity = 2.0) {
7
+ noise2d(x, y, octaves = 5, persistence = 0.5, lacunarity = 2) {
8
8
  let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
9
9
  for (let i = 0; i < octaves; i++) {
10
10
  total += this._smoothValueNoise.noise2d(x * frequency, y * frequency) * amplitude;
@@ -14,7 +14,7 @@ export class FractalNoise {
14
14
  }
15
15
  return total / maxValue;
16
16
  }
17
- noise3d(x, y, z, octaves = 5, persistence = 0.5, lacunarity = 2.0) {
17
+ noise3d(x, y, z, octaves = 5, persistence = 0.5, lacunarity = 2) {
18
18
  let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
19
19
  for (let i = 0; i < octaves; i++) {
20
20
  total += this._smoothValueNoise.noise3d(x * frequency, y * frequency, z * frequency) * amplitude;
@@ -24,7 +24,7 @@ export class FractalNoise {
24
24
  }
25
25
  return total / maxValue;
26
26
  }
27
- noise4d(x, y, z, w, octaves = 5, persistence = 0.5, lacunarity = 2.0) {
27
+ noise4d(x, y, z, w, octaves = 5, persistence = 0.5, lacunarity = 2) {
28
28
  let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
29
29
  for (let i = 0; i < octaves; i++) {
30
30
  total += this._smoothValueNoise.noise4d(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;
@@ -4,7 +4,7 @@ export class FractalNoise {
4
4
  constructor() {
5
5
  this._smoothValueNoise = new SmoothValueNoise();
6
6
  }
7
- noise2d(x, y, octaves = 5, persistence = 0.5, lacunarity = 2.0) {
7
+ noise2d(x, y, octaves = 5, persistence = 0.5, lacunarity = 2) {
8
8
  let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
9
9
  for (let i = 0; i < octaves; i++) {
10
10
  total += this._smoothValueNoise.noise2d(x * frequency, y * frequency) * amplitude;
@@ -14,7 +14,7 @@ export class FractalNoise {
14
14
  }
15
15
  return total / maxValue;
16
16
  }
17
- noise3d(x, y, z, octaves = 5, persistence = 0.5, lacunarity = 2.0) {
17
+ noise3d(x, y, z, octaves = 5, persistence = 0.5, lacunarity = 2) {
18
18
  let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
19
19
  for (let i = 0; i < octaves; i++) {
20
20
  total += this._smoothValueNoise.noise3d(x * frequency, y * frequency, z * frequency) * amplitude;
@@ -24,7 +24,7 @@ export class FractalNoise {
24
24
  }
25
25
  return total / maxValue;
26
26
  }
27
- noise4d(x, y, z, w, octaves = 5, persistence = 0.5, lacunarity = 2.0) {
27
+ noise4d(x, y, z, w, octaves = 5, persistence = 0.5, lacunarity = 2) {
28
28
  let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
29
29
  for (let i = 0; i < octaves; i++) {
30
30
  total += this._smoothValueNoise.noise4d(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/fractal-noise",
3
- "version": "4.0.0-beta.0",
3
+ "version": "4.0.0-beta.10",
4
4
  "description": "tsParticles fractal noise library",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -91,8 +91,8 @@
91
91
  "main": "cjs/index.js",
92
92
  "module": "esm/index.js",
93
93
  "types": "types/index.d.ts",
94
- "dependencies": {
95
- "@tsparticles/smooth-value-noise": "4.0.0-beta.0"
94
+ "peerDependencies": {
95
+ "@tsparticles/smooth-value-noise": "4.0.0-beta.10"
96
96
  },
97
97
  "exports": {
98
98
  ".": {
@@ -100,8 +100,7 @@
100
100
  "browser": "./browser/index.js",
101
101
  "import": "./esm/index.js",
102
102
  "require": "./cjs/index.js",
103
- "umd": "./umd/index.js",
104
- "default": "./cjs/index.js"
103
+ "default": "./esm/index.js"
105
104
  },
106
105
  "./package.json": "./package.json"
107
106
  },