q5 2.9.20 → 2.9.22
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 +20 -18
- package/package.json +1 -1
- package/q5.js +196 -103
- package/q5.min.js +1 -1
- package/src/q5-2d-canvas.js +8 -2
- package/src/q5-2d-drawing.js +41 -83
- package/src/q5-2d-image.js +1 -0
- package/src/q5-2d-text.js +7 -0
- package/src/q5-canvas.js +6 -5
- package/src/q5-color.js +5 -0
- package/src/q5-core.js +11 -1
- package/src/q5-input.js +12 -0
- package/src/q5-math.js +10 -3
- package/src/q5-record.js +2 -0
- package/src/q5-vector.js +33 -0
- package/src/q5-webgpu-canvas.js +4 -4
- package/src/q5-webgpu-drawing.js +53 -5
- package/src/q5-webgpu-text.js +5 -0
package/README.md
CHANGED
|
@@ -60,25 +60,33 @@ We need your support though! If you enjoy using q5.js, please donate via [GitHub
|
|
|
60
60
|
|
|
61
61
|
## Size Comparison
|
|
62
62
|
|
|
63
|
+
q5 is 98% smaller than p5.
|
|
64
|
+
|
|
65
|
+
p5.js is nearly 5MB in size due to lengthy JSDoc comments, [the WebGL render, and the dependencies corejs and opentype](https://github.com/processing/p5.js/issues/6776#issuecomment-1918238317).
|
|
66
|
+
|
|
67
|
+
q5's JSDoc comments are stored separately in the q5.d.ts file, which includes type definitions for Visual Studio Code autocompletion. q5 also has no dependencies.
|
|
68
|
+
|
|
69
|
+
npm packages:
|
|
70
|
+
|
|
71
|
+
- p5 **7800kb** ⚠️
|
|
72
|
+
- @types/p5 1070kb
|
|
73
|
+
- q5 415kb
|
|
74
|
+
|
|
63
75
|
Unminified:
|
|
64
76
|
|
|
65
77
|
- p5.js **5112kb** ⚠️
|
|
66
78
|
- p5.sound.js 488kb
|
|
67
|
-
- q5.js
|
|
79
|
+
- q5.js 117kb
|
|
68
80
|
|
|
69
81
|
Minified:
|
|
70
82
|
|
|
71
83
|
- p5.min.js 1034kb ⚠️
|
|
72
84
|
- p5.sound.min.js 200kb
|
|
73
|
-
- q5.min.js **
|
|
85
|
+
- q5.min.js **73kb** 🎉
|
|
74
86
|
|
|
75
87
|
## Modular Use
|
|
76
88
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
**q5.js** (the default bundle) is 98% smaller than p5, which is already great for typical use. For extremely lightweight use you can load a subset of scripts from the `src` folder.
|
|
80
|
-
|
|
81
|
-
See the [src/readme.md](src/readme.md) for more info on modular use.
|
|
89
|
+
For extremely lightweight use you can load a subset of scripts from the `src` folder. See the [src/readme.md](src/readme.md) for more info on modular use.
|
|
82
90
|
|
|
83
91
|
## Contributing
|
|
84
92
|
|
|
@@ -100,27 +108,21 @@ p5.js is licensed under the LGPLv2, small sections of p5' code directly copied i
|
|
|
100
108
|
|
|
101
109
|
## Credits
|
|
102
110
|
|
|
103
|
-
|
|
111
|
+
WebGPU MSDF text rendering:
|
|
104
112
|
https://webgpu.github.io/webgpu-samples/?sample=textRenderingMsdf
|
|
105
113
|
|
|
106
|
-
|
|
114
|
+
WebGPU blendMode:
|
|
107
115
|
https://webgpufundamentals.org/webgpu/lessons/webgpu-transparency.html
|
|
108
116
|
|
|
109
|
-
|
|
110
|
-
https://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline
|
|
111
|
-
|
|
112
|
-
ziggurat:
|
|
117
|
+
A JS Implementation of Ziggurat Algorithm:
|
|
113
118
|
http://ziggurat.glitch.me/
|
|
114
119
|
|
|
115
|
-
Vector.slerp:
|
|
120
|
+
p5.js Vector.slerp:
|
|
116
121
|
https://github.com/processing/p5.js/blob/v1.10.0/src/math/p5.Vector.js#L2803
|
|
117
122
|
|
|
118
|
-
random:
|
|
123
|
+
p5.js random:
|
|
119
124
|
https://github.com/processing/p5.js/blob/1.1.9/src/math/noise.js
|
|
120
125
|
|
|
121
|
-
Curve query:
|
|
122
|
-
https://github.com/processing/p5.js/blob/1.1.9/src/core/shape/curves.js
|
|
123
|
-
|
|
124
126
|
[p5]: https://p5js.org
|
|
125
127
|
[p5.js]: https://p5js.org
|
|
126
128
|
[Processing Java]: https://processing.org
|