p5 2.2.1-rc.0 → 2.2.1

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.
Files changed (117) hide show
  1. package/dist/accessibility/color_namer.js +5 -6
  2. package/dist/accessibility/describe.js +4 -26
  3. package/dist/accessibility/index.js +5 -6
  4. package/dist/accessibility/outputs.js +6 -38
  5. package/dist/app.js +5 -6
  6. package/dist/color/color_conversion.js +5 -6
  7. package/dist/color/creating_reading.js +1 -1
  8. package/dist/color/index.js +2 -2
  9. package/dist/color/p5.Color.js +1 -1
  10. package/dist/color/setting.js +59 -357
  11. package/dist/{constants-DEJVKr9Z.js → constants-DQyACdzq.js} +11 -61
  12. package/dist/core/constants.js +1 -1
  13. package/dist/core/environment.js +26 -158
  14. package/dist/core/filterShaders.js +1 -1
  15. package/dist/core/friendly_errors/fes_core.js +1 -1
  16. package/dist/core/friendly_errors/file_errors.js +1 -1
  17. package/dist/core/friendly_errors/index.js +1 -1
  18. package/dist/core/friendly_errors/param_validator.js +1 -1
  19. package/dist/core/friendly_errors/sketch_verifier.js +1 -1
  20. package/dist/core/helpers.js +1 -1
  21. package/dist/core/init.js +5 -6
  22. package/dist/core/internationalization.js +1 -1
  23. package/dist/core/legacy.js +5 -6
  24. package/dist/core/main.js +5 -6
  25. package/dist/core/p5.Graphics.js +4 -5
  26. package/dist/core/p5.Renderer.js +3 -4
  27. package/dist/core/p5.Renderer2D.js +5 -6
  28. package/dist/core/p5.Renderer3D.js +4 -5
  29. package/dist/core/rendering.js +4 -5
  30. package/dist/core/structure.js +13 -52
  31. package/dist/core/transform.js +32 -176
  32. package/dist/{creating_reading-CgHCHxqN.js → creating_reading-ZXzcZEsb.js} +3 -196
  33. package/dist/data/local_storage.js +4 -30
  34. package/dist/dom/dom.js +24 -159
  35. package/dist/dom/index.js +2 -2
  36. package/dist/dom/p5.Element.js +31 -208
  37. package/dist/dom/p5.File.js +1 -32
  38. package/dist/dom/p5.MediaElement.js +10 -113
  39. package/dist/events/acceleration.js +11 -64
  40. package/dist/events/keyboard.js +13 -81
  41. package/dist/events/pointer.js +18 -160
  42. package/dist/image/const.js +1 -1
  43. package/dist/image/filterRenderer2D.js +4 -5
  44. package/dist/image/image.js +4 -5
  45. package/dist/image/index.js +4 -5
  46. package/dist/image/loading_displaying.js +4 -5
  47. package/dist/image/p5.Image.js +3 -4
  48. package/dist/image/pixels.js +17 -100
  49. package/dist/io/files.js +4 -5
  50. package/dist/io/index.js +4 -5
  51. package/dist/io/p5.Table.js +66 -158
  52. package/dist/io/p5.TableRow.js +48 -71
  53. package/dist/io/p5.XML.js +6 -99
  54. package/dist/io/utilities.js +8 -3
  55. package/dist/{main-_RXV5Lx8.js → main-DvN69W3f.js} +13 -42
  56. package/dist/math/Matrices/Matrix.js +87 -126
  57. package/dist/math/Matrices/MatrixNumjs.js +1 -5
  58. package/dist/math/calculation.js +10 -112
  59. package/dist/math/index.js +1 -1
  60. package/dist/math/math.js +2 -12
  61. package/dist/math/noise.js +5 -32
  62. package/dist/math/p5.Matrix.js +3 -3
  63. package/dist/math/p5.Vector.js +104 -345
  64. package/dist/math/random.js +5 -32
  65. package/dist/math/trigonometry.js +15 -105
  66. package/dist/{p5.Renderer-QoFcvj3f.js → p5.Renderer-D-5LdCRz.js} +25 -178
  67. package/dist/{rendering-CsICjEXA.js → rendering-h9unX5K0.js} +254 -1156
  68. package/dist/shape/2d_primitives.js +33 -194
  69. package/dist/shape/attributes.js +12 -73
  70. package/dist/shape/curves.js +30 -95
  71. package/dist/shape/custom_shapes.js +63 -144
  72. package/dist/shape/index.js +2 -2
  73. package/dist/shape/vertex.js +21 -106
  74. package/dist/strands/p5.strands.js +248 -46
  75. package/dist/type/index.js +3 -4
  76. package/dist/type/p5.Font.js +4 -49
  77. package/dist/type/textCore.js +5 -158
  78. package/dist/utilities/conversion.js +17 -104
  79. package/dist/utilities/time_date.js +3 -40
  80. package/dist/utilities/utility_functions.js +6 -48
  81. package/dist/webgl/3d_primitives.js +4 -5
  82. package/dist/webgl/GeometryBuilder.js +1 -2
  83. package/dist/webgl/ShapeBuilder.js +22 -2
  84. package/dist/webgl/enums.js +1 -1
  85. package/dist/webgl/index.js +4 -5
  86. package/dist/webgl/interaction.js +6 -33
  87. package/dist/webgl/light.js +4 -5
  88. package/dist/webgl/loading.js +12 -46
  89. package/dist/webgl/material.js +4 -5
  90. package/dist/webgl/p5.Camera.js +4 -5
  91. package/dist/webgl/p5.DataArray.js +0 -4
  92. package/dist/webgl/p5.Framebuffer.js +4 -5
  93. package/dist/webgl/p5.Geometry.js +12 -106
  94. package/dist/webgl/p5.Quat.js +1 -1
  95. package/dist/webgl/p5.RendererGL.js +7 -18
  96. package/dist/webgl/p5.Shader.js +12 -36
  97. package/dist/webgl/p5.Texture.js +4 -5
  98. package/dist/webgl/text.js +4 -5
  99. package/dist/webgl/utils.js +4 -5
  100. package/dist/webgpu/index.js +1 -1
  101. package/dist/webgpu/p5.RendererWebGPU.js +529 -208
  102. package/dist/webgpu/shaders/color.js +32 -17
  103. package/dist/webgpu/shaders/filters/base.js +18 -7
  104. package/dist/webgpu/shaders/font.js +52 -40
  105. package/dist/webgpu/shaders/line.js +50 -36
  106. package/dist/webgpu/shaders/material.js +90 -83
  107. package/dist/webgpu/strands_wgslBackend.js +5 -2
  108. package/lib/p5.esm.js +5576 -7811
  109. package/lib/p5.esm.min.js +1 -1
  110. package/lib/p5.js +5576 -7811
  111. package/lib/p5.min.js +1 -1
  112. package/lib/p5.webgpu.esm.js +786 -453
  113. package/lib/p5.webgpu.js +786 -453
  114. package/lib/p5.webgpu.min.js +1 -1
  115. package/package.json +13 -13
  116. package/types/global.d.ts +16905 -16783
  117. package/types/p5.d.ts +11142 -11081
@@ -1,6 +1,6 @@
1
1
  import { File } from './p5.File.js';
2
- import { C as Color } from '../creating_reading-CgHCHxqN.js';
3
- import { a4 as AUTO } from '../constants-DEJVKr9Z.js';
2
+ import { C as Color } from '../creating_reading-ZXzcZEsb.js';
3
+ import { a4 as AUTO } from '../constants-DQyACdzq.js';
4
4
  import '../io/p5.XML.js';
5
5
  import 'colorjs.io/fn';
6
6
  import '../color/color_spaces/hsb.js';
@@ -29,8 +29,6 @@ class Element {
29
29
  * callback functions.
30
30
  *
31
31
  * @example
32
- * <div>
33
- * <code>
34
32
  * let p;
35
33
  *
36
34
  * function setup() {
@@ -49,8 +47,6 @@ class Element {
49
47
  * function doubleClicked() {
50
48
  * p.remove();
51
49
  * }
52
- * </code>
53
- * </div>
54
50
  */
55
51
  remove() {
56
52
  // stop all audios/videos and detach all devices like microphone/camera etc
@@ -120,8 +116,6 @@ class Element {
120
116
  * @chainable
121
117
  *
122
118
  * @example
123
- * <div>
124
- * <code>
125
119
  * function setup() {
126
120
  * background(200);
127
121
  *
@@ -152,11 +146,8 @@ class Element {
152
146
  *
153
147
  * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.');
154
148
  * }
155
- * </code>
156
- * </div>
157
149
  *
158
- * <div>
159
- * <code>
150
+ * @example
160
151
  * function setup() {
161
152
  * background(200);
162
153
  *
@@ -182,11 +173,8 @@ class Element {
182
173
  *
183
174
  * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.');
184
175
  * }
185
- * </code>
186
- * </div>
187
176
  *
188
- * <div>
189
- * <code>
177
+ * @example
190
178
  * function setup() {
191
179
  * background(200);
192
180
  *
@@ -214,8 +202,6 @@ class Element {
214
202
  *
215
203
  * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.');
216
204
  * }
217
- * </code>
218
- * </div>
219
205
  */
220
206
  /**
221
207
  * @return {p5.Element}
@@ -248,8 +234,7 @@ class Element {
248
234
  * @returns {Node[]} an array of child nodes.
249
235
  *
250
236
  * @example
251
- * <div class='norender'>
252
- * <code>
237
+ * // META:norender
253
238
  * function setup() {
254
239
  * createCanvas(100, 100);
255
240
  *
@@ -265,11 +250,9 @@ class Element {
265
250
  *
266
251
  * describe('A gray square with the words "Parent" and "Child" written beneath it.');
267
252
  * }
268
- * </code>
269
- * </div>
270
253
  *
271
- * <div class='norender'>
272
- * <code>
254
+ * @example
255
+ * // META:norender
273
256
  * function setup() {
274
257
  * createCanvas(100, 100);
275
258
  *
@@ -288,11 +271,9 @@ class Element {
288
271
  *
289
272
  * describe('A gray square with the words "Parent" and "Child" written beneath it.');
290
273
  * }
291
- * </code>
292
- * </div>
293
274
  *
294
- * <div class='norender notest'>
295
- * <code>
275
+ * @example
276
+ * // META:norender
296
277
  * // This example assumes there is a div already on the page
297
278
  * // with id "myChildDiv".
298
279
  *
@@ -313,8 +294,6 @@ class Element {
313
294
  *
314
295
  * describe('A gray square with the words "Parent" and "Child" written beneath it.');
315
296
  * }
316
- * </code>
317
- * </div>
318
297
  */
319
298
  /**
320
299
  * @param {String|p5.Element} [child] the ID, DOM node, or <a href="#/p5.Element">p5.Element</a>
@@ -354,8 +333,7 @@ class Element {
354
333
  * @returns {String} the inner HTML of the element
355
334
  *
356
335
  * @example
357
- * <div class='norender'>
358
- * <code>
336
+ * // META:norender
359
337
  * function setup() {
360
338
  * createCanvas(100, 100);
361
339
  *
@@ -368,11 +346,9 @@ class Element {
368
346
  *
369
347
  * describe('A gray square with the word "hi" written beneath it.');
370
348
  * }
371
- * </code>
372
- * </div>
373
349
  *
374
- * <div class='norender'>
375
- * <code>
350
+ * @example
351
+ * // META:norender
376
352
  * function setup() {
377
353
  * createCanvas(100, 100);
378
354
  *
@@ -387,11 +363,9 @@ class Element {
387
363
  *
388
364
  * describe('A gray square with the text "Hello World" written beneath it.');
389
365
  * }
390
- * </code>
391
- * </div>
392
366
  *
393
- * <div class='norender'>
394
- * <code>
367
+ * @example
368
+ * // META:norender
395
369
  * function setup() {
396
370
  * createCanvas(100, 100);
397
371
  *
@@ -405,8 +379,6 @@ class Element {
405
379
  *
406
380
  * describe('A gray square with the word "Hello!" written beneath it.');
407
381
  * }
408
- * </code>
409
- * </div>
410
382
  */
411
383
  /**
412
384
  * @param {String} [html] the HTML to be placed inside the element
@@ -434,8 +406,6 @@ class Element {
434
406
  * @chainable
435
407
  *
436
408
  * @example
437
- * <div>
438
- * <code>
439
409
  * function setup() {
440
410
  * // Create a canvas element and
441
411
  * // assign it to cnv.
@@ -453,8 +423,6 @@ class Element {
453
423
  *
454
424
  * describe('The text "mycanvas" written in black on a gray background.');
455
425
  * }
456
- * </code>
457
- * </div>
458
426
  */
459
427
  /**
460
428
  * @return {String} ID of the element.
@@ -481,8 +449,6 @@ class Element {
481
449
  * @chainable
482
450
  *
483
451
  * @example
484
- * <div>
485
- * <code>
486
452
  * function setup() {
487
453
  * // Create a canvas element and
488
454
  * // assign it to cnv.
@@ -502,8 +468,6 @@ class Element {
502
468
  * describe('The word "small" written in black on a gray canvas.');
503
469
  *
504
470
  * }
505
- * </code>
506
- * </div>
507
471
  */
508
472
  /**
509
473
  * @return {String} element's classes, if any.
@@ -526,8 +490,7 @@ class Element {
526
490
  * @chainable
527
491
  *
528
492
  * @example
529
- * <div class='norender'>
530
- * <code>
493
+ * // META:norender
531
494
  * function setup() {
532
495
  * createCanvas(100, 100);
533
496
  *
@@ -541,8 +504,6 @@ class Element {
541
504
  *
542
505
  * describe('A gray square.');
543
506
  * }
544
- * </code>
545
- * </div>
546
507
  */
547
508
  addClass(c) {
548
509
  if (this.elt.className) {
@@ -562,8 +523,7 @@ class Element {
562
523
  * @chainable
563
524
  *
564
525
  * @example
565
- * <div class='norender'>
566
- * <code>
526
+ * // META:norender
567
527
  * // In this example, a class is set when the div is created
568
528
  * // and removed when mouse is pressed. This could link up
569
529
  * // with a CSS style rule to toggle style properties.
@@ -588,8 +548,6 @@ class Element {
588
548
  * function mousePressed() {
589
549
  * div.removeClass('myClass');
590
550
  * }
591
- * </code>
592
- * </div>
593
551
  */
594
552
  removeClass(c) {
595
553
  // Note: Removing a class that does not exist does NOT throw an error in classList.remove method
@@ -604,8 +562,7 @@ class Element {
604
562
  * @param c {String} name of class to check.
605
563
  *
606
564
  * @example
607
- * <div class='norender'>
608
- * <code>
565
+ * // META:norender
609
566
  * let div;
610
567
  *
611
568
  * function setup() {
@@ -630,8 +587,6 @@ class Element {
630
587
  * div.removeClass('show');
631
588
  * }
632
589
  * }
633
- * </code>
634
- * </div>
635
590
  */
636
591
  hasClass(c) {
637
592
  return this.elt.classList.contains(c);
@@ -644,8 +599,7 @@ class Element {
644
599
  * @chainable
645
600
  *
646
601
  * @example
647
- * <div class='norender'>
648
- * <code>
602
+ * // META:norender
649
603
  * let div;
650
604
  *
651
605
  * function setup() {
@@ -666,8 +620,6 @@ class Element {
666
620
  * function mousePressed() {
667
621
  * div.toggleClass('show');
668
622
  * }
669
- * </code>
670
- * </div>
671
623
  */
672
624
  toggleClass(c) {
673
625
  // classList also has a toggle() method, but we cannot use that yet as support is unclear.
@@ -694,8 +646,6 @@ class Element {
694
646
  * @chainable
695
647
  *
696
648
  * @example
697
- * <div>
698
- * <code>
699
649
  * function setup() {
700
650
  * createCanvas(100, 100);
701
651
  *
@@ -711,8 +661,6 @@ class Element {
711
661
  *
712
662
  * describe('A gray square and an orange rectangle. The rectangle is at the center of the page.');
713
663
  * }
714
- * </code>
715
- * </div>
716
664
  */
717
665
  center(align) {
718
666
  const style = this.elt.style.display;
@@ -766,8 +714,7 @@ class Element {
766
714
  * @returns {Object} object of form `{ x: 0, y: 0 }` containing the element's position.
767
715
  *
768
716
  * @example
769
- * <div>
770
- * <code class='norender'>
717
+ * // META:norender
771
718
  * function setup() {
772
719
  * let cnv = createCanvas(100, 100);
773
720
  *
@@ -779,11 +726,9 @@ class Element {
779
726
  *
780
727
  * describe('A gray square that is 50 pixels to the right and 100 pixels down from the top-left corner of the web page.');
781
728
  * }
782
- * </code>
783
- * </div>
784
729
  *
785
- * <div>
786
- * <code class='norender'>
730
+ * @example
731
+ * // META:norender
787
732
  * function setup() {
788
733
  * let cnv = createCanvas(100, 100);
789
734
  *
@@ -795,8 +740,6 @@ class Element {
795
740
  *
796
741
  * describe('A gray square in the top-left corner of the web page.');
797
742
  * }
798
- * </code>
799
- * </div>
800
743
  */
801
744
  /**
802
745
  * @param {Number} [x] x-position relative to top-left of window (optional)
@@ -834,8 +777,6 @@ class Element {
834
777
  * @chainable
835
778
  *
836
779
  * @example
837
- * <div>
838
- * <code>
839
780
  * let p;
840
781
  *
841
782
  * function setup() {
@@ -855,8 +796,6 @@ class Element {
855
796
  * function doubleClicked() {
856
797
  * p.show();
857
798
  * }
858
- * </code>
859
- * </div>
860
799
  */
861
800
  show() {
862
801
  this.elt.style.display = 'block';
@@ -887,8 +826,6 @@ class Element {
887
826
  * function doubleClicked() {
888
827
  * p.hide();
889
828
  * }
890
- * </code>
891
- * </div>
892
829
  */
893
830
  hide() {
894
831
  this.elt.style.display = 'none';
@@ -922,8 +859,6 @@ class Element {
922
859
  * @return {Object} width and height of the element in an object.
923
860
  *
924
861
  * @example
925
- * <div>
926
- * <code>
927
862
  * function setup() {
928
863
  * createCanvas(100, 100);
929
864
  *
@@ -939,11 +874,8 @@ class Element {
939
874
  *
940
875
  * describe('A gray square with a pink rectangle near its top.');
941
876
  * }
942
- * </code>
943
- * </div>
944
877
  *
945
- * <div>
946
- * <code>
878
+ * @example
947
879
  * function setup() {
948
880
  * createCanvas(100, 100);
949
881
  *
@@ -965,11 +897,8 @@ class Element {
965
897
  *
966
898
  * describe('A gray square with a pink rectangle near its top. The text "80 x 40" is written within the rectangle.');
967
899
  * }
968
- * </code>
969
- * </div>
970
900
  *
971
- * <div>
972
- * <code>
901
+ * @example
973
902
  * let img1;
974
903
  * let img2;
975
904
  *
@@ -1005,8 +934,6 @@ class Element {
1005
934
  * function resizeImage() {
1006
935
  * img2.size(50, AUTO);
1007
936
  * }
1008
- * </code>
1009
- * </div>
1010
937
  */
1011
938
  /**
1012
939
  * @param {(Number|AUTO)} [w] width of the element, either AUTO, or a number.
@@ -1086,8 +1013,6 @@ class Element {
1086
1013
  * @returns {String} value of the property.
1087
1014
  *
1088
1015
  * @example
1089
- * <div>
1090
- * <code>
1091
1016
  * function setup() {
1092
1017
  * createCanvas(100, 100);
1093
1018
  *
@@ -1100,11 +1025,8 @@ class Element {
1100
1025
  *
1101
1026
  * describe('The text p5*js written in pink on a gray background.');
1102
1027
  * }
1103
- * </code>
1104
- * </div>
1105
1028
  *
1106
- * <div>
1107
- * <code>
1029
+ * @example
1108
1030
  * function setup() {
1109
1031
  * createCanvas(100, 100);
1110
1032
  *
@@ -1120,11 +1042,8 @@ class Element {
1120
1042
  *
1121
1043
  * describe('The text p5*js written in pink on a gray background.');
1122
1044
  * }
1123
- * </code>
1124
- * </div>
1125
1045
  *
1126
- * <div>
1127
- * <code>
1046
+ * @example
1128
1047
  * function setup() {
1129
1048
  * createCanvas(100, 100);
1130
1049
  *
@@ -1138,11 +1057,8 @@ class Element {
1138
1057
  *
1139
1058
  * describe('The text p5*js written in pink on a gray background.');
1140
1059
  * }
1141
- * </code>
1142
- * </div>
1143
1060
  *
1144
- * <div>
1145
- * <code>
1061
+ * @example
1146
1062
  * function setup() {
1147
1063
  * createCanvas(100, 100);
1148
1064
  *
@@ -1161,8 +1077,6 @@ class Element {
1161
1077
  *
1162
1078
  * describe('The text "rgb(255, 20, 147)" written in pink on a gray background.');
1163
1079
  * }
1164
- * </code>
1165
- * </div>
1166
1080
  */
1167
1081
  /**
1168
1082
  * @param {String} property
@@ -1289,8 +1203,6 @@ class Element {
1289
1203
  * @return {String} value of the attribute.
1290
1204
  *
1291
1205
  * @example
1292
- * <div>
1293
- * <code>
1294
1206
  * function setup() {
1295
1207
  * createCanvas(100, 100);
1296
1208
  *
@@ -1318,8 +1230,6 @@ class Element {
1318
1230
  *
1319
1231
  * describe('A gray square with the text "hi" written on three separate lines, each placed further to the right.');
1320
1232
  * }
1321
- * </code>
1322
- * </div>
1323
1233
  */
1324
1234
  /**
1325
1235
  * @param {String} attr attribute to set.
@@ -1360,8 +1270,6 @@ class Element {
1360
1270
  * @chainable
1361
1271
  *
1362
1272
  * @example
1363
- * <div>
1364
- * <code>
1365
1273
  * let p;
1366
1274
  *
1367
1275
  * function setup() {
@@ -1382,8 +1290,6 @@ class Element {
1382
1290
  * function doubleClicked() {
1383
1291
  * p.removeAttribute('align');
1384
1292
  * }
1385
- * </code>
1386
- * </div>
1387
1293
  */
1388
1294
  removeAttribute(attr) {
1389
1295
  if (
@@ -1410,8 +1316,6 @@ class Element {
1410
1316
  * @return {String|Number} value of the element.
1411
1317
  *
1412
1318
  * @example
1413
- * <div>
1414
- * <code>
1415
1319
  * let input;
1416
1320
  *
1417
1321
  * function setup() {
@@ -1432,11 +1336,8 @@ class Element {
1432
1336
  * let msg = input.value();
1433
1337
  * text(msg, 0, 55);
1434
1338
  * }
1435
- * </code>
1436
- * </div>
1437
1339
  *
1438
- * <div>
1439
- * <code>
1340
+ * @example
1440
1341
  * let input;
1441
1342
  *
1442
1343
  * function setup() {
@@ -1462,8 +1363,6 @@ class Element {
1462
1363
  * function doubleClicked() {
1463
1364
  * input.value('hello');
1464
1365
  * }
1465
- * </code>
1466
- * </div>
1467
1366
  */
1468
1367
  /**
1469
1368
  * @param {String|Number} value
@@ -1494,8 +1393,6 @@ class Element {
1494
1393
  * @chainable
1495
1394
  *
1496
1395
  * @example
1497
- * <div>
1498
- * <code>
1499
1396
  * function setup() {
1500
1397
  * // Create a canvas element and
1501
1398
  * // assign it to cnv.
@@ -1516,8 +1413,6 @@ class Element {
1516
1413
  * let c = random(['red', 'yellow', 'blue', 'green']);
1517
1414
  * background(c);
1518
1415
  * }
1519
- * </code>
1520
- * </div>
1521
1416
  */
1522
1417
  mousePressed(fxn) {
1523
1418
  // Prepend the mouse property setters to the event-listener.
@@ -1547,8 +1442,6 @@ class Element {
1547
1442
  * @chainable
1548
1443
  *
1549
1444
  * @example
1550
- * <div>
1551
- * <code>
1552
1445
  * function setup() {
1553
1446
  * // Create a canvas element and
1554
1447
  * // assign it to cnv.
@@ -1569,8 +1462,6 @@ class Element {
1569
1462
  * let c = random(['red', 'yellow', 'blue', 'green']);
1570
1463
  * background(c);
1571
1464
  * }
1572
- * </code>
1573
- * </div>
1574
1465
  */
1575
1466
  doubleClicked(fxn) {
1576
1467
  Element._adjustListener('dblclick', fxn, this);
@@ -1595,8 +1486,6 @@ class Element {
1595
1486
  * @chainable
1596
1487
  *
1597
1488
  * @example
1598
- * <div>
1599
- * <code>
1600
1489
  * function setup() {
1601
1490
  * // Create a canvas element and
1602
1491
  * // assign it to cnv.
@@ -1617,11 +1506,8 @@ class Element {
1617
1506
  * let c = random(['red', 'yellow', 'blue', 'green']);
1618
1507
  * background(c);
1619
1508
  * }
1620
- * </code>
1621
- * </div>
1622
1509
  *
1623
- * <div>
1624
- * <code>
1510
+ * @example
1625
1511
  * function setup() {
1626
1512
  * // Create a canvas element and
1627
1513
  * // assign it to cnv.
@@ -1654,8 +1540,6 @@ class Element {
1654
1540
  * square(40, 40, 20);
1655
1541
  * }
1656
1542
  * }
1657
- * </code>
1658
- * </div>
1659
1543
  */
1660
1544
  mouseWheel(fxn) {
1661
1545
  Element._adjustListener('wheel', fxn, this);
@@ -1676,8 +1560,6 @@ class Element {
1676
1560
  * @chainable
1677
1561
  *
1678
1562
  * @example
1679
- * <div>
1680
- * <code>
1681
1563
  * function setup() {
1682
1564
  * // Create a canvas element and
1683
1565
  * // assign it to cnv.
@@ -1698,8 +1580,6 @@ class Element {
1698
1580
  * let c = random(['red', 'yellow', 'blue', 'green']);
1699
1581
  * background(c);
1700
1582
  * }
1701
- * </code>
1702
- * </div>
1703
1583
  */
1704
1584
  mouseReleased(fxn) {
1705
1585
  Element._adjustListener('pointerup', fxn, this);
@@ -1720,8 +1600,6 @@ class Element {
1720
1600
  * @chainable
1721
1601
  *
1722
1602
  * @example
1723
- * <div>
1724
- * <code>
1725
1603
  * function setup() {
1726
1604
  * // Create a canvas element and
1727
1605
  * // assign it to cnv.
@@ -1742,8 +1620,6 @@ class Element {
1742
1620
  * let c = random(['red', 'yellow', 'blue', 'green']);
1743
1621
  * background(c);
1744
1622
  * }
1745
- * </code>
1746
- * </div>
1747
1623
  */
1748
1624
  mouseClicked(fxn) {
1749
1625
  Element._adjustListener('click', fxn, this);
@@ -1761,8 +1637,6 @@ class Element {
1761
1637
  * @chainable
1762
1638
  *
1763
1639
  * @example
1764
- * <div>
1765
- * <code>
1766
1640
  * function setup() {
1767
1641
  * // Create a canvas element and
1768
1642
  * // assign it to cnv.
@@ -1783,8 +1657,6 @@ class Element {
1783
1657
  * let c = random(['red', 'yellow', 'blue', 'green']);
1784
1658
  * background(c);
1785
1659
  * }
1786
- * </code>
1787
- * </div>
1788
1660
  */
1789
1661
  mouseMoved(fxn) {
1790
1662
  Element._adjustListener('pointermove', fxn, this);
@@ -1802,8 +1674,6 @@ class Element {
1802
1674
  * @chainable
1803
1675
  *
1804
1676
  * @example
1805
- * <div>
1806
- * <code>
1807
1677
  * function setup() {
1808
1678
  * // Create a canvas element and
1809
1679
  * // assign it to cnv.
@@ -1824,8 +1694,6 @@ class Element {
1824
1694
  * let c = random(['red', 'yellow', 'blue', 'green']);
1825
1695
  * background(c);
1826
1696
  * }
1827
- * </code>
1828
- * </div>
1829
1697
  */
1830
1698
  mouseOver(fxn) {
1831
1699
  Element._adjustListener('pointerover', fxn, this);
@@ -1843,8 +1711,6 @@ class Element {
1843
1711
  * @chainable
1844
1712
  *
1845
1713
  * @example
1846
- * <div>
1847
- * <code>
1848
1714
  * function setup() {
1849
1715
  * // Create a canvas element and
1850
1716
  * // assign it to cnv.
@@ -1865,8 +1731,6 @@ class Element {
1865
1731
  * let c = random(['red', 'yellow', 'blue', 'green']);
1866
1732
  * background(c);
1867
1733
  * }
1868
- * </code>
1869
- * </div>
1870
1734
  */
1871
1735
  mouseOut(fxn) {
1872
1736
  Element._adjustListener('pointerout', fxn, this);
@@ -1884,8 +1748,6 @@ class Element {
1884
1748
  * @chainable
1885
1749
  *
1886
1750
  * @example
1887
- * <div>
1888
- * <code>
1889
1751
  * // Drag a file over the canvas to test.
1890
1752
  *
1891
1753
  * function setup() {
@@ -1906,8 +1768,6 @@ class Element {
1906
1768
  * function helloFile() {
1907
1769
  * text('hello, file', 50, 50);
1908
1770
  * }
1909
- * </code>
1910
- * </div>
1911
1771
  */
1912
1772
  dragOver(fxn) {
1913
1773
  Element._adjustListener('dragover', fxn, this);
@@ -1924,8 +1784,6 @@ class Element {
1924
1784
  * `false` disables the function.
1925
1785
  * @chainable
1926
1786
  * @example
1927
- * <div>
1928
- * <code>
1929
1787
  * // Drag a file over, then off
1930
1788
  * // the canvas to test.
1931
1789
  *
@@ -1947,8 +1805,6 @@ class Element {
1947
1805
  * function byeFile() {
1948
1806
  * text('bye, file', 50, 50);
1949
1807
  * }
1950
- * </code>
1951
- * </div>
1952
1808
  */
1953
1809
  dragLeave(fxn) {
1954
1810
  Element._adjustListener('dragleave', fxn, this);
@@ -1965,8 +1821,6 @@ class Element {
1965
1821
  * @chainable
1966
1822
  *
1967
1823
  * @example
1968
- * <div>
1969
- * <code>
1970
1824
  * let dropdown;
1971
1825
  *
1972
1826
  * function setup() {
@@ -1992,11 +1846,8 @@ class Element {
1992
1846
  * let c = dropdown.value();
1993
1847
  * background(c);
1994
1848
  * }
1995
- * </code>
1996
- * </div>
1997
1849
  *
1998
- * <div>
1999
- * <code>
1850
+ * @example
2000
1851
  * let checkbox;
2001
1852
  *
2002
1853
  * function setup() {
@@ -2021,8 +1872,6 @@ class Element {
2021
1872
  * circle(50, 50, 30);
2022
1873
  * }
2023
1874
  * }
2024
- * </code>
2025
- * </div>
2026
1875
  */
2027
1876
  changed(fxn) {
2028
1877
  Element._adjustListener('change', fxn, this);
@@ -2041,8 +1890,6 @@ class Element {
2041
1890
  * @chainable
2042
1891
  *
2043
1892
  * @example
2044
- * <div>
2045
- * <code>
2046
1893
  * let slider;
2047
1894
  *
2048
1895
  * function setup() {
@@ -2065,11 +1912,8 @@ class Element {
2065
1912
  * let g = slider.value();
2066
1913
  * background(g);
2067
1914
  * }
2068
- * </code>
2069
- * </div>
2070
1915
  *
2071
- * <div>
2072
- * <code>
1916
+ * @example
2073
1917
  * let input;
2074
1918
  *
2075
1919
  * function setup() {
@@ -2093,8 +1937,6 @@ class Element {
2093
1937
  * let msg = input.value();
2094
1938
  * text(msg, 5, 50);
2095
1939
  * }
2096
- * </code>
2097
- * </div>
2098
1940
  */
2099
1941
  input(fxn) {
2100
1942
  Element._adjustListener('input', fxn, this);
@@ -2119,8 +1961,6 @@ class Element {
2119
1961
  * @chainable
2120
1962
  *
2121
1963
  * @example
2122
- * <div>
2123
- * <code>
2124
1964
  * // Drop an image on the canvas to view
2125
1965
  * // this example.
2126
1966
  * let img;
@@ -2151,11 +1991,8 @@ class Element {
2151
1991
  * // Draw the image.
2152
1992
  * image(img, 0, 0, width, height);
2153
1993
  * }
2154
- * </code>
2155
- * </div>
2156
1994
  *
2157
- * <div>
2158
- * <code>
1995
+ * @example
2159
1996
  * // Drop an image on the canvas to view
2160
1997
  * // this example.
2161
1998
  * let img;
@@ -2207,8 +2044,6 @@ class Element {
2207
2044
  * msg.style('color', c);
2208
2045
  * msg.style('font-size', '12px');
2209
2046
  * }
2210
- * </code>
2211
- * </div>
2212
2047
  */
2213
2048
  drop(callback, fxn) {
2214
2049
  // Is the file stuff supported?
@@ -2266,8 +2101,6 @@ class Element {
2266
2101
  * @chainable
2267
2102
  *
2268
2103
  * @example
2269
- * <div>
2270
- * <code>
2271
2104
  * let stickyNote;
2272
2105
  * let textInput;
2273
2106
  *
@@ -2319,8 +2152,6 @@ class Element {
2319
2152
  * function handleInput() {
2320
2153
  * stickyNote.html(textInput.value());
2321
2154
  * }
2322
- * </code>
2323
- * </div>
2324
2155
  */
2325
2156
  draggable(elmMove) {
2326
2157
  let isTouch = 'ontouchstart' in window;
@@ -2465,8 +2296,6 @@ function element(p5, fn){
2465
2296
  * @param {p5} [pInst] pointer to p5 instance.
2466
2297
  *
2467
2298
  * @example
2468
- * <div>
2469
- * <code>
2470
2299
  * function setup() {
2471
2300
  * createCanvas(100, 100);
2472
2301
  *
@@ -2490,8 +2319,6 @@ function element(p5, fn){
2490
2319
  * let c = random(['red', 'yellow', 'blue', 'green']);
2491
2320
  * background(c);
2492
2321
  * }
2493
- * </code>
2494
- * </div>
2495
2322
  */
2496
2323
  p5.Element = Element;
2497
2324
 
@@ -2519,8 +2346,6 @@ function element(p5, fn){
2519
2346
  * object's properties and methods can be used directly.
2520
2347
  *
2521
2348
  * @example
2522
- * <div>
2523
- * <code>
2524
2349
  * function setup() {
2525
2350
  * // Create a canvas element and
2526
2351
  * // assign it to cnv.
@@ -2534,8 +2359,6 @@ function element(p5, fn){
2534
2359
  *
2535
2360
  * describe('A gray square with a pink border drawn with dashed lines.');
2536
2361
  * }
2537
- * </code>
2538
- * </div>
2539
2362
  *
2540
2363
  * @type {HTMLElement}
2541
2364
  * @property elt