From 15e16c620d31218114e8515183bfc1959ff343ca Mon Sep 17 00:00:00 2001 From: JetStarBlues Date: Sun, 13 Jun 2021 18:21:08 -0600 Subject: [PATCH 001/131] Improve documetation of material functions --- src/webgl/material.js | 165 ++++++++++++++++++++++++++++++------------ 1 file changed, 119 insertions(+), 46 deletions(-) diff --git a/src/webgl/material.js b/src/webgl/material.js index 713b292d3b..91ecfebc7a 100644 --- a/src/webgl/material.js +++ b/src/webgl/material.js @@ -531,11 +531,17 @@ p5.prototype.textureWrap = function(wrapX, wrapY = wrapX) { }; /** - * Normal material for geometry is a material that is not affected by light. - * It is not reflective and is a placeholder material often used for debugging. - * Surfaces facing the X-axis, become red, those facing the Y-axis, become green and those facing the Z-axis, become blue. - * You can view all possible materials in this + * Creates a normal material. + * + * A normal material is not affected by light. It is often used as + * a placeholder material when debugging. + * + * Surfaces facing the X-axis become red, those facing the Y-axis + * become green, and those facing the Z-axis become blue. + * + * You can view more materials in this * example. + * * @method normalMaterial * @chainable * @example @@ -553,7 +559,7 @@ p5.prototype.textureWrap = function(wrapX, wrapY = wrapX) { * * * @alt - * Red, green and blue gradient. + * Sphere with normal material */ p5.prototype.normalMaterial = function(...args) { this._assert3d('normalMaterial'); @@ -569,14 +575,30 @@ p5.prototype.normalMaterial = function(...args) { }; /** - * Ambient material for geometry with a given color. Ambient material defines the color the object reflects under any lighting. - * For example, if the ambient material of an object is pure red, but the ambient lighting only contains green, the object will not reflect any light. - * Here's an example containing all possible materials. - * @method ambientMaterial - * @param {Number} v1 gray value, red or hue value - * (depending on the current color mode), - * @param {Number} [v2] green or saturation value - * @param {Number} [v3] blue or brightness value + * Creates an ambient material with the given color. + * + * The ambientMaterial() color is the color the object will reflect + * under **any** lighting. + * + * Consider an ambientMaterial() with the color yellow (255, 255, 0). + * If the light emits the color white (255, 255, 255), then the object + * will appear yellow as it will reflect the red and green components + * of the light. If the light emits the color red (255, 0, 0), then + * the object will appear red as it will reflect the red component + * of the light. If the light emits the color blue (0, 0, 255), + * then the object will appear black, as there is no component of + * the light that it can reflect. + * + * You can view more materials in this + * example. + * + * @method ambientMaterial + * @param {Number} v1 red or hue value relative to the current + * color range + * @param {Number} v2 green or saturation value relative to the + * current color range + * @param {Number} v3 blue or brightness value relative to the + * current color range * @chainable * @example *
@@ -587,12 +609,16 @@ p5.prototype.normalMaterial = function(...args) { * function draw() { * background(0); * noStroke(); - * ambientLight(200); + * ambientLight(255); * ambientMaterial(70, 130, 230); * sphere(40); * } * *
+ * @alt + * sphere reflecting red, blue, and green light + * + * @example *
* * // ambientLight is both red and blue (magenta), @@ -602,12 +628,16 @@ p5.prototype.normalMaterial = function(...args) { * } * function draw() { * background(70); - * ambientLight(100); // white light - * ambientMaterial(255, 0, 255); // pink material + * ambientLight(255, 0, 255); // magenta light + * ambientMaterial(255); // white material * box(30); * } * *
+ * @alt + * box reflecting only red and blue light + * + * @example *
* * // ambientLight is green. Since object does not contain @@ -618,19 +648,27 @@ p5.prototype.normalMaterial = function(...args) { * function draw() { * background(70); * ambientLight(0, 255, 0); // green light - * ambientMaterial(255, 0, 255); // pink material + * ambientMaterial(255, 0, 255); // magenta material * box(30); * } * *
* @alt - * radiating light source from top right of canvas - * box reflecting only red and blue light * box reflecting no light */ + /** - * @method ambientMaterial - * @param {Number[]|String|p5.Color} color color, color Array, or CSS color string + * @method ambientMaterial + * @param {Number} gray number specifying value between + * white and black + * @chainable + */ + +/** + * @method ambientMaterial + * @param {p5.Color|Number[]|String} color + * color as a p5.Color, + * as an array, or as a CSS string * @chainable */ p5.prototype.ambientMaterial = function(v1, v2, v3) { @@ -649,17 +687,27 @@ p5.prototype.ambientMaterial = function(v1, v2, v3) { }; /** - * Sets the emissive color of the material used for geometry drawn to - * the screen. This is a misnomer in the sense that the material does not - * actually emit light that effects surrounding polygons. Instead, - * it gives the appearance that the object is glowing. An emissive material - * will display at full strength even if there is no light for it to reflect. + * Creates an emissive material with the given color. + * + * An emissive material will display the emissive color at + * full strength regardless of lighting. This can give the + * appearance that the object is glowing. + * + * Note, "emissive" is a misnomer in the sense that the material + * does not actually emit light that will affect surrounding objects. + * + * You can view more materials in this + * example. + * * @method emissiveMaterial - * @param {Number} v1 gray value, red or hue value - * (depending on the current color mode), - * @param {Number} [v2] green or saturation value - * @param {Number} [v3] blue or brightness value - * @param {Number} [a] opacity + * @param {Number} v1 red or hue value relative to the current + * color range + * @param {Number} v2 green or saturation value relative to the + * current color range + * @param {Number} v3 blue or brightness value relative to the + * current color range + * @param {Number} [alpha] alpha value relative to current color + * range (default is 0-255) * @chainable * @example *
@@ -678,11 +726,21 @@ p5.prototype.ambientMaterial = function(v1, v2, v3) { *
* * @alt - * radiating light source from top right of canvas + * sphere with green emissive material + */ + +/** + * @method emissiveMaterial + * @param {Number} gray number specifying value between + * white and black + * @chainable */ + /** - * @method emissiveMaterial - * @param {Number[]|String|p5.Color} color color, color Array, or CSS color string + * @method emissiveMaterial + * @param {p5.Color|Number[]|String} color + * color as a p5.Color, + * as an array, or as a CSS string * @chainable */ p5.prototype.emissiveMaterial = function(v1, v2, v3, a) { @@ -701,11 +759,23 @@ p5.prototype.emissiveMaterial = function(v1, v2, v3, a) { }; /** - * Specular material for geometry with a given color. Specular material is a shiny reflective material. - * Like ambient material it also defines the color the object reflects under ambient lighting. - * For example, if the specular material of an object is pure red, but the ambient lighting only contains green, the object will not reflect any light. - * For all other types of light like point and directional light, a specular material will reflect the color of the light source to the viewer. - * Here's an example containing all possible materials. + * Creates a specular material with the given color. + * + * A specular material is reflective (shiny). The shininess can be + * controlled by the shininess() function. + * + * Like ambientMaterial(), + * the specularMaterial() color is the color the object will reflect + * under ambientLight(). + * However unlike ambientMaterial(), for all other types of lights + * (directionalLight(), + * pointLight(), + * spotLight()), + * a specular material will reflect the **color of the light source**. + * This is what gives it its "shiny" appearance. + * + * You can view more materials in this + * example. * * @method specularMaterial * @param {Number} gray number specifying value between white and black. @@ -746,7 +816,9 @@ p5.prototype.emissiveMaterial = function(v1, v2, v3, a) { /** * @method specularMaterial - * @param {Number[]|String|p5.Color} color color Array, or CSS color string + * @param {p5.Color|Number[]|String} color + * color as a p5.Color, + * as an array, or as a CSS string * @chainable */ p5.prototype.specularMaterial = function(v1, v2, v3, alpha) { @@ -765,12 +837,13 @@ p5.prototype.specularMaterial = function(v1, v2, v3, alpha) { }; /** - * Sets the amount of gloss in the surface of shapes. - * Used in combination with specularMaterial() in setting - * the material properties of shapes. The default and minimum value is 1. + * Sets the amount of gloss ("shininess") of a + * specularMaterial(). + * + * The default and minimum value is 1. + * * @method shininess - * @param {Number} shine Degree of Shininess. - * Defaults to 1. + * @param {Number} shine degree of shininess * @chainable * @example *
@@ -796,7 +869,7 @@ p5.prototype.specularMaterial = function(v1, v2, v3, alpha) { * *
* @alt - * Shininess on Camera changes position with mouse + * two spheres, one more shiny than the other */ p5.prototype.shininess = function(shine) { this._assert3d('shininess'); From 4f87899451410f80ba82138162da1d422de6e653 Mon Sep 17 00:00:00 2001 From: JetStarBlues Date: Mon, 14 Jun 2021 17:45:26 -0600 Subject: [PATCH 002/131] Improve documentation of light methods --- src/webgl/light.js | 315 ++++++++++++++++++++++++++++----------------- 1 file changed, 197 insertions(+), 118 deletions(-) diff --git a/src/webgl/light.js b/src/webgl/light.js index e16c789d16..7e08ec6a3e 100644 --- a/src/webgl/light.js +++ b/src/webgl/light.js @@ -9,27 +9,41 @@ import p5 from '../core/main'; import * as constants from '../core/constants'; /** - * Creates an ambient light with a color. Ambient light is light that comes from everywhere on the canvas. - * It has no particular source. + * Creates an ambient light with the given color. + * + * Ambient light does not come from a specific direction. + * Objects are evenly lit from all sides. Ambient lights are + * almost always used in combination with other types of lights. + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. + * * @method ambientLight - * @param {Number} v1 red or hue value relative to - * the current color range - * @param {Number} v2 green or saturation value - * relative to the current color range - * @param {Number} v3 blue or brightness value - * relative to the current color range - * @param {Number} [alpha] the alpha value + * @param {Number} v1 red or hue value relative to + * the current color range + * @param {Number} v2 green or saturation value + * relative to the current color range + * @param {Number} v3 blue or brightness value + * relative to the current color range + * @param {Number} [alpha] alpha value relative to current + * color range (default is 0-255) * @chainable * * @example *
* * createCanvas(100, 100, WEBGL); - * ambientLight(0); - * ambientMaterial(250); + * ambientLight(0); // black light (no light) + * ambientMaterial(255, 127, 80); // coral material * sphere(40); * *
+ * @alt + * sphere with coral color under black light + * + * @example *
* * function setup() { @@ -37,40 +51,40 @@ import * as constants from '../core/constants'; * } * function draw() { * background(51); - * ambientLight(100); // white light - * ambientMaterial(255, 102, 94); // magenta material + * ambientLight(255); // white light + * ambientMaterial(255, 127, 80); // coral material * box(30); * } * *
* @alt - * evenly distributed light across a sphere - * evenly distributed light across a rotating sphere + * sphere with coral color under white light */ /** * @method ambientLight - * @param {String} value a color string + * @param {Number} gray number specifying value between + * white and black + * @param {Number} [alpha] * @chainable */ /** * @method ambientLight - * @param {Number} gray a gray value - * @param {Number} [alpha] + * @param {String} value a color string * @chainable */ /** * @method ambientLight * @param {Number[]} values an array containing the red,green,blue & - * and alpha components of the color + * and alpha components of the color * @chainable */ /** * @method ambientLight - * @param {p5.Color} color the ambient light color + * @param {p5.Color} color color as a p5.Color * @chainable */ p5.prototype.ambientLight = function(v1, v2, v3, a) { @@ -90,25 +104,30 @@ p5.prototype.ambientLight = function(v1, v2, v3, a) { }; /** - * Set's the color of the specular highlight when using a specular material and - * specular light. + * Sets the color of the specular highlight of a non-ambient light + * (i.e. all lights except ambientLight()). * - * This method can be combined with specularMaterial() and shininess() - * functions to set specular highlights. The default color is white, ie - * (255, 255, 255), which is used if this method is not called before - * specularMaterial(). If this method is called without specularMaterial(), - * There will be no effect. + * specularColor() affects only the lights which are created after + * it in the code. * - * Note: specularColor is equivalent to the processing function + * This function is used in combination with + * specularMaterial(). + * If a geometry does not use specularMaterial(), this function + * will have no effect. + * + * The default color is white (255, 255, 255), which is used if + * specularColor() is not explicitly called. + * + * Note: specularColor is equivalent to the Processing function * lightSpecular. * * @method specularColor * @param {Number} v1 red or hue value relative to - * the current color range + * the current color range * @param {Number} v2 green or saturation value - * relative to the current color range + * relative to the current color range * @param {Number} v3 blue or brightness value - * relative to the current color range + * relative to the current color range * @chainable * @example *
@@ -138,26 +157,27 @@ p5.prototype.ambientLight = function(v1, v2, v3, a) { /** * @method specularColor - * @param {String} value a color string + * @param {Number} gray number specifying value between + * white and black * @chainable */ /** * @method specularColor - * @param {Number} gray a gray value + * @param {String} value color as a CSS string * @chainable */ /** * @method specularColor - * @param {Number[]} values an array containing the red,green,blue & - * and alpha components of the color + * @param {Number[]} values color as an array containing the + * red, green, and blue components * @chainable */ /** * @method specularColor - * @param {p5.Color} color the ambient light color + * @param {p5.Color} color color as a p5.Color * @chainable */ p5.prototype.specularColor = function(v1, v2, v3) { @@ -175,15 +195,32 @@ p5.prototype.specularColor = function(v1, v2, v3) { }; /** - * Creates a directional light with a color and a direction + * Creates a directional light with the given color and direction. + * + * Directional light comes from one direction. The direction is specified as numbers inclusively between -1 and 1. + * For example, setting the direction as (0, -1, 0) will cause the + * geometry to be lit from below (since the light will be facing + * directly upwards). Similarly, setting the direction as (1, 0, 0) + * will cause the geometry to be lit from the left (since the light + * will be facing directly rightwards). + * + * A maximum of **5** directional lights can be active at once. + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. * - * A maximum of 5 directionalLight can be active at one time * @method directionalLight - * @param {Number} v1 red or hue value (depending on the current - * color mode), - * @param {Number} v2 green or saturation value - * @param {Number} v3 blue or brightness value - * @param {p5.Vector} position the direction of the light + * @param {Number} v1 red or hue value relative to the current + * color range + * @param {Number} v2 green or saturation value relative to the + * current color range + * @param {Number} v3 blue or brightness value relative to the + * current color range + * @param {Number} x x component of direction (inclusive range of -1 to 1) + * @param {Number} y y component of direction (inclusive range of -1 to 1) + * @param {Number} z z component of direction (inclusive range of -1 to 1) * @chainable * @example *
@@ -204,34 +241,34 @@ p5.prototype.specularColor = function(v1, v2, v3) { *
* * @alt - * light source on canvas changeable with mouse position + * scene with sphere and directional light. The direction of + * the light is controlled with the mouse position. */ /** * @method directionalLight - * @param {Number[]|String|p5.Color} color color Array, CSS color string, - * or p5.Color value - * @param {Number} x x axis direction - * @param {Number} y y axis direction - * @param {Number} z z axis direction + * @param {Number} v1 + * @param {Number} v2 + * @param {Number} v3 + * @param {p5.Vector} direction direction of light as a + * p5.Vector * @chainable */ /** * @method directionalLight - * @param {Number[]|String|p5.Color} color - * @param {p5.Vector} position + * @param {p5.Color|Number[]|String} color color as a p5.Color, + * as an array, or as a CSS string + * @param {Number} x + * @param {Number} y + * @param {Number} z * @chainable */ /** * @method directionalLight - * @param {Number} v1 - * @param {Number} v2 - * @param {Number} v3 - * @param {Number} x - * @param {Number} y - * @param {Number} z + * @param {p5.Color|Number[]|String} color + * @param {p5.Vector} direction * @chainable */ p5.prototype.directionalLight = function(v1, v2, v3, x, y, z) { @@ -278,17 +315,27 @@ p5.prototype.directionalLight = function(v1, v2, v3, x, y, z) { }; /** - * Creates a point light with a color and a light position + * Creates a point light with the given color and position. + * + * A point light emits light from a single point in all directions. + * + * A maximum of **5** point lights can be active at once. + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. * - * A maximum of 5 pointLight can be active at one time * @method pointLight - * @param {Number} v1 red or hue value (depending on the current - * color mode), - * @param {Number} v2 green or saturation value - * @param {Number} v3 blue or brightness value - * @param {Number} x x axis position - * @param {Number} y y axis position - * @param {Number} z z axis position + * @param {Number} v1 red or hue value relative to the current + * color range + * @param {Number} v2 green or saturation value relative to the + * current color range + * @param {Number} v3 blue or brightness value relative to the + * current color range + * @param {Number} x x component of position + * @param {Number} y y component of position + * @param {Number} z z component of position * @chainable * @example *
@@ -316,22 +363,23 @@ p5.prototype.directionalLight = function(v1, v2, v3, x, y, z) { *
* * @alt - * spot light on canvas changes position with mouse + * scene with sphere and point light. The position of + * the light is controlled with the mouse position. */ /** * @method pointLight - * @param {Number} v1 - * @param {Number} v2 - * @param {Number} v3 - * @param {p5.Vector} position the position of the light + * @param {Number} v1 + * @param {Number} v2 + * @param {Number} v3 + * @param {p5.Vector} position of light as a p5.Vector * @chainable */ /** * @method pointLight - * @param {Number[]|String|p5.Color} color color Array, CSS color string, - * or p5.Color value + * @param {p5.Color|Number[]|String} color color as a p5.Color, + * as an array, or as a CSS string * @param {Number} x * @param {Number} y * @param {Number} z @@ -340,7 +388,7 @@ p5.prototype.directionalLight = function(v1, v2, v3, x, y, z) { /** * @method pointLight - * @param {Number[]|String|p5.Color} color + * @param {p5.Color|Number[]|String} color * @param {p5.Vector} position * @chainable */ @@ -385,7 +433,15 @@ p5.prototype.pointLight = function(v1, v2, v3, x, y, z) { }; /** - * Sets the default ambient and directional light. The defaults are ambientLight(128, 128, 128) and directionalLight(128, 128, 128, 0, 0, -1). Lights need to be included in the draw() to remain persistent in a looping program. Placing them in the setup() of a looping program will cause them to only have an effect the first time through the loop. + * Places an ambient and directional light in the scene. + * The lights are set to ambientLight(128, 128, 128) and + * directionalLight(128, 128, 128, 0, 0, -1). + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. + * * @method lights * @chainable * @example @@ -423,17 +479,22 @@ p5.prototype.lights = function() { }; /** - * Sets the falloff rates for point lights. It affects only the elements which are created after it in the code. - * The default value is lightFalloff(1.0, 0.0, 0.0), and the parameters are used to calculate the falloff with the following equation: + * Sets the falloff rate for pointLight() + * and spotLight(). + * + * lightFalloff() affects only the lights which are created after it + * in the code. + * + * The `constant`, `linear`, an `quadratic` parameters are used to calculate falloff as follows: * * d = distance from light position to vertex position * - * falloff = 1 / (CONSTANT + d \* LINEAR + ( d \* d ) \* QUADRATIC) + * falloff = 1 / (CONSTANT + d \* LINEAR + (d \* d) \* QUADRATIC) * * @method lightFalloff - * @param {Number} constant constant value for determining falloff - * @param {Number} linear linear value for determining falloff - * @param {Number} quadratic quadratic value for determining falloff + * @param {Number} constant CONSTANT value for determining falloff + * @param {Number} linear LINEAR value for determining falloff + * @param {Number} quadratic QUADRATIC value for determining falloff * @chainable * @example *
@@ -508,26 +569,37 @@ p5.prototype.lightFalloff = function( }; /** - * Creates a spotlight with a given color, position, direction of light, - * angle and concentration. Here, angle refers to the opening or aperture - * of the cone of the spotlight, and concentration is used to focus the - * light towards the center. Both angle and concentration are optional, but if - * you want to provide concentration, you will also have to specify the angle. + * Creates a spot light with the given color, position, + * light direction, angle, and concentration. + * + * A spot light emits light from a single point in one direction + * along a conical shape. The `angle` parameter is used to + * determine the radius of the cone. And the `concentration` + * parameter is used to focus the light towards the center of + * the cone. Both parameters are optional, however if you want + * to specify `concentration`, you must also specify `angle`. + * + * The minimum concentration value is 1. + * + * A maximum of **5** spot lights can be active at once. + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. * - * A maximum of 5 spotLight can be active at one time * @method spotLight - * @param {Number} v1 red or hue value (depending on the current - * color mode), - * @param {Number} v2 green or saturation value - * @param {Number} v3 blue or brightness value - * @param {Number} x x axis position - * @param {Number} y y axis position - * @param {Number} z z axis position - * @param {Number} rx x axis direction of light - * @param {Number} ry y axis direction of light - * @param {Number} rz z axis direction of light - * @param {Number} [angle] optional parameter for angle. Defaults to PI/3 - * @param {Number} [conc] optional parameter for concentration. Defaults to 100 + * @param {Number} v1 red or hue value relative to the current color range + * @param {Number} v2 green or saturation value relative to the current color range + * @param {Number} v3 blue or brightness value relative to the current color range + * @param {Number} x x component of position + * @param {Number} y y component of position + * @param {Number} z z component of position + * @param {Number} rx x component of light direction (inclusive range of -1 to 1) + * @param {Number} ry y component of light direction (inclusive range of -1 to 1) + * @param {Number} rz z component of light direction (inclusive range of -1 to 1) + * @param {Number} [angle] angle of cone. Defaults to PI/3 + * @param {Number} [concentration] concentration of cone. Defaults to 100 * @chainable * * @example @@ -557,16 +629,17 @@ p5.prototype.lightFalloff = function( *
* * @alt - * Spot light on a sphere which changes position with mouse + * scene with sphere and spot light. The position of + * the light is controlled with the mouse position. */ /** * @method spotLight - * @param {Number[]|String|p5.Color} color color Array, CSS color string, - * or p5.Color value - * @param {p5.Vector} position the position of the light - * @param {p5.Vector} direction the direction of the light + * @param {p5.Color|Number[]|String} color color as a p5.Color, + * as an array, or as a CSS string + * @param {p5.Vector} position position of light as a p5.Vector + * @param {p5.Vector} direction direction of light as a p5.Vector * @param {Number} [angle] - * @param {Number} [conc] + * @param {Number} [concentration] */ /** * @method spotLight @@ -576,27 +649,27 @@ p5.prototype.lightFalloff = function( * @param {p5.Vector} position * @param {p5.Vector} direction * @param {Number} [angle] - * @param {Number} [conc] + * @param {Number} [concentration] */ /** * @method spotLight - * @param {Number[]|String|p5.Color} color + * @param {p5.Color|Number[]|String} color * @param {Number} x * @param {Number} y * @param {Number} z * @param {p5.Vector} direction * @param {Number} [angle] - * @param {Number} [conc] + * @param {Number} [concentration] */ /** * @method spotLight - * @param {Number[]|String|p5.Color} color + * @param {p5.Color|Number[]|String} color * @param {p5.Vector} position * @param {Number} rx * @param {Number} ry * @param {Number} rz * @param {Number} [angle] - * @param {Number} [conc] + * @param {Number} [concentration] */ /** * @method spotLight @@ -608,7 +681,7 @@ p5.prototype.lightFalloff = function( * @param {Number} z * @param {p5.Vector} direction * @param {Number} [angle] - * @param {Number} [conc] + * @param {Number} [concentration] */ /** * @method spotLight @@ -620,11 +693,11 @@ p5.prototype.lightFalloff = function( * @param {Number} ry * @param {Number} rz * @param {Number} [angle] - * @param {Number} [conc] + * @param {Number} [concentration] */ /** * @method spotLight - * @param {Number[]|String|p5.Color} color + * @param {p5.Color|Number[]|String} color * @param {Number} x * @param {Number} y * @param {Number} z @@ -632,7 +705,7 @@ p5.prototype.lightFalloff = function( * @param {Number} ry * @param {Number} rz * @param {Number} [angle] - * @param {Number} [conc] + * @param {Number} [concentration] */ p5.prototype.spotLight = function( v1, @@ -848,10 +921,16 @@ p5.prototype.spotLight = function( }; /** - * This function will remove all the lights from the sketch for the - * subsequent materials rendered. It affects all the subsequent methods. - * Calls to lighting methods made after noLights() will re-enable lights - * in the sketch. + * Removes all lights present in a sketch. + * + * All subsequent geometry is rendered without lighting (until a new + * light is created with a call to one of the lighting functions + * (lights(), + * ambientLight(), + * directionalLight(), + * pointLight(), + * spotLight()). + * * @method noLights * @chainable * @example From 943d68e9848056a3d0e55b22fb548f541e537c52 Mon Sep 17 00:00:00 2001 From: JetStarBlues Date: Mon, 14 Jun 2021 18:38:37 -0600 Subject: [PATCH 003/131] Replaces the current `specularColor()` example with one that aims to better demonstrate the function. --- src/webgl/light.js | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/webgl/light.js b/src/webgl/light.js index e16c789d16..f1ec8a1c7b 100644 --- a/src/webgl/light.js +++ b/src/webgl/light.js @@ -113,6 +113,8 @@ p5.prototype.ambientLight = function(v1, v2, v3, a) { * @example *
* + * let setSpecularColor = true; + * * function setup() { * createCanvas(100, 100, WEBGL); * noStroke(); @@ -120,20 +122,31 @@ p5.prototype.ambientLight = function(v1, v2, v3, a) { * * function draw() { * background(0); - * shininess(20); - * ambientLight(50); - * specularColor(255, 0, 0); - * pointLight(255, 0, 0, 0, -50, 50); - * specularColor(0, 255, 0); - * pointLight(0, 255, 0, 0, 50, 50); - * specularMaterial(255); - * sphere(40); + * + * ambientLight(60); + * + * // add point light to showcase specular color + * let locX = mouseX - width / 2; + * let locY = mouseY - height / 2; + * if (setSpecularColor) { + * specularColor(255, 0, 0); // red specular highlight + * } + * pointLight(200, 200, 200, locX, locY, 50); // white light + * + * specularMaterial(150); + * shininess(50); + * sphere(30, 64, 64); + * } + * + * function mouseClicked() { + * setSpecularColor = !setSpecularColor; * } * *
* * @alt - * different specular light sources from top and bottom of canvas + * Sphere with specular highlight. Clicking the mouse toggles the + * specular highlight color between red and the default white. */ /** From 3c15d51a23b1a8af2afc77f40e5a62396977da33 Mon Sep 17 00:00:00 2001 From: JetStarBlues Date: Wed, 16 Jun 2021 14:49:05 -0600 Subject: [PATCH 004/131] Incorporate content from the "Getting started with WebGL in p5" wiki, https://github.com/processing/p5.js/wiki/Getting-started-with-WebGL-in-p5 --- src/webgl/light.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/webgl/light.js b/src/webgl/light.js index 7e08ec6a3e..fe2495ece7 100644 --- a/src/webgl/light.js +++ b/src/webgl/light.js @@ -197,13 +197,17 @@ p5.prototype.specularColor = function(v1, v2, v3) { /** * Creates a directional light with the given color and direction. * - * Directional light comes from one direction. The direction is specified as numbers inclusively between -1 and 1. + * Directional light comes from one direction. + * The direction is specified as numbers inclusively between -1 and 1. * For example, setting the direction as (0, -1, 0) will cause the * geometry to be lit from below (since the light will be facing * directly upwards). Similarly, setting the direction as (1, 0, 0) * will cause the geometry to be lit from the left (since the light * will be facing directly rightwards). * + * Directional lights do not have a specific point of origin, and + * therefore cannot be positioned closer or farther away from a geometry. + * * A maximum of **5** directional lights can be active at once. * * Note: lights need to be called (whether directly or indirectly) @@ -318,6 +322,9 @@ p5.prototype.directionalLight = function(v1, v2, v3, x, y, z) { * Creates a point light with the given color and position. * * A point light emits light from a single point in all directions. + * Because the light is emitted from a specific point (position), + * it has a different effect when it is positioned farther vs. nearer + * an object. * * A maximum of **5** point lights can be active at once. * @@ -572,13 +579,19 @@ p5.prototype.lightFalloff = function( * Creates a spot light with the given color, position, * light direction, angle, and concentration. * - * A spot light emits light from a single point in one direction - * along a conical shape. The `angle` parameter is used to + * Like a pointLight(), a spotLight() + * emits light from a specific point (position). It has a different effect + * when it is positioned farther vs. nearer an object. + * + * However, unlike a pointLight(), the light is emitted in **one direction** + * along a conical shape. The shape of the cone can be controlled using + * the `angle` and `concentration` parameters. + * + * The `angle` parameter is used to * determine the radius of the cone. And the `concentration` * parameter is used to focus the light towards the center of * the cone. Both parameters are optional, however if you want * to specify `concentration`, you must also specify `angle`. - * * The minimum concentration value is 1. * * A maximum of **5** spot lights can be active at once. From b1b9baee4ab4ffd1d3e73376022f95ce5b6c44a0 Mon Sep 17 00:00:00 2001 From: Jonas Rinke Date: Thu, 15 Jul 2021 11:02:33 +0200 Subject: [PATCH 005/131] Fixed bug were cached colors are not cleared + added unit tests --- src/color/p5.Color.js | 4 +++ test/unit/color/setting.js | 72 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/src/color/p5.Color.js b/src/color/p5.Color.js index 6eda86a0c1..b276bb8e8f 100644 --- a/src/color/p5.Color.js +++ b/src/color/p5.Color.js @@ -365,6 +365,10 @@ p5.Color.prototype._calculateLevels = function() { for (let i = array.length - 1; i >= 0; --i) { levels[i] = Math.round(array[i] * 255); } + + // Clear cached HSL/HSB values + this.hsla = null; + this.hsba = null; }; p5.Color.prototype._getAlpha = function() { diff --git a/test/unit/color/setting.js b/test/unit/color/setting.js index d092831ac2..d72ce2bd74 100644 --- a/test/unit/color/setting.js +++ b/test/unit/color/setting.js @@ -214,4 +214,76 @@ suite('color/Setting', function() { assert.deepEqual(myp5._colorMaxes[myp5.HSB], [360, 100, 100, 1]); }); }); + + suite('p5.Color components', function() { + test('setRed() correctly sets red component', function() { + myp5.colorMode(myp5.RGB, 255); + const c = myp5.color(0, 162, 205, 255); + c.setRed(100); + assert.equal(myp5.red(c), 100); + assert.equal(myp5.green(c), 162); + assert.equal(myp5.blue(c), 205); + assert.equal(myp5.alpha(c), 255); + }); + + test('setGreen() correctly sets green component', function() { + myp5.colorMode(myp5.RGB, 255); + const c = myp5.color(0, 162, 205, 255); + c.setGreen(100); + assert.equal(myp5.red(c), 0); + assert.equal(myp5.green(c), 100); + assert.equal(myp5.blue(c), 205); + assert.equal(myp5.alpha(c), 255); + }); + + test('setBlue() correctly sets blue component', function() { + myp5.colorMode(myp5.RGB, 255); + const c = myp5.color(0, 162, 205, 255); + c.setBlue(100); + assert.equal(myp5.red(c), 0); + assert.equal(myp5.green(c), 162); + assert.equal(myp5.blue(c), 100); + assert.equal(myp5.alpha(c), 255); + }); + + test('setAlpha correctly sets alpha component', function() { + myp5.colorMode(myp5.RGB, 255); + const c = myp5.color(0, 162, 205, 255); + c.setAlpha(100); + assert.equal(myp5.red(c), 0); + assert.equal(myp5.green(c), 162); + assert.equal(myp5.blue(c), 205); + assert.equal(myp5.alpha(c), 100); + }); + + test('changing the red/green/blue/alpha components should clear the cached HSL/HSB values', function() { + myp5.colorMode(myp5.RGB, 255); + const c = myp5.color(0, 162, 205, 255); + + // create HSL/HSB values + myp5.lightness(c); + myp5.brightness(c); + c.setRed(100); + assert(!c.hsba); + assert(!c.hsla); + + myp5.lightness(c); + myp5.brightness(c); + c.setGreen(100); + assert(!c.hsba); + assert(!c.hsla); + + myp5.lightness(c); + myp5.brightness(c); + c.setBlue(100); + assert(!c.hsba); + assert(!c.hsla); + + myp5.lightness(c); + myp5.brightness(c); + c.setAlpha(100); + assert(!c.hsba); + assert(!c.hsla); + }); + }); }); From f08bf2c6838fe5839ef7f28c03702c8ca9166acb Mon Sep 17 00:00:00 2001 From: JetStarBlues Date: Sun, 17 Oct 2021 14:51:30 -0600 Subject: [PATCH 006/131] Improve documentation of material functions. Update PR #5310 to use "set current material as" instead of "create" --- src/webgl/material.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/webgl/material.js b/src/webgl/material.js index fd960cd3c1..23bfaa0f93 100644 --- a/src/webgl/material.js +++ b/src/webgl/material.js @@ -584,7 +584,7 @@ p5.prototype.textureWrap = function(wrapX, wrapY = wrapX) { }; /** - * Creates a normal material. + * Sets the current material as a normal material. * * A normal material is not affected by light. It is often used as * a placeholder material when debugging. @@ -628,7 +628,7 @@ p5.prototype.normalMaterial = function(...args) { }; /** - * Creates an ambient material with the given color. + * Sets the current material as an ambient material of the given color. * * The ambientMaterial() color is the color the object will reflect * under **any** lighting. @@ -740,7 +740,8 @@ p5.prototype.ambientMaterial = function(v1, v2, v3) { }; /** - * Creates an emissive material with the given color. + * Sets the current material as an emissive material of + * the given color. * * An emissive material will display the emissive color at * full strength regardless of lighting. This can give the @@ -812,7 +813,7 @@ p5.prototype.emissiveMaterial = function(v1, v2, v3, a) { }; /** - * Creates a specular material with the given color. + * Sets the current material as a specular material of the given color. * * A specular material is reflective (shiny). The shininess can be * controlled by the shininess() function. From a2e8dfa08bec7e7a8df16630a3cab9ea6fe92317 Mon Sep 17 00:00:00 2001 From: JetStarBlues Date: Sun, 17 Oct 2021 17:18:13 -0600 Subject: [PATCH 007/131] Improve clarity of `specularColor()` example --- src/webgl/light.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/webgl/light.js b/src/webgl/light.js index daf2829642..e8a067c9bf 100644 --- a/src/webgl/light.js +++ b/src/webgl/light.js @@ -113,7 +113,7 @@ p5.prototype.ambientLight = function(v1, v2, v3, a) { * @example *
* - * let setSpecularColor = true; + * let setRedSpecularColor = true; * * function setup() { * createCanvas(100, 100, WEBGL); @@ -125,21 +125,26 @@ p5.prototype.ambientLight = function(v1, v2, v3, a) { * * ambientLight(60); * - * // add point light to showcase specular color - * let locX = mouseX - width / 2; - * let locY = mouseY - height / 2; - * if (setSpecularColor) { + * // add a point light to showcase specular color + * // -- use mouse location to position the light + * let lightPosX = mouseX - width / 2; + * let lightPosY = mouseY - height / 2; + * // -- set the light's specular color + * if (setRedSpecularColor) { * specularColor(255, 0, 0); // red specular highlight * } - * pointLight(200, 200, 200, locX, locY, 50); // white light + * // -- create the light + * pointLight(200, 200, 200, lightPosX, lightPosY, 50); // white light * + * // use specular material with high shininess * specularMaterial(150); * shininess(50); + * * sphere(30, 64, 64); * } * * function mouseClicked() { - * setSpecularColor = !setSpecularColor; + * setRedSpecularColor = !setRedSpecularColor; * } * *
From 93d6a634765ff49e9c15287cc50d3f062b9264e2 Mon Sep 17 00:00:00 2001 From: Dave Pagurek Date: Mon, 6 Dec 2021 15:46:59 -0500 Subject: [PATCH 008/131] Reference Catmull-Rom in the docs for curvePoint --- src/core/shape/curves.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/shape/curves.js b/src/core/shape/curves.js index 8da1ae1569..0be0ab688c 100644 --- a/src/core/shape/curves.js +++ b/src/core/shape/curves.js @@ -454,7 +454,7 @@ p5.prototype.curveTightness = function(t) { * @param {Number} c coordinate of second point * @param {Number} d coordinate of second control point * @param {Number} t value between 0 and 1 - * @return {Number} bezier value at position t + * @return {Number} Catmull-Rom value at position t * @example *
* From 1eab03f8d2d317b660485d7119c54f38f77d84ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 15 Jan 2022 01:07:31 +0000 Subject: [PATCH 009/131] Bump marked from 0.7.0 to 4.0.10 Bumps [marked](https://github.com/markedjs/marked) from 0.7.0 to 4.0.10. - [Release notes](https://github.com/markedjs/marked/releases) - [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json) - [Commits](https://github.com/markedjs/marked/compare/v0.7.0...v4.0.10) --- updated-dependencies: - dependency-name: marked dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6757208238..ec5b4d20d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9639,9 +9639,9 @@ } }, "marked": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", - "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==", + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.10.tgz", + "integrity": "sha512-+QvuFj0nGgO970fySghXGmuw+Fd0gD2x3+MqCWLIPf5oxdv1Ka6b2q+z9RP01P/IaKPMEramy+7cNy/Lw8c3hw==", "dev": true }, "maxmin": { diff --git a/package.json b/package.json index fa2af86256..47b1a9d24d 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "i18next-browser-languagedetector": "^4.0.1", "libtess": "^1.2.2", "lint-staged": "^4.3.0", - "marked": "^0.7.0", + "marked": "^4.0.10", "mocha": "^6.2.2", "np": "^5.2.1", "omggif": "^1.0.10", From bdc10b2b5af2ef87dada086371da9a64f358b206 Mon Sep 17 00:00:00 2001 From: Nick McIntyre Date: Sat, 15 Jan 2022 12:26:31 -0600 Subject: [PATCH 010/131] Assorted edits to inline docs --- src/color/p5.Color.js | 14 +++--- src/color/setting.js | 4 +- src/core/constants.js | 8 ++-- src/core/environment.js | 6 +-- src/core/p5.Element.js | 64 ++++++++++++++-------------- src/core/rendering.js | 8 ++-- src/core/shape/2d_primitives.js | 25 +++++------ src/core/shape/attributes.js | 2 +- src/core/shape/vertex.js | 10 ++--- src/core/structure.js | 4 +- src/core/transform.js | 6 +-- src/dom/dom.js | 50 +++++++++++----------- src/events/keyboard.js | 4 +- src/events/mouse.js | 10 ++--- src/math/calculation.js | 6 +-- src/math/math.js | 2 +- src/math/noise.js | 28 ++++++------ src/math/p5.Vector.js | 48 ++++++++++----------- src/math/random.js | 6 +-- src/math/trigonometry.js | 15 ++++--- src/typography/attributes.js | 2 +- src/typography/loading_displaying.js | 6 +-- 22 files changed, 166 insertions(+), 162 deletions(-) diff --git a/src/color/p5.Color.js b/src/color/p5.Color.js index 6eda86a0c1..e5eaa3056a 100644 --- a/src/color/p5.Color.js +++ b/src/color/p5.Color.js @@ -12,7 +12,7 @@ import * as constants from '../core/constants'; import color_conversion from './color_conversion'; /** - * Each color stores the color mode and level maxes that was applied at the + * Each color stores the color mode and level maxes that were applied at the * time of its construction. These are used to interpret the input arguments * (at construction and later for that instance of color) and to format the * output e.g. when saturation() is requested. @@ -21,7 +21,7 @@ import color_conversion from './color_conversion'; * point form, normalized from 0 to 1. From this we calculate the closest * screen color (RGBA levels from 0 to 255) and expose this to the renderer. * - * We also cache normalized, floating point components of the color in various + * We also cache normalized, floating-point components of the color in various * representations as they are calculated. This is done to prevent repeating a * conversion that has already been performed. * @@ -49,7 +49,7 @@ p5.Color = function(pInst, vals) { }; /** - * This function returns the color formatted as a string. This can be useful + * This method returns the color formatted as a string. This can be useful * for debugging, or for using p5.js with other libraries. * * @method toString @@ -254,7 +254,7 @@ p5.Color.prototype.toString = function(format) { }; /** - * The setRed function sets the red component of a color. + * The setRed method sets the red component of a color. * The range depends on your color mode, in the default RGB mode it's between 0 and 255. * @method setRed * @param {Number} red the new red value @@ -283,7 +283,7 @@ p5.Color.prototype.setRed = function(new_red) { }; /** - * The setGreen function sets the green component of a color. + * The setGreen method sets the green component of a color. * The range depends on your color mode, in the default RGB mode it's between 0 and 255. * @method setGreen * @param {Number} green the new green value @@ -307,7 +307,7 @@ p5.Color.prototype.setGreen = function(new_green) { }; /** - * The setBlue function sets the blue component of a color. + * The setBlue method sets the blue component of a color. * The range depends on your color mode, in the default RGB mode it's between 0 and 255. * @method setBlue * @param {Number} blue the new blue value @@ -331,7 +331,7 @@ p5.Color.prototype.setBlue = function(new_blue) { }; /** - * The setAlpha function sets the transparency (alpha) value of a color. + * The setAlpha method sets the transparency (alpha) value of a color. * The range depends on your color mode, in the default RGB mode it's between 0 and 255. * @method setAlpha * @param {Number} alpha the new alpha value diff --git a/src/color/setting.js b/src/color/setting.js index 604df5f897..5e9f95932f 100644 --- a/src/color/setting.js +++ b/src/color/setting.js @@ -356,7 +356,7 @@ p5.prototype.colorMode = function(mode, max1, max2, max3, maxA) { * and all named color strings are supported. In this case, an alpha number * value as a second argument is not supported, the RGBA form should be used. * - * A p5 Color object can also be provided to set the fill color. + * A p5.Color object can also be provided to set the fill color. * * @method fill * @param {Number} v1 red or hue value relative to @@ -596,7 +596,7 @@ p5.prototype.noStroke = function() { * number value as a second argument is not supported, the RGBA form should be * used. * - * A p5 Color object can also be provided to set the stroke color. + * A p5.Color object can also be provided to set the stroke color. * * @method stroke * @param {Number} v1 red or hue value relative to diff --git a/src/core/constants.js b/src/core/constants.js index a872802c78..49d4f48342 100644 --- a/src/core/constants.js +++ b/src/core/constants.js @@ -154,8 +154,8 @@ export const TAU = _PI * 2; */ export const TWO_PI = _PI * 2; /** - * Constant to be used with angleMode() function, to set the mode which - * p5.js interprets and calculates angles (either DEGREES or RADIANS). + * Constant to be used with the angleMode() function, to set the mode in + * which p5.js interprets and calculates angles (either DEGREES or RADIANS). * @property {String} DEGREES * @final * @@ -168,8 +168,8 @@ export const TWO_PI = _PI * 2; */ export const DEGREES = 'degrees'; /** - * Constant to be used with angleMode() function, to set the mode which - * p5.js interprets and calculates angles (either RADIANS or DEGREES). + * Constant to be used with the angleMode() function, to set the mode + * in which p5.js interprets and calculates angles (either RADIANS or DEGREES). * @property {String} RADIANS * @final * diff --git a/src/core/environment.js b/src/core/environment.js index 0268fa24f3..98c9140dde 100644 --- a/src/core/environment.js +++ b/src/core/environment.js @@ -53,7 +53,7 @@ p5.prototype.print = function(...args) { * The system variable frameCount contains the * number of frames that have been displayed since the program started. Inside * setup() the value is 0, after the first iteration - * of draw it is 1, etc. + * of draw() it is 1, etc. * * @property {Integer} frameCount * @readOnly @@ -241,7 +241,7 @@ p5.prototype.cursor = function(type, x, y) { * return a value. This is the same as getFrameRate(). * * Calling frameRate() with arguments that are not - * of the type numbers or are non positive also returns current framerate. + * of the type Number or are non-positive also returns current framerate. * * @method frameRate * @param {Number} fps number of frames to be displayed every second @@ -262,7 +262,7 @@ p5.prototype.cursor = function(type, x, y) { * * function draw() { * background(200); - * rectX = rectX += 1; // Move Rectangle + * rectX += 1; // Move Rectangle * * if (rectX >= width) { // If you go off screen. diff --git a/src/core/p5.Element.js b/src/core/p5.Element.js index 92432e1a39..a6cf66975d 100644 --- a/src/core/p5.Element.js +++ b/src/core/p5.Element.js @@ -9,8 +9,8 @@ import p5 from './main'; /** * Base class for all elements added to a sketch, including canvas, * graphics buffers, and other HTML elements. It is not called directly, but p5.Element - * objects are created by calling createCanvas, createGraphics, - * createDiv, createImg, createInput, etc. + * objects are created by calling createCanvas(), createGraphics(), + * createDiv(), createImg(), createInput(), etc. * * @class p5.Element * @constructor @@ -48,7 +48,7 @@ p5.Element = function(elt, pInst) { * * Attaches the element to the parent specified. A way of setting * the container for the element. Accepts either a string ID, DOM - * node, or p5.Element. If no arguments given, parent node is returned. + * node, or p5.Element. If no arguments are given, parent node is returned. * For more ways to position the canvas, see the * * positioning the canvas wiki page. @@ -116,7 +116,7 @@ p5.Element.prototype.parent = function(p) { * Sets the ID of the element. If no ID argument is passed in, it instead * returns the current ID of the element. * Note that only one element can have a particular id in a page. - * The .class() function can be used + * The class() method can be used * to identify multiple elements with the same class name. * * @method id @@ -187,10 +187,10 @@ p5.Element.prototype.class = function(c) { }; /** - * The .mousePressed() function is called + * The mousePressed() method is called * once after every time a mouse button is pressed over the element. Some mobile * browsers may also trigger this event on a touch screen, if the user performs - * a quick tap. This can be used to attach element specific event listeners. + * a quick tap. This can be used to attach element-specific event listeners. * * @method mousePressed * @param {Function|Boolean} fxn function to be fired when mouse is @@ -244,9 +244,9 @@ p5.Element.prototype.mousePressed = function(fxn) { }; /** - * The .doubleClicked() function is called once after every time a + * The doubleClicked() method is called once after every time a * mouse button is pressed twice over the element. This can be used to - * attach element and action specific event listeners. + * attach element and action-specific event listeners. * * @method doubleClicked * @param {Function|Boolean} fxn function to be fired when mouse is @@ -290,18 +290,18 @@ p5.Element.prototype.doubleClicked = function(fxn) { }; /** - * The mouseWheel() function is called + * The mouseWheel() method is called * once after every time a mouse wheel is scrolled over the element. This can - * be used to attach element specific event listeners. + * be used to attach element-specific event listeners. * - * The function accepts a callback function as argument which will be executed + * The method accepts a callback function as argument which will be executed * when the `wheel` event is triggered on the element, the callback function is * passed one argument `event`. The `event.deltaY` property returns negative * values if the mouse wheel is rotated up or away from the user and positive * in the other direction. The `event.deltaX` does the same as `event.deltaY` * except it reads the horizontal wheel scroll of the mouse wheel. * - * On OS X with "natural" scrolling enabled, the `event.deltaY` values are + * On macOS with "natural" scrolling enabled, the `event.deltaY` values are * reversed. * * @method mouseWheel @@ -352,10 +352,10 @@ p5.Element.prototype.mouseWheel = function(fxn) { }; /** - * The mouseReleased() function is + * The mouseReleased() method is * called once after every time a mouse button is released over the element. * Some mobile browsers may also trigger this event on a touch screen, if the - * user performs a quick tap. This can be used to attach element specific event listeners. + * user performs a quick tap. This can be used to attach element-specific event listeners. * * @method mouseReleased * @param {Function|Boolean} fxn function to be fired when mouse is @@ -401,10 +401,10 @@ p5.Element.prototype.mouseReleased = function(fxn) { }; /** - * The .mouseClicked() function is + * The mouseClicked() method is * called once after a mouse button is pressed and released over the element. * Some mobile browsers may also trigger this event on a touch screen, if the - * user performs a quick tap.This can be used to attach element specific event listeners. + * user performs a quick tap. This can be used to attach element-specific event listeners. * * @method mouseClicked * @param {Function|Boolean} fxn function to be fired when mouse is @@ -452,9 +452,9 @@ p5.Element.prototype.mouseClicked = function(fxn) { }; /** - * The .mouseMoved() function is called once every time a + * The mouseMoved() method is called once every time a * mouse moves over the element. This can be used to attach an - * element specific event listener. + * element-specific event listener. * * @method mouseMoved * @param {Function|Boolean} fxn function to be fired when a mouse moves @@ -508,9 +508,9 @@ p5.Element.prototype.mouseMoved = function(fxn) { }; /** - * The .mouseOver() function is called once after every time a + * The mouseOver() method is called once after every time a * mouse moves onto the element. This can be used to attach an - * element specific event listener. + * element-specific event listener. * * @method mouseOver * @param {Function|Boolean} fxn function to be fired when a mouse moves @@ -549,9 +549,9 @@ p5.Element.prototype.mouseOver = function(fxn) { }; /** - * The .mouseOut() function is called once after every time a + * The mouseOut() method is called once after every time a * mouse moves off the element. This can be used to attach an - * element specific event listener. + * element-specific event listener. * * @method mouseOut * @param {Function|Boolean} fxn function to be fired when a mouse @@ -590,8 +590,8 @@ p5.Element.prototype.mouseOut = function(fxn) { }; /** - * The .touchStarted() function is called once after every time a touch is - * registered. This can be used to attach element specific event listeners. + * The touchStarted() method is called once after every time a touch is + * registered. This can be used to attach element-specific event listeners. * * @method touchStarted * @param {Function|Boolean} fxn function to be fired when a touch @@ -637,8 +637,8 @@ p5.Element.prototype.touchStarted = function(fxn) { }; /** - * The .touchMoved() function is called once after every time a touch move is - * registered. This can be used to attach element specific event listeners. + * The touchMoved() method is called once after every time a touch move is + * registered. This can be used to attach element-specific event listeners. * * @method touchMoved * @param {Function|Boolean} fxn function to be fired when a touch moves over @@ -676,8 +676,8 @@ p5.Element.prototype.touchMoved = function(fxn) { }; /** - * The .touchEnded() function is called once after every time a touch is - * registered. This can be used to attach element specific event listeners. + * The touchEnded() method is called once after every time a touch is + * registered. This can be used to attach element-specific event listeners. * * @method touchEnded * @param {Function|Boolean} fxn function to be fired when a touch ends @@ -723,9 +723,9 @@ p5.Element.prototype.touchEnded = function(fxn) { }; /** - * The .dragOver() function is called once after every time a + * The dragOver() method is called once after every time a * file is dragged over the element. This can be used to attach an - * element specific event listener. + * element-specific event listener. * * @method dragOver * @param {Function|Boolean} fxn function to be fired when a file is @@ -761,9 +761,9 @@ p5.Element.prototype.dragOver = function(fxn) { }; /** - * The .dragLeave() function is called once after every time a + * The dragLeave() method is called once after every time a * dragged file leaves the element area. This can be used to attach an - * element specific event listener. + * element-specific event listener. * * @method dragLeave * @param {Function|Boolean} fxn function to be fired when a file is diff --git a/src/core/rendering.js b/src/core/rendering.js index 771b55d5d1..c2526ad726 100644 --- a/src/core/rendering.js +++ b/src/core/rendering.js @@ -13,11 +13,11 @@ let defaultId = 'defaultCanvas0'; // this gets set again in createCanvas const defaultClass = 'p5Canvas'; /** - * Creates a canvas element in the document, and sets the dimensions of it - * in pixels. This method should be called only once at the start of setup. + * Creates a canvas element in the document and sets its dimensions + * in pixels. This method should be called only once at the start of setup(). * Calling createCanvas more than once in a * sketch will result in very unpredictable behavior. If you want more than - * one drawing canvas you could use createGraphics + * one drawing canvas you could use createGraphics() * (hidden by default but it can be shown). * * Important note: in 2D mode (i.e. when `p5.Renderer` is not set) the origin (0,0) @@ -37,7 +37,7 @@ const defaultClass = 'p5Canvas'; * @param {Number} w width of the canvas * @param {Number} h height of the canvas * @param {Constant} [renderer] either P2D or WEBGL - * @return {p5.Renderer} + * @return {p5.Renderer} pointer to p5.Renderer holding canvas * @example *
* diff --git a/src/core/shape/2d_primitives.js b/src/core/shape/2d_primitives.js index 68b9a1e9ef..cfa6c24526 100644 --- a/src/core/shape/2d_primitives.js +++ b/src/core/shape/2d_primitives.js @@ -240,8 +240,8 @@ p5.prototype.arc = function(x, y, w, h, start, stop, mode, detail) { * with the ellipseMode() function. * * @method ellipse - * @param {Number} x x-coordinate of the center of ellipse. - * @param {Number} y y-coordinate of the center of ellipse. + * @param {Number} x x-coordinate of the center of the ellipse. + * @param {Number} y y-coordinate of the center of the ellipse. * @param {Number} w width of the ellipse. * @param {Number} [h] height of the ellipse. * @chainable @@ -262,7 +262,7 @@ p5.prototype.arc = function(x, y, w, h, start, stop, mode, detail) { * @param {Number} y * @param {Number} w * @param {Number} h - * @param {Integer} [detail] optional parameter for WebGL mode only. This is to + * @param {Integer} [detail] optional parameter for WEBGL mode only. This is to * specify the number of vertices that makes up the * perimeter of the ellipse. Default value is 25. Won't * draw a stroke for a detail of more than 50. @@ -275,15 +275,16 @@ p5.prototype.ellipse = function(x, y, w, h, detailX) { /** * Draws a circle to the screen. A circle is a simple closed shape. It is the set * of all points in a plane that are at a given distance from a given point, - * the centre. This function is a special case of the ellipse() function, where - * the width and height of the ellipse are the same. Height and width of the - * ellipse correspond to the diameter of the circle. By default, the first two - * parameters set the location of the centre of the circle, the third sets the - * diameter of the circle. + * the center. This function is a special case of the + * ellipse() function, where the width and height + * of the ellipse are the same. Height and width of the ellipse correspond to + * the diameter of the circle. By default, the first two parameters set the + * location of the center of the circle, the third sets the diameter of the + * circle. * * @method circle - * @param {Number} x x-coordinate of the centre of the circle. - * @param {Number} y y-coordinate of the centre of the circle. + * @param {Number} x x-coordinate of the center of the circle. + * @param {Number} y y-coordinate of the center of the circle. * @param {Number} d diameter of the circle. * @chainable * @example @@ -476,7 +477,7 @@ p5.prototype.point = function(...args) { }; /** - * Draws a quad on the canvas. A quad is a quadrilateral, a four sided polygon. It is + * Draws a quad on the canvas. A quad is a quadrilateral, a four-sided polygon. It is * similar to a rectangle, but the angles between its edges are not * constrained to ninety degrees. The first pair of parameters (x1,y1) * sets the first vertex and the subsequent pairs should proceed @@ -553,7 +554,7 @@ p5.prototype.quad = function(...args) { * Draws a rectangle on the canvas. A rectangle is a four-sided closed shape with * every angle at ninety degrees. By default, the first two parameters set * the location of the upper-left corner, the third sets the width, and the - * fourth sets the height. The way these parameters are interpreted, may be + * fourth sets the height. The way these parameters are interpreted may be * changed with the rectMode() function. * * The fifth, sixth, seventh and eighth parameters, if specified, diff --git a/src/core/shape/attributes.js b/src/core/shape/attributes.js index e65352d500..bf23b9c58e 100644 --- a/src/core/shape/attributes.js +++ b/src/core/shape/attributes.js @@ -123,7 +123,7 @@ p5.prototype.noSmooth = function() { * rectMode(CORNERS) interprets the first two parameters as the location of * one of the corners, and the third and fourth parameters as the location of * the diagonally opposite corner. Note, the rectangle is drawn between the - * coordinates, so it is not neccesary that the first corner be the upper left + * coordinates, so it is not necessary that the first corner be the upper left * corner. * * rectMode(CENTER) interprets the first two parameters as the shape's center diff --git a/src/core/shape/vertex.js b/src/core/shape/vertex.js index cd3484f3b4..2afb78f880 100644 --- a/src/core/shape/vertex.js +++ b/src/core/shape/vertex.js @@ -89,12 +89,12 @@ p5.prototype.beginContour = function() { * Draw a series of connected triangles in strip fashion * * QUADS - * Draw a series of separate quad + * Draw a series of separate quads * * QUAD_STRIP * Draw quad strip using adjacent edges to form the next quad * - * TESS (WebGl only) + * TESS (WEBGL only) * Handle irregular polygon for filling curve by explicit tessellation * * After calling the beginShape() function, a series of vertex() commands must follow. To stop @@ -582,9 +582,9 @@ p5.prototype.endContour = function() { /** * The endShape() function is the companion to beginShape() and may only be - * called after beginShape(). When endShape() is called, all of image data - * defined since the previous call to beginShape() is written into the image - * buffer. The constant CLOSE as the value for the MODE parameter to close + * called after beginShape(). When endShape() is called, all of the image + * data defined since the previous call to beginShape() is written into the image + * buffer. The constant CLOSE as the value for the `mode` parameter to close * the shape (to connect the beginning and the end). * * @method endShape diff --git a/src/core/structure.js b/src/core/structure.js index b01dc9e94e..d64afaeb92 100644 --- a/src/core/structure.js +++ b/src/core/structure.js @@ -28,7 +28,7 @@ import p5 from './main'; * has been specified. Otherwise, the sketch would enter an odd state until * loop() was called. * - * Use isLooping() to check current state of loop(). + * Use isLooping() to check the current state of loop(). * * @method noLoop * @example @@ -88,7 +88,7 @@ p5.prototype.noLoop = function() { * * Avoid calling loop() from inside setup(). * - * Use isLooping() to check current state of loop(). + * Use isLooping() to check the current state of loop(). * * @method loop * @example diff --git a/src/core/transform.js b/src/core/transform.js index 1fe637e5d9..f92b253b87 100644 --- a/src/core/transform.js +++ b/src/core/transform.js @@ -198,13 +198,13 @@ p5.prototype.resetMatrix = function() { * Objects are always rotated around their relative position to the * origin and positive numbers rotate objects in a clockwise direction. * Transformations apply to everything that happens after and subsequent - * calls to the function accumulates the effect. For example, calling + * calls to the function accumulate the effect. For example, calling * rotate(HALF_PI) and then rotate(HALF_PI) is the same as rotate(PI). * All transformations are reset when draw() begins again. * * Technically, rotate() multiplies the current transformation matrix * by a rotation matrix. This function can be further controlled by - * the push() and pop(). + * push() and pop(). * * @method rotate * @param {Number} angle the angle of rotation, specified in radians @@ -506,7 +506,7 @@ p5.prototype.shearY = function(angle) { * @method translate * @param {Number} x left/right translation * @param {Number} y up/down translation - * @param {Number} [z] forward/backward translation (webgl only) + * @param {Number} [z] forward/backward translation (WEBGL only) * @chainable * @example *
diff --git a/src/dom/dom.js b/src/dom/dom.js index a845db2203..01e0d5b2e8 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -458,7 +458,7 @@ p5.prototype.createA = function(href, html, target) { * @param {Number} max maximum value of the slider * @param {Number} [value] default value of the slider * @param {Number} [step] step size for each tick of the slider (if step is set to 0, the slider will move continuously from the minimum to the maximum value) - * @return {p5.Element} pointer to p5.Element holding created node + * @return {p5.Element} pointer to p5.Element holding the created node * @example *
* let slider; @@ -540,7 +540,8 @@ p5.prototype.createButton = function(label, value) { /** * Creates a checkbox `<input></input>` element in the DOM. - * Calling .checked() on a checkbox returns if it is checked or not + * Calling .checked() on a checkbox returns a boolean indicating whether + * it is checked or not. * * @method createCheckbox * @param {String} [label] label displayed after checkbox @@ -624,14 +625,14 @@ p5.prototype.createCheckbox = function() { * It also helps to assign select-box methods to p5.Element when selecting existing select box. * - `.option(name, [value])` can be used to set options for the select after it is created. * - `.value()` will return the currently selected option. - * - `.selected()` will return current dropdown element which is an instance of p5.Element + * - `.selected()` will return the current dropdown element which is an instance of p5.Element. * - `.selected(value)` can be used to make given option selected by default when the page first loads. - * - `.disable()` marks whole of dropdown element as disabled. - * - `.disable(value)` marks given option as disabled + * - `.disable()` marks the whole dropdown element as disabled. + * - `.disable(value)` marks a given option as disabled. * * @method createSelect * @param {boolean} [multiple] true if dropdown should support multiple selections - * @return {p5.Element} + * @return {p5.Element} pointer to p5.Element holding created node * @example *
* let sel; @@ -768,7 +769,7 @@ p5.prototype.createSelect = function() { }; /** - * Creates a radio button element in the DOM.It also helps existing radio buttons + * Creates a radio button element in the DOM. It also helps existing radio buttons * assign methods of p5.Element. * - `.option(value, [label])` can be used to create a new option for the * element. If an option with a value already exists, it will be returned. @@ -780,8 +781,8 @@ p5.prototype.createSelect = function() { * - `.disable(Boolean)` method will enable/disable the whole radio button element. * * @method createRadio - * @param {Object} containerElement An container HTML Element either a div - * or span inside which all existing radio inputs will be considered as options. + * @param {Object} containerElement A container HTML Element, either a div + * or span, inside which all existing radio inputs will be considered as options. * @param {string} [name] A name parameter for each Input Element. * @return {p5.Element} pointer to p5.Element holding created node * @example @@ -974,7 +975,8 @@ p5.prototype.createRadio = function() { /** * Creates a colorPicker element in the DOM for color input. * The .value() method will return a hex string (#rrggbb) of the color. - * The .color() method will return a p5.Color object with the current chosen color. + * The .color() method will return a p5.Color + * object with the current chosen color. * * @method createColorPicker * @param {String|p5.Color} [value] default color of element @@ -1555,7 +1557,7 @@ p5.Element.prototype.removeClass = function(c) { /** * - * Checks if specified class already set to element + * Checks if specified class is already applied to element. * * @method hasClass * @returns {boolean} a boolean value if element has specified class @@ -1584,7 +1586,7 @@ p5.Element.prototype.hasClass = function(c) { /** * - * Toggles element class + * Toggles element class. * * @method toggleClass * @param c {String} class name to toggle @@ -1669,10 +1671,10 @@ p5.Element.prototype.child = function(childNode) { }; /** - * Centers a p5 Element either vertically, horizontally, + * Centers a p5.Element either vertically, horizontally, * or both, relative to its parent or according to - * the body if the Element has no parent. If no argument is passed - * the Element is aligned both vertically and horizontally. + * the body if the p5.Element has no parent. If no argument is passed + * the p5.Element is aligned both vertically and horizontally. * * @method center * @param {String} [align] passing 'vertical', 'horizontal' aligns element accordingly @@ -1722,8 +1724,8 @@ p5.Element.prototype.center = function(align) { /** * * If an argument is given, sets the inner HTML of the element, - * replacing any existing html. If true is included as a second - * argument, html is appended instead of replacing existing html. + * replacing any existing HTML. If true is included as a second + * argument, HTML is appended instead of replacing existing HTML. * If no arguments are given, returns * the inner HTML of the element. * @@ -1764,7 +1766,7 @@ p5.Element.prototype.html = function() { * position will be relative to (0, 0) of the window. * Essentially, this sets position:absolute and left and top * properties of style. If an optional third argument specifying position type is given, - * the x and y coordinates will be interpreted based on the positioning scheme. * If no arguments given, the function returns the x and y position of the element. * @@ -1879,10 +1881,10 @@ p5.Element.prototype._rotate = function() { }; /** - * Sets the given style (css) property (1st arg) of the element with the + * Sets the given style (CSS) property (1st arg) of the element with the * given value (2nd arg). If a single argument is given, .style() - * returns the value of the given property; however, if the single argument - * is given in css syntax ('text-align:center'), .style() sets the css + * returns the value of the given property; however, if a single argument + * is given in CSS syntax ('text-align:center'), .style() sets the CSS * appropriately. * * @method style @@ -1977,7 +1979,7 @@ p5.Element.prototype.style = function(prop, val) { * * Adds a new attribute or changes the value of an existing attribute * on the specified element. If no value is specified, returns the - * value of the given attribute, or null if attribute is not set. + * value of the given attribute, or null if the attribute is not set. * * @method attribute * @return {String} value of attribute @@ -2146,8 +2148,8 @@ p5.Element.prototype.hide = function() { * * Sets the width and height of the element. AUTO can be used to * only adjust one dimension at a time. If no arguments are given, it - * returns the width and height of the element in an object. In case of - * elements which need to be loaded, such as images, it is recommended + * returns the width and height of the element in an Object. In the case of + * elements that need to be loaded, such as images, it is recommended * to call the function after the element has finished loading. * * @method size diff --git a/src/events/keyboard.js b/src/events/keyboard.js index 4ee87f313f..ffd2d6eee5 100644 --- a/src/events/keyboard.js +++ b/src/events/keyboard.js @@ -192,7 +192,7 @@ p5.prototype._onkeydown = function(e) { * See key and keyCode for more information.

* Browsers may have different default * behaviors attached to various key events. To prevent any default - * behavior for this event, add "return false" to the end of the method. + * behavior for this event, add "return false" to the end of the function. * * @method keyReleased * @param {Object} [event] optional KeyboardEvent callback argument. @@ -252,7 +252,7 @@ p5.prototype._onkeyup = function(e) { * configured.

* Browsers may have different default behaviors attached to various key * events. To prevent any default behavior for this event, add "return false" - * to the end of the method. + * to the end of the function. * * @method keyTyped * @param {Object} [event] optional KeyboardEvent callback argument. diff --git a/src/events/mouse.js b/src/events/mouse.js index ae449c3191..be63806e97 100644 --- a/src/events/mouse.js +++ b/src/events/mouse.js @@ -538,7 +538,7 @@ p5.prototype._setMouseButton = function(e) { * touchMoved() function will be called instead if it is defined.

* Browsers may have different default * behaviors attached to various mouse events. To prevent any default - * behavior for this event, add "return false" to the end of the method. + * behavior for this event, add "return false" to the end of the function. * * @method mouseDragged * @param {Object} [event] optional MouseEvent callback argument. @@ -620,7 +620,7 @@ p5.prototype._onmousemove = function(e) { * called instead if it is defined.

* Browsers may have different default * behaviors attached to various mouse events. To prevent any default - * behavior for this event, add "return false" to the end of the method. + * behavior for this event, add "return false" to the end of the function. * * @method mousePressed * @param {Object} [event] optional MouseEvent callback argument. @@ -699,7 +699,7 @@ p5.prototype._onmousedown = function(e) { * function will be called instead if it is defined.

* Browsers may have different default * behaviors attached to various mouse events. To prevent any default - * behavior for this event, add "return false" to the end of the method. + * behavior for this event, add "return false" to the end of the function. * * @method mouseReleased * @param {Object} [event] optional MouseEvent callback argument. @@ -777,7 +777,7 @@ p5.prototype._ondragover = p5.prototype._onmousemove; * being pressed or released, see mousePressed() or mouseReleased().

* Browsers may have different default * behaviors attached to various mouse events. To prevent any default - * behavior for this event, add "return false" to the end of the method. + * behavior for this event, add "return false" to the end of the function. * * @method mouseClicked * @param {Object} [event] optional MouseEvent callback argument. @@ -929,7 +929,7 @@ p5.prototype._pmouseWheelDeltaY = 0; * touchpad.

* The event.delta property returns the amount the mouse wheel * have scrolled. The values can be positive or negative depending on the - * scroll direction (on OS X with "natural" scrolling enabled, the signs + * scroll direction (on macOS with "natural" scrolling enabled, the signs * are inverted).

* Browsers may have different default behaviors attached to various * mouse events. To prevent any default behavior for this event, add diff --git a/src/math/calculation.js b/src/math/calculation.js index 7bc94ea85b..a1159e2928 100644 --- a/src/math/calculation.js +++ b/src/math/calculation.js @@ -115,7 +115,7 @@ p5.prototype.constrain = function(n, low, high) { /** * Calculates the distance between two points, in either two or three dimensions. - * If you looking for distance between two vectors see dist() + * If you looking for distance between two vectors see p5.Vector.dist() * * @method dist * @param {Number} x1 x-coordinate of the first point @@ -269,10 +269,10 @@ p5.prototype.floor = Math.floor; /** * Calculates a number between two numbers at a specific increment. The amt * parameter is the amount to interpolate between the two values where 0.0 - * equal to the first point, 0.1 is very near the first point, 0.5 is + * is equal to the first point, 0.1 is very near the first point, 0.5 is * half-way in between, and 1.0 is equal to the second point. If the * value of amt is more than 1.0 or less than 0.0, the number will be - * calculated accordingly in the ratio of the two given numbers. The lerp + * calculated accordingly in the ratio of the two given numbers. The lerp() * function is convenient for creating motion along a straight * path and for drawing dotted lines. * diff --git a/src/math/math.js b/src/math/math.js index 89d07aaeef..afb4f2879b 100644 --- a/src/math/math.js +++ b/src/math/math.js @@ -9,7 +9,7 @@ import p5 from '../core/main'; /** * Creates a new p5.Vector (the datatype for storing vectors). This provides a - * two or three dimensional vector, specifically a Euclidean (also known as + * two or three-dimensional vector, specifically a Euclidean (also known as * geometric) vector. A vector is an entity that has both magnitude and * direction. * diff --git a/src/math/noise.js b/src/math/noise.js index cb58e0744d..ac75a64361 100644 --- a/src/math/noise.js +++ b/src/math/noise.js @@ -36,26 +36,26 @@ let perlin; // will be initialized lazily by noise() or noiseSeed() /** * Returns the Perlin noise value at specified coordinates. Perlin noise is * a random sequence generator producing a more naturally ordered, harmonic - * succession of numbers compared to the standard random() function. + * succession of numbers compared to the standard random() function. * It was invented by Ken Perlin in the 1980s and been used since in * graphical applications to produce procedural textures, natural motion, * shapes, terrains etc.

The main difference to the - * random() function is that Perlin noise is defined in an infinite + * random() function is that Perlin noise is defined in an infinite * n-dimensional space where each pair of coordinates corresponds to a * fixed semi-random value (fixed only for the lifespan of the program; see * the noiseSeed() function). p5.js can compute 1D, 2D and 3D noise, * depending on the number of coordinates given. The resulting value will * always be between 0.0 and 1.0. The noise value can be animated by moving * through the noise space as demonstrated in the example above. The 2nd - * and 3rd dimension can also be interpreted as time.

The actual + * and 3rd dimensions can also be interpreted as time.

The actual * noise is structured similar to an audio signal, in respect to the * function's use of frequencies. Similar to the concept of harmonics in - * physics, perlin noise is computed over several octaves which are added + * physics, Perlin noise is computed over several octaves which are added * together for the final result.

Another way to adjust the * character of the resulting sequence is the scale of the input * coordinates. As the function works within an infinite space the value of * the coordinates doesn't matter as such, only the distance between - * successive coordinates does (eg. when using noise() within a + * successive coordinates does (eg. when using noise() within a * loop). As a general rule the smaller the difference between coordinates, * the smoother the resulting noise sequence will be. Steps of 0.005-0.03 * work best for most applications, but this will differ depending on use. @@ -181,17 +181,17 @@ p5.prototype.noise = function(x, y = 0, z = 0) { * function. Similar to harmonics in physics, noise is computed over * several octaves. Lower octaves contribute more to the output signal and * as such define the overall intensity of the noise, whereas higher octaves - * create finer grained details in the noise sequence. + * create finer-grained details in the noise sequence. * * By default, noise is computed over 4 octaves with each octave contributing - * exactly half than its predecessor, starting at 50% strength for the 1st + * exactly half as much as its predecessor, starting at 50% strength for the 1st * octave. This falloff amount can be changed by adding an additional function * parameter. Eg. a falloff factor of 0.75 means each octave will now have * 75% impact (25% less) of the previous lower octave. Any value between - * 0.0 and 1.0 is valid, however note that values greater than 0.5 might - * result in greater than 1.0 values returned by noise(). + * 0.0 and 1.0 is valid, however, note that values greater than 0.5 might + * result in greater than 1.0 values returned by noise(). * - * By changing these parameters, the signal created by the noise() + * By changing these parameters, the signal created by the noise() * function can be adapted to fit very specific needs and characteristics. * * @method noiseDetail @@ -241,10 +241,10 @@ p5.prototype.noiseDetail = function(lod, falloff) { }; /** - * Sets the seed value for noise(). By default, noise() - * produces different results each time the program is run. Set the - * value parameter to a constant to return the same pseudo-random - * numbers each time the software is run. + * Sets the seed value for noise(). By default, + * noise() produces different results each time + * the program is run. Set the `seed` parameter to a constant to return + * the same pseudo-random numbers each time the software is run. * * @method noiseSeed * @param {Number} seed the seed value diff --git a/src/math/p5.Vector.js b/src/math/p5.Vector.js index fd0879cfc3..cdf60e12ee 100644 --- a/src/math/p5.Vector.js +++ b/src/math/p5.Vector.js @@ -8,11 +8,11 @@ import p5 from '../core/main'; import * as constants from '../core/constants'; /** - * A class to describe a two or three dimensional vector, specifically + * A class to describe a two or three-dimensional vector, specifically * a Euclidean (also known as geometric) vector. A vector is an entity * that has both magnitude and direction. The datatype, however, stores * the components of the vector (x, y for 2D, and x, y, z for 3D). The magnitude - * and direction can be accessed via the methods mag() and heading(). + * and direction can be accessed via the methods p5.Vector.mag() and heading(). * * In many of the p5.js examples, you will see p5.Vector used to describe a * position, velocity, or acceleration. For example, if you consider a rectangle @@ -249,7 +249,7 @@ p5.Vector.prototype.copy = function copy() { * Adds x, y, and z components to a vector, adds one vector to another, or * adds two independent vectors together. The version of the method that adds * two vectors together is a static method and returns a p5.Vector, the others - * acts directly on the vector. Additionally, you may provide arguments to this function as an array. + * act directly on the vector. Additionally, you may provide arguments to this method as an array. * See the examples for more context. * * @method add @@ -370,7 +370,7 @@ const calculateRemainder3D = function(xComponent, yComponent, zComponent) { return this; }; /** - * Gives remainder of a vector when it is divided by another vector. + * Gives the remainder of a vector when it is divided by another vector. * See examples for more context. * * @method rem @@ -462,7 +462,7 @@ p5.Vector.prototype.rem = function rem(x, y, z) { * Subtracts x, y, and z components from a vector, subtracts one vector from * another, or subtracts two independent vectors. The version of the method * that subtracts two vectors is a static method and returns a p5.Vector, the - * other acts directly on the vector. Additionally, you may provide arguments to this function as an array. + * others act directly on the vector. Additionally, you may provide arguments to this method as an array. * See the examples for more context. * * @method sub @@ -565,8 +565,8 @@ p5.Vector.prototype.sub = function sub(x, y, z) { * and z components of the vector are all multiplied by the scalar. When multiplying a vector by a vector, * the x, y, z components of both vectors are multiplied by each other * (for example, with two vectors a and b: a.x * b.x, a.y * b.y, a.z * b.z). The static version of this method - * creates a new p5.Vector while the non static version acts on the vector - * directly. Additionally, you may provide arguments to this function as an array. + * creates a new p5.Vector while the non-static version acts on the vector + * directly. Additionally, you may provide arguments to this method as an array. * See the examples for more context. * * @method mult @@ -756,10 +756,10 @@ p5.Vector.prototype.mult = function mult(x, y, z) { * z components of two vectors against each other. When dividing a vector by a scalar, the x, y, * and z components of the vector are all divided by the scalar. When dividing a vector by a vector, * the x, y, z components of the source vector are treated as the dividend, and the x, y, z components - * of the argument is treated as the divisor (for example with two vectors a and b: a.x / b.x, a.y / b.y, a.z / b.z). + * of the argument are treated as the divisor (for example with two vectors a and b: a.x / b.x, a.y / b.y, a.z / b.z). * The static version of this method creates a - * new p5.Vector while the non static version acts on the vector directly. - * Additionally, you may provide arguments to this function as an array. + * new p5.Vector while the non-static version acts on the vector directly. + * Additionally, you may provide arguments to this method as an array. * See the examples for more context. * * @method div @@ -1102,7 +1102,7 @@ p5.Vector.prototype.dot = function dot(x, y, z) { /** * Calculates and returns a vector composed of the cross product between - * two vectors. Both the static and non static methods return a new p5.Vector. + * two vectors. Both the static and non-static methods return a new p5.Vector. * See the examples for more context. * * @method cross @@ -1145,7 +1145,7 @@ p5.Vector.prototype.cross = function cross(v) { /** * Calculates the Euclidean distance between two points (considering a * point as a vector object). - * If you are looking to calculate distance with 2 points see dist() + * If you are looking to calculate distance between 2 points see dist() * * @method dist * @param {p5.Vector} v the x, y, and z coordinates of a p5.Vector @@ -1399,9 +1399,9 @@ p5.Vector.prototype.setMag = function setMag(n) { }; /** - * Calculate the angle of rotation for this vector(only 2D vectors). + * Calculate the angle of rotation for this vector (only 2D vectors). * p5.Vectors created using createVector() - * will take the current angleMode into + * will take the current angleMode() into * consideration, and give the angle in radians or degree accordingly. * * @method heading @@ -1472,7 +1472,7 @@ p5.Vector.prototype.heading = function heading() { /** * Rotate the vector to a specific angle (only 2D vectors), magnitude remains the - * same + * same. * * @method setHeading * @param {number} angle the angle of rotation @@ -1497,7 +1497,7 @@ p5.Vector.prototype.setHeading = function setHeading(a) { /** * Rotate the vector by an angle (only 2D vectors), magnitude remains the - * same + * same. * * @method rotate * @param {number} angle the angle of rotation @@ -1565,7 +1565,7 @@ p5.Vector.prototype.rotate = function rotate(a) { }; /** - * Calculates and returns the angle between two vectors. This function will take + * Calculates and returns the angle between two vectors. This method will take * the current angleMode into consideration, and * give the angle in radians or degree accordingly. * @@ -1645,7 +1645,7 @@ p5.Vector.prototype.angleBetween = function angleBetween(v) { return angle; }; /** - * Linear interpolate the vector to another vector + * Linear interpolate the vector to another vector. * * @method lerp * @param {Number} x the x component @@ -1734,8 +1734,8 @@ p5.Vector.prototype.lerp = function lerp(x, y, z, amt) { }; /** - * Reflect the incoming vector about a normal to a line in 2D, or about a normal to a plane in 3D - * This method acts on the vector directly + * Reflect the incoming vector about a normal to a line in 2D, or about a normal to a plane in 3D. + * This method acts on the vector directly. * * @method reflect * @param {p5.Vector} surfaceNormal the p5.Vector to reflect about, will be normalized by this method @@ -1821,7 +1821,7 @@ p5.Vector.prototype.array = function array() { }; /** - * Equality check against a p5.Vector + * Equality check against a p5.Vector. * * @method equals * @param {Number} [x] the x component of the vector @@ -1876,7 +1876,7 @@ p5.Vector.prototype.equals = function equals(x, y, z) { // Static Methods /** - * Make a new 2D vector from an angle + * Make a new 2D vector from an angle. * * @method fromAngle * @static @@ -1927,7 +1927,7 @@ p5.Vector.fromAngle = function fromAngle(angle, length) { }; /** - * Make a new 3D vector from a pair of ISO spherical angles + * Make a new 3D vector from a pair of ISO spherical angles. * * @method fromAngles * @static @@ -1976,7 +1976,7 @@ p5.Vector.fromAngles = function(theta, phi, length) { }; /** - * Make a new 2D unit vector from a random angle + * Make a new 2D unit vector from a random angle. * * @method random2D * @static diff --git a/src/math/random.js b/src/math/random.js index 2914020d33..40fe5fa62b 100644 --- a/src/math/random.js +++ b/src/math/random.js @@ -160,9 +160,9 @@ p5.prototype.random = function(min, max) { * be returned. * * Takes either 0, 1 or 2 arguments.
- * If no args, returns a mean of 0 and standard deviation of 1.
- * If one arg, that arg is the mean (standard deviation is 1).
- * If two args, first is mean, second is standard deviation. + * If no args, the mean is 0 and the standard deviation is 1.
+ * If one arg, that arg is the mean and the standard deviation is 1.
+ * If two args, the first arg is the mean and the second is the standard deviation. * * @method randomGaussian * @param {Number} [mean] the mean diff --git a/src/math/trigonometry.js b/src/math/trigonometry.js index d71449cfc2..ebd1a5226e 100644 --- a/src/math/trigonometry.js +++ b/src/math/trigonometry.js @@ -18,8 +18,8 @@ p5.prototype._angleMode = constants.RADIANS; /** * The inverse of cos(), returns the arc cosine of a value. * This function expects the values in the range of -1 to 1 and values are returned in - * the range 0 to PI (3.1415927) if the angleMode is RADIANS or 0 to 180 if the - * angle mode is DEGREES. + * the range 0 to PI (3.1415927) if the angleMode() is RADIANS + * or 0 to 180 if the angleMode() is DEGREES. * * @method acos * @param {Number} value the value whose arc cosine is to be returned @@ -123,9 +123,10 @@ p5.prototype.atan = function(ratio) { /** * Calculates the angle (in radians) from a specified point to the coordinate * origin as measured from the positive x-axis. Values are returned as a - * float in the range from PI to -PI if the angleMode is RADIANS or 180 to - * -180 if the angleMode is DEGREES. The atan2() function is - * most often used for orienting geometry to the position of the cursor. + * float in the range from PI to -PI if the angleMode() + * is RADIANS or 180 to -180 if the angleMode() is DEGREES. + * The atan2() function is most often used for orienting geometry + * to the position of the cursor. * * Note: The y-coordinate of the point is the first parameter, and the * x-coordinate is the second parameter, due the the structure of calculating @@ -241,7 +242,7 @@ p5.prototype.tan = function(angle) { * Radians and degrees are two ways of measuring the same thing. There are * 360 degrees in a circle and 2*PI radians in a circle. For example, * 90° = PI/2 = 1.5707964. This function does not take into account the - * current angleMode. + * current angleMode(). * * @method degrees * @param {Number} radians the radians value to convert to degrees @@ -283,7 +284,7 @@ p5.prototype.degrees = angle => angle * constants.RAD_TO_DEG; p5.prototype.radians = angle => angle * constants.DEG_TO_RAD; /** - * Sets the current mode of p5 to given mode. Default mode is RADIANS. + * Sets the current mode of p5 to the given mode. Default mode is RADIANS. * * @method angleMode * @param {Constant} mode either RADIANS or DEGREES diff --git a/src/typography/attributes.js b/src/typography/attributes.js index 0b8fba11ed..80d47c7f37 100644 --- a/src/typography/attributes.js +++ b/src/typography/attributes.js @@ -20,7 +20,7 @@ import p5 from '../core/main'; * So if you write textAlign(LEFT), you are aligning the left * edge of your text to the x value you give in text(). * If you write textAlign(RIGHT, TOP), you are aligning the right edge - * of your text to the x value and the top of edge of the text + * of your text to the x value and the top edge of the text * to the y value. * * @method textAlign diff --git a/src/typography/loading_displaying.js b/src/typography/loading_displaying.js index d0a8553b73..a83f3470b5 100644 --- a/src/typography/loading_displaying.js +++ b/src/typography/loading_displaying.js @@ -15,9 +15,9 @@ import '../core/friendly_errors/fes_core'; /** * Loads an opentype font file (.otf, .ttf) from a file or a URL, - * and returns a PFont Object. This method is asynchronous, - * meaning it may not finish before the next line in your sketch - * is executed. + * and returns a p5.Font object. This function + * is asynchronous, meaning it may not finish before the next line in + * your sketch is executed. * * The path to the font should be relative to the HTML file * that links in your sketch. Loading fonts from a URL or other From db984a86a7b9873f270f04b1952cd93dd6aa08c9 Mon Sep 17 00:00:00 2001 From: Zearin Date: Sun, 23 Jan 2022 11:17:39 -0500 Subject: [PATCH 011/131] docs(p5.Vector): Format code as code --- src/math/p5.Vector.js | 45 ++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/math/p5.Vector.js b/src/math/p5.Vector.js index fd0879cfc3..eef8ef39c2 100644 --- a/src/math/p5.Vector.js +++ b/src/math/p5.Vector.js @@ -11,7 +11,7 @@ import * as constants from '../core/constants'; * A class to describe a two or three dimensional vector, specifically * a Euclidean (also known as geometric) vector. A vector is an entity * that has both magnitude and direction. The datatype, however, stores - * the components of the vector (x, y for 2D, and x, y, z for 3D). The magnitude + * the components of the vector (`x`, `y` for 2D; or `x`, `y`, `z` for 3D). The magnitude * and direction can be accessed via the methods mag() and heading(). * * In many of the p5.js examples, you will see p5.Vector used to describe a @@ -84,8 +84,8 @@ p5.Vector = function Vector() { }; /** - * Returns a string representation of a vector v by calling String(v) - * or v.toString(). This method is useful for logging vectors in the + * Returns a string representation of a vector `v` by calling `String(v)` + * or `v.toString()`. This method is useful for logging vectors in the * console. * @method toString * @return {String} @@ -134,7 +134,7 @@ p5.Vector.prototype.toString = function p5VectorToString() { }; /** - * Sets the x, y, and z component of the vector using two or three separate + * Sets the `x`, `y`, and `z` components of the vector using two or three separate * variables, the data from a p5.Vector, or the values from a float array. * @method set * @param {Number} [x] the x component of the vector @@ -246,7 +246,7 @@ p5.Vector.prototype.copy = function copy() { }; /** - * Adds x, y, and z components to a vector, adds one vector to another, or + * Adds `x`, `y`, and `z` components to a vector, adds one vector to another, or * adds two independent vectors together. The version of the method that adds * two vectors together is a static method and returns a p5.Vector, the others * acts directly on the vector. Additionally, you may provide arguments to this function as an array. @@ -459,7 +459,7 @@ p5.Vector.prototype.rem = function rem(x, y, z) { }; /** - * Subtracts x, y, and z components from a vector, subtracts one vector from + * Subtracts `x`, `y`, and `z` components from a vector, subtracts one vector from * another, or subtracts two independent vectors. The version of the method * that subtracts two vectors is a static method and returns a p5.Vector, the * other acts directly on the vector. Additionally, you may provide arguments to this function as an array. @@ -560,11 +560,11 @@ p5.Vector.prototype.sub = function sub(x, y, z) { }; /** - * Multiplies the vector by a scalar, multiplies the x, y, and z components from a vector, or multiplies - * the x, y, and z components of two independent vectors. When multiplying a vector by a scalar, the x, y, - * and z components of the vector are all multiplied by the scalar. When multiplying a vector by a vector, - * the x, y, z components of both vectors are multiplied by each other - * (for example, with two vectors a and b: a.x * b.x, a.y * b.y, a.z * b.z). The static version of this method + * Multiplies the vector by a scalar, multiplies the `x`, `y`, and `z` components from a vector, or multiplies + * the `x`, `y`, and `z` components of two independent vectors. When multiplying a vector by a scalar, the `x`, `y`, + * and `z` components of the vector are all multiplied by the scalar. When multiplying a vector by a vector, + * the `x`, `y`, `z` components of both vectors are multiplied by each other + * (for example, with two vectors `a` and `b`: `a.x * b.x`, `a.y * b.y`, `a.z * b.z`). The static version of this method * creates a new p5.Vector while the non static version acts on the vector * directly. Additionally, you may provide arguments to this function as an array. * See the examples for more context. @@ -752,11 +752,12 @@ p5.Vector.prototype.mult = function mult(x, y, z) { }; /** - * Divides the vector by a scalar, divides a vector by the x, y, and z arguments, or divides the x, y, and - * z components of two vectors against each other. When dividing a vector by a scalar, the x, y, - * and z components of the vector are all divided by the scalar. When dividing a vector by a vector, - * the x, y, z components of the source vector are treated as the dividend, and the x, y, z components - * of the argument is treated as the divisor (for example with two vectors a and b: a.x / b.x, a.y / b.y, a.z / b.z). + * Divides the vector by a scalar, divides a vector by the `x`, `y`, and `z` arguments, or divides the `x`, `y`, and + * `z` components of two vectors against each other. When dividing a vector by a scalar, the `x`, `y`, + * and `z` components of the vector are all divided by the scalar. When dividing a vector by a vector, + * the `x`, `y`, `z` components of the source vector are treated as the dividend, and the `x`, `y`, `z` components + * of the argument is treated as the divisor. (For example, with two vectors + * `a` and `b`: `a.x / b.x`, `a.y / b.y`, `a.z / b.z`.) * The static version of this method creates a * new p5.Vector while the non static version acts on the vector directly. * Additionally, you may provide arguments to this function as an array. @@ -958,7 +959,7 @@ p5.Vector.prototype.div = function div(x, y, z) { }; /** * Calculates the magnitude (length) of the vector and returns the result as - * a float (this is simply the equation sqrt(x\*x + y\*y + z\*z).) + * a float. (This is simply the equation `sqrt(x*x + y*y + z*z)`.) * * @method mag * @return {Number} magnitude of the vector @@ -1006,7 +1007,7 @@ p5.Vector.prototype.mag = function mag() { /** * Calculates the squared magnitude of the vector and returns the result - * as a float (this is simply the equation (x\*x + y\*y + z\*z).) + * as a float. (This is simply the equation `x*x + y*y + z*z`.) * Faster if the real length is not required in the * case of comparing vectors, etc. * @@ -1285,7 +1286,7 @@ p5.Vector.prototype.normalize = function normalize() { }; /** - * Limit the magnitude of this vector to the value used for the max + * Limit the magnitude of this vector to the value used for the `max` * parameter. * * @method limit @@ -1343,7 +1344,7 @@ p5.Vector.prototype.limit = function limit(max) { }; /** - * Set the magnitude of this vector to the value used for the len + * Set the magnitude of this vector to the value used for the `len` * parameter. * * @method setMag @@ -2105,7 +2106,7 @@ p5.Vector.rem = function rem(v1, v2) { /* * Subtracts one p5.Vector from another and returns a new one. The second - * vector (v2) is subtracted from the first (v1), resulting in v1-v2. + * vector (`v2`) is subtracted from the first (`v1`), resulting in `v1-v2`. */ /** * @method sub @@ -2338,7 +2339,7 @@ p5.Vector.lerp = function lerp(v1, v2, amt, target) { /** * Calculates the magnitude (length) of the vector and returns the result as - * a float (this is simply the equation sqrt(x\*x + y\*y + z\*z).) + * a float (this is simply the equation `sqrt(x*x + y*y + z*z)`.) */ /** * @method mag From b14367b35a21a11e5e4ece1bedeb83cdea0d3205 Mon Sep 17 00:00:00 2001 From: Zearin Date: Sun, 23 Jan 2022 11:35:39 -0500 Subject: [PATCH 012/131] docs(p5.Vector): Capitalize @{param,return} desc. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Capitalizing the description for a `@param` or `@return` helps readability (the description starts with a capital letter) - Use articles (“a”, “an”, “the”) more consistently for `@param` and `@return` --- src/math/p5.Vector.js | 166 +++++++++++++++++++++--------------------- 1 file changed, 83 insertions(+), 83 deletions(-) diff --git a/src/math/p5.Vector.js b/src/math/p5.Vector.js index eef8ef39c2..ba77d64fa0 100644 --- a/src/math/p5.Vector.js +++ b/src/math/p5.Vector.js @@ -137,9 +137,9 @@ p5.Vector.prototype.toString = function p5VectorToString() { * Sets the `x`, `y`, and `z` components of the vector using two or three separate * variables, the data from a p5.Vector, or the values from a float array. * @method set - * @param {Number} [x] the x component of the vector - * @param {Number} [y] the y component of the vector - * @param {Number} [z] the z component of the vector + * @param {Number} [x] The x component of the vector + * @param {Number} [y] The y component of the vector + * @param {Number} [z] The z component of the vector * @chainable * @example *
@@ -194,7 +194,7 @@ p5.Vector.prototype.toString = function p5VectorToString() { */ /** * @method set - * @param {p5.Vector|Number[]} value the vector to set + * @param {p5.Vector|Number[]} value The vector to set * @chainable */ p5.Vector.prototype.set = function set(x, y, z) { @@ -220,7 +220,7 @@ p5.Vector.prototype.set = function set(x, y, z) { * Gets a copy of the vector, returns a p5.Vector object. * * @method copy - * @return {p5.Vector} the copy of the p5.Vector object + * @return {p5.Vector} A copy of the p5.Vector object * @example *
* @@ -253,9 +253,9 @@ p5.Vector.prototype.copy = function copy() { * See the examples for more context. * * @method add - * @param {Number} x the x component of the vector to be added - * @param {Number} [y] the y component of the vector to be added - * @param {Number} [z] the z component of the vector to be added + * @param {Number} x The x component of the vector to be added + * @param {Number} [y] The y component of the vector to be added + * @param {Number} [z] The z component of the vector to be added * @chainable * @example *
@@ -324,7 +324,7 @@ p5.Vector.prototype.copy = function copy() { */ /** * @method add - * @param {p5.Vector|Number[]} value the vector to add + * @param {p5.Vector|Number[]} value The vector to add * @chainable */ p5.Vector.prototype.add = function add(x, y, z) { @@ -374,9 +374,9 @@ const calculateRemainder3D = function(xComponent, yComponent, zComponent) { * See examples for more context. * * @method rem - * @param {Number} x the x component of divisor vector - * @param {Number} y the y component of divisor vector - * @param {Number} z the z component of divisor vector + * @param {Number} x The x component of divisor vector + * @param {Number} y The y component of divisor vector + * @param {Number} z The z component of divisor vector * @chainable * @example *
@@ -400,7 +400,7 @@ const calculateRemainder3D = function(xComponent, yComponent, zComponent) { */ /** * @method rem - * @param {p5.Vector | Number[]} value divisor vector + * @param {p5.Vector | Number[]} value The divisor vector * @chainable */ p5.Vector.prototype.rem = function rem(x, y, z) { @@ -466,9 +466,9 @@ p5.Vector.prototype.rem = function rem(x, y, z) { * See the examples for more context. * * @method sub - * @param {Number} x the x component of the vector to subtract - * @param {Number} [y] the y component of the vector to subtract - * @param {Number} [z] the z component of the vector to subtract + * @param {Number} x The x component of the vector to subtract + * @param {Number} [y] The y component of the vector to subtract + * @param {Number} [z] The z component of the vector to subtract * @chainable * @example *
@@ -962,7 +962,7 @@ p5.Vector.prototype.div = function div(x, y, z) { * a float. (This is simply the equation `sqrt(x*x + y*y + z*z)`.) * * @method mag - * @return {Number} magnitude of the vector + * @return {Number} The magnitude of the vector * @example *
* @@ -1012,7 +1012,7 @@ p5.Vector.prototype.mag = function mag() { * case of comparing vectors, etc. * * @method magSq - * @return {number} squared magnitude of the vector + * @return {number} The squared magnitude of the vector * @example *
* @@ -1065,10 +1065,10 @@ p5.Vector.prototype.magSq = function magSq() { * method. See the examples for more context. * * @method dot - * @param {Number} x x component of the vector - * @param {Number} [y] y component of the vector - * @param {Number} [z] z component of the vector - * @return {Number} the dot product + * @param {Number} x The x component of the vector + * @param {Number} [y] The y component of the vector + * @param {Number} [z] The z component of the vector + * @return {Number} The dot product * * @example *
@@ -1149,8 +1149,8 @@ p5.Vector.prototype.cross = function cross(v) { * If you are looking to calculate distance with 2 points see dist() * * @method dist - * @param {p5.Vector} v the x, y, and z coordinates of a p5.Vector - * @return {Number} the distance + * @param {p5.Vector} v The x, y, and z coordinates of a p5.Vector + * @return {Number} The distance * @example *
* @@ -1219,7 +1219,7 @@ p5.Vector.prototype.dist = function dist(v) { * Normalize the vector to length 1 (make it a unit vector). * * @method normalize - * @return {p5.Vector} normalized p5.Vector + * @return {p5.Vector} The normalized p5.Vector * @example *
* @@ -1290,7 +1290,7 @@ p5.Vector.prototype.normalize = function normalize() { * parameter. * * @method limit - * @param {Number} max the maximum magnitude for the vector + * @param {Number} max The maximum magnitude for the vector * @chainable * @example *
@@ -1348,7 +1348,7 @@ p5.Vector.prototype.limit = function limit(max) { * parameter. * * @method setMag - * @param {number} len the new length for this vector + * @param {number} len The new length for this vector * @chainable * @example *
@@ -1406,7 +1406,7 @@ p5.Vector.prototype.setMag = function setMag(n) { * consideration, and give the angle in radians or degree accordingly. * * @method heading - * @return {Number} the angle of rotation + * @return {Number} The angle of rotation * @example *
* @@ -1476,7 +1476,7 @@ p5.Vector.prototype.heading = function heading() { * same * * @method setHeading - * @param {number} angle the angle of rotation + * @param {number} angle The angle of rotation * @chainable * @example *
@@ -1501,7 +1501,7 @@ p5.Vector.prototype.setHeading = function setHeading(a) { * same * * @method rotate - * @param {number} angle the angle of rotation + * @param {number} angle The angle of rotation * @chainable * @example *
@@ -1571,8 +1571,8 @@ p5.Vector.prototype.rotate = function rotate(a) { * give the angle in radians or degree accordingly. * * @method angleBetween - * @param {p5.Vector} value the x, y, and z components of a p5.Vector - * @return {Number} the angle between (in radians) + * @param {p5.Vector} value The x, y, and z components of a p5.Vector + * @return {Number} The angle between (in radians) * @example *
* @@ -1646,13 +1646,13 @@ p5.Vector.prototype.angleBetween = function angleBetween(v) { return angle; }; /** - * Linear interpolate the vector to another vector + * Linear interpolate the vector to another vector. * * @method lerp - * @param {Number} x the x component - * @param {Number} y the y component - * @param {Number} z the z component - * @param {Number} amt the amount of interpolation; some value between 0.0 + * @param {Number} x The x component + * @param {Number} y The y component + * @param {Number} z The z component + * @param {Number} amt The amount of interpolation; some value between 0.0 * (old vector) and 1.0 (new vector). 0.9 is very near * the new vector. 0.5 is halfway in between. * @chainable @@ -1720,7 +1720,7 @@ p5.Vector.prototype.angleBetween = function angleBetween(v) { */ /** * @method lerp - * @param {p5.Vector} v the p5.Vector to lerp to + * @param {p5.Vector} v The p5.Vector to lerp to * @param {Number} amt * @chainable */ @@ -1739,7 +1739,7 @@ p5.Vector.prototype.lerp = function lerp(x, y, z, amt) { * This method acts on the vector directly * * @method reflect - * @param {p5.Vector} surfaceNormal the p5.Vector to reflect about, will be normalized by this method + * @param {p5.Vector} surfaceNormal The p5.Vector to reflect about; will be normalized by this method. * @chainable * @example *
@@ -1796,7 +1796,7 @@ p5.Vector.prototype.reflect = function reflect(surfaceNormal) { * array. * * @method array - * @return {Number[]} an Array with the 3 values + * @return {Number[]} An Array with the 3 values * @example *
* @@ -1825,10 +1825,10 @@ p5.Vector.prototype.array = function array() { * Equality check against a p5.Vector * * @method equals - * @param {Number} [x] the x component of the vector - * @param {Number} [y] the y component of the vector - * @param {Number} [z] the z component of the vector - * @return {Boolean} whether the vectors are equals + * @param {Number} [x] The x component of the vector + * @param {Number} [y] The y component of the vector + * @param {Number} [z] The z component of the vector + * @return {Boolean} Whether the vectors are equal * @example *
* @@ -1853,7 +1853,7 @@ p5.Vector.prototype.array = function array() { */ /** * @method equals - * @param {p5.Vector|Array} value the vector to compare + * @param {p5.Vector|Array} value The vector to compare * @return {Boolean} */ p5.Vector.prototype.equals = function equals(x, y, z) { @@ -1881,9 +1881,9 @@ p5.Vector.prototype.equals = function equals(x, y, z) { * * @method fromAngle * @static - * @param {Number} angle the desired angle, in radians (unaffected by angleMode) - * @param {Number} [length] the length of the new vector (defaults to 1) - * @return {p5.Vector} the new p5.Vector object + * @param {Number} angle The desired angle, in radians (unaffected by angleMode) + * @param {Number} [length] The length of the new vector (defaults to 1) + * @return {p5.Vector} The new p5.Vector object * @example *
* @@ -1932,11 +1932,11 @@ p5.Vector.fromAngle = function fromAngle(angle, length) { * * @method fromAngles * @static - * @param {Number} theta the polar angle, in radians (zero is up) - * @param {Number} phi the azimuthal angle, in radians + * @param {Number} theta The polar angle, in radians (zero is up) + * @param {Number} phi The azimuthal angle, in radians * (zero is out of the screen) - * @param {Number} [length] the length of the new vector (defaults to 1) - * @return {p5.Vector} the new p5.Vector object + * @param {Number} [length] The length of the new vector (defaults to 1) + * @return {p5.Vector} A new p5.Vector object * @example *
* @@ -1981,7 +1981,7 @@ p5.Vector.fromAngles = function(theta, phi, length) { * * @method random2D * @static - * @return {p5.Vector} the new p5.Vector object + * @return {p5.Vector} A new p5.Vector object * @example *
* @@ -2034,7 +2034,7 @@ p5.Vector.random2D = function random2D() { * * @method random3D * @static - * @return {p5.Vector} the new p5.Vector object + * @return {p5.Vector} A new p5.Vector object * @example *
* @@ -2060,10 +2060,10 @@ p5.Vector.random3D = function random3D() { /** * @method add * @static - * @param {p5.Vector} v1 a p5.Vector to add - * @param {p5.Vector} v2 a p5.Vector to add - * @param {p5.Vector} [target] the vector to receive the result - * @return {p5.Vector} the resulting p5.Vector + * @param {p5.Vector} v1 A p5.Vector to add + * @param {p5.Vector} v2 A p5.Vector to add + * @param {p5.Vector} [target] The vector to receive the result + * @return {p5.Vector} The resulting p5.Vector */ p5.Vector.add = function add(v1, v2, target) { @@ -2086,15 +2086,15 @@ p5.Vector.add = function add(v1, v2, target) { /** * @method rem * @static - * @param {p5.Vector} v1 dividend p5.Vector - * @param {p5.Vector} v2 divisor p5.Vector + * @param {p5.Vector} v1 The dividend p5.Vector + * @param {p5.Vector} v2 The divisor p5.Vector */ /** * @method rem * @static * @param {p5.Vector} v1 * @param {p5.Vector} v2 - * @return {p5.Vector} the resulting p5.Vector + * @return {p5.Vector} The resulting p5.Vector */ p5.Vector.rem = function rem(v1, v2) { if (v1 instanceof p5.Vector && v2 instanceof p5.Vector) { @@ -2111,10 +2111,10 @@ p5.Vector.rem = function rem(v1, v2) { /** * @method sub * @static - * @param {p5.Vector} v1 a p5.Vector to subtract from - * @param {p5.Vector} v2 a p5.Vector to subtract - * @param {p5.Vector} [target] the vector to receive the result - * @return {p5.Vector} the resulting p5.Vector + * @param {p5.Vector} v1 A p5.Vector to subtract from + * @param {p5.Vector} v2 A p5.Vector to subtract + * @param {p5.Vector} [target] The vector to receive the result + * @return {p5.Vector} The resulting p5.Vector */ p5.Vector.sub = function sub(v1, v2, target) { @@ -2194,7 +2194,7 @@ p5.Vector.mult = function mult(v, n, target) { * @static * @param {p5.Vector} v * @param {Number} angle - * @param {p5.Vector} [target] the vector to receive the result + * @param {p5.Vector} [target] The vector to receive the result */ p5.Vector.rotate = function rotate(v, a, target) { if (arguments.length === 2) { @@ -2230,7 +2230,7 @@ p5.Vector.rotate = function rotate(v, a, target) { * @static * @param {p5.Vector} v * @param {Number} n - * @param {p5.Vector} [target] the vector to receive the result + * @param {p5.Vector} [target] The vector to receive the result */ /** @@ -2271,9 +2271,9 @@ p5.Vector.div = function div(v, n, target) { /** * @method dot * @static - * @param {p5.Vector} v1 the first p5.Vector - * @param {p5.Vector} v2 the second p5.Vector - * @return {Number} the dot product + * @param {p5.Vector} v1 The first p5.Vector + * @param {p5.Vector} v2 The second p5.Vector + * @return {Number} The dot product */ p5.Vector.dot = function dot(v1, v2) { return v1.dot(v2); @@ -2285,9 +2285,9 @@ p5.Vector.dot = function dot(v1, v2) { /** * @method cross * @static - * @param {p5.Vector} v1 the first p5.Vector - * @param {p5.Vector} v2 the second p5.Vector - * @return {Number} the cross product + * @param {p5.Vector} v1 The first p5.Vector + * @param {p5.Vector} v2 The second p5.Vector + * @return {Number} The cross product */ p5.Vector.cross = function cross(v1, v2) { return v1.cross(v2); @@ -2300,9 +2300,9 @@ p5.Vector.cross = function cross(v1, v2) { /** * @method dist * @static - * @param {p5.Vector} v1 the first p5.Vector - * @param {p5.Vector} v2 the second p5.Vector - * @return {Number} the distance + * @param {p5.Vector} v1 The first p5.Vector + * @param {p5.Vector} v2 The second p5.Vector + * @return {Number} The distance */ p5.Vector.dist = function dist(v1, v2) { return v1.dist(v2); @@ -2318,8 +2318,8 @@ p5.Vector.dist = function dist(v1, v2) { * @param {p5.Vector} v1 * @param {p5.Vector} v2 * @param {Number} amt - * @param {p5.Vector} [target] the vector to receive the result - * @return {p5.Vector} the lerped value + * @param {p5.Vector} [target] The vector to receive the result + * @return {p5.Vector} The lerped value */ p5.Vector.lerp = function lerp(v1, v2, amt, target) { if (!target) { @@ -2344,8 +2344,8 @@ p5.Vector.lerp = function lerp(v1, v2, amt, target) { /** * @method mag * @static - * @param {p5.Vector} vecT the vector to return the magnitude of - * @return {Number} the magnitude of vecT + * @param {p5.Vector} vecT The vector to return the magnitude of + * @return {Number} The magnitude of vecT */ p5.Vector.mag = function mag(vecT) { const x = vecT.x, @@ -2361,9 +2361,9 @@ p5.Vector.mag = function mag(vecT) { /** * @method normalize * @static - * @param {p5.Vector} v the vector to normalize - * @param {p5.Vector} [target] the vector to receive the result - * @return {p5.Vector} v normalized to a length of 1 + * @param {p5.Vector} v The vector to normalize + * @param {p5.Vector} [target] The vector to receive the result + * @return {p5.Vector} The vector v, normalized to a length of 1 */ p5.Vector.normalize = function normalize(v, target) { if (arguments.length < 2) { From cb66c0cf051673d47f3667138b3aaac4cafdf61c Mon Sep 17 00:00:00 2001 From: Zearin Date: Sun, 23 Jan 2022 11:43:21 -0500 Subject: [PATCH 013/131] docs(p5.Vector): Minor edits to punctuation - Ensure descriptions end with punctuation. - Fix a missing space in the description of `setMag()` - Fix a few comma splices --- src/math/p5.Vector.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/math/p5.Vector.js b/src/math/p5.Vector.js index ba77d64fa0..e0b599a629 100644 --- a/src/math/p5.Vector.js +++ b/src/math/p5.Vector.js @@ -1146,7 +1146,7 @@ p5.Vector.prototype.cross = function cross(v) { /** * Calculates the Euclidean distance between two points (considering a * point as a vector object). - * If you are looking to calculate distance with 2 points see dist() + * If you are looking to calculate distance with 2 points, see dist(). * * @method dist * @param {p5.Vector} v The x, y, and z coordinates of a p5.Vector @@ -1400,7 +1400,7 @@ p5.Vector.prototype.setMag = function setMag(n) { }; /** - * Calculate the angle of rotation for this vector(only 2D vectors). + * Calculate the angle of rotation for this vector (only 2D vectors). * p5.Vectors created using createVector() * will take the current angleMode into * consideration, and give the angle in radians or degree accordingly. @@ -1472,8 +1472,8 @@ p5.Vector.prototype.heading = function heading() { }; /** - * Rotate the vector to a specific angle (only 2D vectors), magnitude remains the - * same + * Rotate the vector to a specific angle (only 2D vectors); magnitude remains the + * same. * * @method setHeading * @param {number} angle The angle of rotation @@ -1497,8 +1497,8 @@ p5.Vector.prototype.setHeading = function setHeading(a) { }; /** - * Rotate the vector by an angle (only 2D vectors), magnitude remains the - * same + * Rotate the vector by an angle (only 2D vectors); magnitude remains the + * same. * * @method rotate * @param {number} angle The angle of rotation @@ -1735,8 +1735,8 @@ p5.Vector.prototype.lerp = function lerp(x, y, z, amt) { }; /** - * Reflect the incoming vector about a normal to a line in 2D, or about a normal to a plane in 3D - * This method acts on the vector directly + * Reflect the incoming vector about a normal to a line in 2D, or about a normal to a plane in 3D. + * This method acts on the vector directly. * * @method reflect * @param {p5.Vector} surfaceNormal The p5.Vector to reflect about; will be normalized by this method. @@ -1822,7 +1822,7 @@ p5.Vector.prototype.array = function array() { }; /** - * Equality check against a p5.Vector + * Equality check against a p5.Vector. * * @method equals * @param {Number} [x] The x component of the vector @@ -1877,7 +1877,7 @@ p5.Vector.prototype.equals = function equals(x, y, z) { // Static Methods /** - * Make a new 2D vector from an angle + * Make a new 2D vector from an angle. * * @method fromAngle * @static @@ -1928,7 +1928,7 @@ p5.Vector.fromAngle = function fromAngle(angle, length) { }; /** - * Make a new 3D vector from a pair of ISO spherical angles + * Make a new 3D vector from a pair of ISO spherical angles. * * @method fromAngles * @static @@ -1977,7 +1977,7 @@ p5.Vector.fromAngles = function(theta, phi, length) { }; /** - * Make a new 2D unit vector from a random angle + * Make a new 2D unit vector from a random angle. * * @method random2D * @static @@ -2186,7 +2186,7 @@ p5.Vector.mult = function mult(v, n, target) { }; /** - * Rotates the vector (only 2D vectors) by the given angle, magnitude remains the same and returns a new vector. + * Rotates the vector (only 2D vectors) by the given angle; magnitude remains the same. Returns a new vector. */ /** From 3fb4d81305e034725f44b33edd3a4479b4790592 Mon Sep 17 00:00:00 2001 From: stampyzfanz <34364128+stampyzfanz@users.noreply.github.com> Date: Wed, 2 Feb 2022 19:02:25 +1100 Subject: [PATCH 014/131] docs(contributing md): add language to code blocks --- contributor_docs/README.md | 20 ++++++++--------- contributor_docs/hi/README.md | 20 ++++++++--------- contributor_docs/hi/unit_testing.md | 10 ++++----- contributor_docs/inline_documentation.md | 16 +++++++------- contributor_docs/ko/README.md | 20 ++++++++--------- contributor_docs/ko/inline_documentation.md | 16 +++++++------- contributor_docs/ko/release_process.md | 4 ++-- contributor_docs/ko/unit_testing.md | 4 ++-- .../sakshamsaxena_gsoc_2017.md | 4 ++-- contributor_docs/release_process.md | 4 ++-- contributor_docs/sk/README.md | 22 +++++++++---------- contributor_docs/unit_testing.md | 6 ++--- contributor_docs/zh/README.md | 20 ++++++++--------- 13 files changed, 83 insertions(+), 83 deletions(-) diff --git a/contributor_docs/README.md b/contributor_docs/README.md index b78d671cb0..45d4cc3003 100644 --- a/contributor_docs/README.md +++ b/contributor_docs/README.md @@ -76,20 +76,20 @@ This process is also covered [in a video by The Coding Train.](https://youtu.be/ 3. [Clone](https://help.github.com/articles/cloning-a-repository/) your new fork of the repository from GitHub onto your local computer. - ``` + ```shell $ git clone https://github.com/YOUR_USERNAME/p5.js.git ``` 4. Navigate into the project folder and install all its necessary dependencies with npm. - ``` + ```shell $ cd p5.js $ npm ci ``` 5. [Grunt](https://gruntjs.com/) should now be installed, and you can use it to build the library from the source code. - ``` + ```shell $ npm run grunt ``` @@ -97,7 +97,7 @@ This process is also covered [in a video by The Coding Train.](https://youtu.be/ 6. Make some changes locally to the codebase and [commit](https://help.github.com/articles/github-glossary/#commit) them with Git. - ``` + ```shell $ git add -u $ git commit -m "YOUR COMMIT MESSAGE" ``` @@ -106,7 +106,7 @@ This process is also covered [in a video by The Coding Train.](https://youtu.be/ 8. [Push](https://help.github.com/articles/github-glossary/#push) your new changes to your fork on GitHub. - ``` + ```shell $ git push ``` @@ -124,13 +124,13 @@ p5.js requires clean and stylistically consistent code syntax, which it enforces To detect errors, run the following command in your terminal (do not type the `$` prompt): -``` +```shell $ npm run lint ``` Some syntax errors can be automatically fixed: -``` +```shell $ npm run lint:fix ``` @@ -159,7 +159,7 @@ Unit tests are small pieces of code which are created as complements to the prim In order to run unit tests, you'll need to make sure you have installed the project's dependencies. -``` +```shell $ npm ci ``` @@ -170,13 +170,13 @@ This will install *all* the dependencies for p5.js; briefly, the most important Once the dependencies are installed, use Grunt to run the unit tests. -``` +```shell $ grunt ``` Sometimes it is useful to run the tests in the browser instead of on the command line. To do this, first start the [connect](https://github.com/gruntjs/grunt-contrib-connect) server: -``` +```shell $ npm run dev ``` diff --git a/contributor_docs/hi/README.md b/contributor_docs/hi/README.md index b24b911194..1d6930692d 100644 --- a/contributor_docs/hi/README.md +++ b/contributor_docs/hi/README.md @@ -60,20 +60,20 @@ p5.js में योगदान देने में आपकी रुच 2. [फोर्क](https://help.github.com/articles/fork-a-repo) [p5.js रिपॉजिटरी](https://github.com/processing/p5.js) अपने खुद के गिटहब खाते में। 3. [क्लोन](https://help.github.com/articles/cloning-a-repository/) आपके स्थानीय कंप्यूटर पर गिटहब से रिपॉजिटरी का नया फोर्क। - ``` + ```shell $ git clone https://github.com/YOUR_USERNAME/p5.js.git ``` 4. प्रोजेक्ट फ़ोल्डर में नेविगेट करें और npm के साथ अपनी सभी आवश्यक निर्भरताएं स्थापित करें। - ``` + ```shell $ cd p5.js $ npm ci ``` 5. [ग्रंट](https://gruntjs.com/) अब स्थापित किया जाना चाहिए, और आप इसका उपयोग स्रोत कोड से लाइब्रेरी बनाने के लिए कर सकते हैं। - ``` + ```shell $ npm run grunt ``` @@ -81,7 +81,7 @@ p5.js में योगदान देने में आपकी रुच 6. स्थानीय रूप से कोडबेस और [कमिट](https://help.github.com/articles/github-glossary/#commit) में कुछ बदलाव करें। - ``` + ```shell $ git add -u $ git commit -m "YOUR COMMIT MESSAGE" ``` @@ -90,7 +90,7 @@ p5.js में योगदान देने में आपकी रुच 8. [पुश](https://help.github.com/articles/github-glossary/#push) गिटहब पर आपके फोर्क में आपके नए परिवर्तन। - ``` + ```shell $ git push ``` @@ -108,13 +108,13 @@ p5.js को स्वच्छ और शैलीगत सुसंगत क त्रुटियों का पता लगाने के लिए, अपने टर्मिनल में निम्न कमांड चलाएँ (`$` प्रांप्ट टाइप न करें): -``` +```shell $ npm run lint ``` कुछ सिंटैक्स त्रुटियां स्वचालित रूप से ठीक की जा सकती हैं: -``` +```shell $ npm run lint:fix ``` @@ -136,7 +136,7 @@ $ npm run lint:fix इकाई परीक्षण चलाने के लिए, आपको पहले परियोजना की निर्भरताएँ स्थापित करनी होंगी। -``` +```shell $ npm ci ``` @@ -147,13 +147,13 @@ $ npm ci एक बार निर्भरताएं स्थापित हो जाने के बाद, यूनिट परीक्षणों को चलाने के लिए ग्रंट का उपयोग करें। -``` +```shell $ grunt ``` कभी-कभी कमांड लाइन पर के बजाय ब्राउज़र में परीक्षण चलाना उपयोगी होता है। ऐसा करने के लिए, पहले [कनेक्ट](https://github.com/gruntjs/grunt-contrib-connect) सर्वर शुरू करें: -``` +```shell $ npm run dev ``` diff --git a/contributor_docs/hi/unit_testing.md b/contributor_docs/hi/unit_testing.md index a7473dceb0..7c24cc910e 100644 --- a/contributor_docs/hi/unit_testing.md +++ b/contributor_docs/hi/unit_testing.md @@ -9,8 +9,8 @@ ### सभी यूनिट टेस्ट को चलाना रेपो रूट में, अपने टर्मिनल में निम्न कमांड का उपयोग करें -``` -npm test +```shell +$ npm test ``` ### परीक्षण कवरेज @@ -25,7 +25,7 @@ npm test ### एक उदाहरण केवल "p5.ColorConversion" परीक्षणों का सूट चलाने के लिए, आप पढ़ने के लिए ```test/unit/color/color_conversion.js``` की पहली पंक्ति को बदल देंगे- -``` +```js suite.only('color/p5.ColorConversion', function() { ``` @@ -80,7 +80,7 @@ Node.js परीक्षणों के लिए सेटअप सभी ` हम ```p5.prototype.isKeyPressed``` के लिए एक परीक्षण सूट बना सकते हैं और इसके लिए परीक्षण बनाना शुरू कर सकते हैं। हम अपने यूनिट परीक्षणों की संरचना के लिए Mocha का उपयोग करेंगे। -``` +```js suite('p5.prototype.keyIsPressed', function() { test('keyIsPressed is a boolean', function() { //परीक्षण यहाँ लिखें @@ -98,7 +98,7 @@ suite('p5.prototype.keyIsPressed', function() { हमने परीक्षणों की संरचना की है, लेकिन हमने अभी तक परीक्षण नहीं लिखे हैं। हम इसके लिए ची के दावे का उपयोग करेंगे। निम्नलिखित को धयान मे रखते हुए- -``` +```js test('keyIsPressed is a boolean', function() { assert.isBoolean(myp5.keyIsPressed); //दावा करता है कि मूल्य एक बूलियन है। }); diff --git a/contributor_docs/inline_documentation.md b/contributor_docs/inline_documentation.md index 2349f64a05..e893a4cc77 100644 --- a/contributor_docs/inline_documentation.md +++ b/contributor_docs/inline_documentation.md @@ -16,7 +16,7 @@ You must specify one of these for the element to appear in the docs, with the na * When possible, link to other files when mentioning other function or variable names. For example, you can see the preload method linked in the description for [loadImage](https://github.com/processing/p5.js/blob/main/src/image/loading_displaying.js#L21). * Here is [yuidoc's reference](http://yui.github.io/yuidoc/syntax/index.html#basic-requirements) for more syntax information. -``` +```js /** * The x component of the vector * @property x @@ -25,7 +25,7 @@ You must specify one of these for the element to appear in the docs, with the na this.x = x || 0; ``` -``` +```js /** * Draw an arc @@ -45,7 +45,7 @@ You must specify one of these for the element to appear in the docs, with the na */ ``` -``` +```js /** * * Calculates the magnitude (length) of the vector and returns the result @@ -98,7 +98,7 @@ If the method returns the parent object, you can skip the `@return` and add this If a method has multiple possible parameter options, you can specify each individually. For example, see the examples for [background](http://p5js.org/reference/#p5/background) under "syntax". To do this, choose one version to list as the first signature using the guidelines above. At the end of the documentation block, you can add additional signatures, each in its own block, following the example below. -``` +```js /** * @method background * @param {String} colorstring color string, possible formats include: integer @@ -123,7 +123,7 @@ Notes: Use `@final` if a property or variable is a constant: -``` +```js /** * PI is a mathematical constant with the value 3.14159265358979323846. * @property PI @@ -135,7 +135,7 @@ Use `@final` if a property or variable is a constant: Use `@private` if a property or variable is a private variable (default is `@public` so no need to specify). -``` +```js /** * _start calls preload() setup() and draw() * @@ -149,7 +149,7 @@ Use `@private` if a property or variable is a private variable (default is `@pub The top of each *file* should contain a `@module` tag. Modules should correspond to JavaScript files (or require.js modules). They can work as groups in the lists of items. See [here](https://p5js.org/reference/#collection-list-nav) (the modules are COLOR, IMAGE, IO, PVECTOR, etc.). -``` +```js /** * @module image */ @@ -163,7 +163,7 @@ define(function (require) { Constructors are defined with `@class`. Each constructor should have the tag `@class` followed by the name of the class, as well as the tag `@constructor`, and any `@param` tags required. -``` +```js /** * The p5 constructor function. * @class p5 diff --git a/contributor_docs/ko/README.md b/contributor_docs/ko/README.md index 30ecb2f78e..bf770b4736 100644 --- a/contributor_docs/ko/README.md +++ b/contributor_docs/ko/README.md @@ -75,20 +75,20 @@ p5.js 프로젝트의 핵심적인 저장소들은 아래와 같습니다: 3. 포크 된 깃허브 저장소를 로컬 컴퓨터에 [클론](https://help.github.com/articles/cloning-a-repository/) 하십시오. - ``` + ```shell $ git clone https://github.com/YOUR_USERNAME/p5.js.git ``` 4. 프로젝트 폴더로 들어가 npm에 필요한 모든 디펜던시를 설치하십시오. - ``` + ```shell $ cd p5.js $ npm ci ``` 5. 이제 [Grunt](https://gruntjs.com/)가 설치되었을텐데, 소스 코드로부터 라이브러리를 빌드하기 위해 이를 이용할 수 있습니다. - ``` + ```shell $ npm run grunt ``` @@ -96,7 +96,7 @@ p5.js 프로젝트의 핵심적인 저장소들은 아래와 같습니다: 6. 로컬에서 코드 베이스를 변경하고, 깃(Git)으로 [커밋](https://help.github.com/articles/github-glossary/#commit) 하십시오. - ``` + ```shell $ git add -u $ git commit -m "YOUR COMMIT MESSAGE" ``` @@ -105,7 +105,7 @@ p5.js 프로젝트의 핵심적인 저장소들은 아래와 같습니다: 8. 변경 사항을 여러분의 깃허브 포크에 [푸시](https://help.github.com/articles/github-glossary/#push) 하십시오. - ``` + ```shell $ git push ``` @@ -123,13 +123,13 @@ p5.js는 깔끔하고 일관성 있는 스타일의 코드 문법을 요구하 에러를 포착하기 위해서는 터미널에서 다음 명령어를 실행하세요(`$` 프롬프트는 입력하지 마십시오): -``` +```shell $ npm run lint ``` 어떤 문법 오류는 자동적으로 고쳐질 수도 있습니다: -``` +```shell $ npm run lint:fix ``` @@ -158,7 +158,7 @@ $ npm run lint:fix 유닛 테스트를 돌리기 위해서는 프로젝트의 디펜던시들을 반드시 설치해야 합니다. -``` +```shell $ npm ci ``` @@ -169,13 +169,13 @@ $ npm ci 디펜던시들이 설치되면, Grunt를 이용해 유닛 테스트를 돌리십시오. -``` +```shell $ grunt ``` 때론 커맨드 라인 대신 브라우저에서 테스트를 돌리는 것도 유용합니다. 이를 위해선, 먼저 서버 [연결](https://github.com/gruntjs/grunt-contrib-connect)을 시작하십시오: -``` +```shell $ npm run dev ``` diff --git a/contributor_docs/ko/inline_documentation.md b/contributor_docs/ko/inline_documentation.md index 8cba28438c..513a2e5bce 100644 --- a/contributor_docs/ko/inline_documentation.md +++ b/contributor_docs/ko/inline_documentation.md @@ -16,7 +16,7 @@ __[필요한 예제 목록](https://github.com/processing/p5.js/issues/1954) (gr * 가능하면 다른 함수나 변수명을 언급 할 때 다른 파일을 링크해주세요. 예를 들면, [loadImage](https://github.com/processing/p5.js/blob/main/src/image/loading_displaying.js#L21)에 대한 설명과 링크가 추가된 사전로드 방법을 살펴볼 수 있습니다. * 더 많은 구문 정보를 살펴보려면 [yuidoc의 레퍼런스](http://yui.github.io/yuidoc/syntax/index.html#basic-requirements)를 참조해주세요. -``` +```js /** * The x component of the vector * @property x @@ -25,7 +25,7 @@ __[필요한 예제 목록](https://github.com/processing/p5.js/issues/1954) (gr this.x = x || 0; ``` -``` +```js /** * Draw an arc @@ -45,7 +45,7 @@ __[필요한 예제 목록](https://github.com/processing/p5.js/issues/1954) (gr */ ``` -``` +```js /** * * Calculates the magnitude (length) of the vector and returns the result @@ -97,7 +97,7 @@ __[필요한 예제 목록](https://github.com/processing/p5.js/issues/1954) (gr 메서드에 여러개의 가능한 매개 변수 옵션이 있을 경우 각각을 개별적으로 지정할 수 있습니다. 예를 들면 "syntax" 아래에 [background](http://p5js.org/reference/#p5/background)의 예제를 참조해주세요. 이렇게 하기 위해서 위의 지침에 따라 첫 번째로 표기하여 나열 할 버전 하나를 선택해주세요. 문서 블록의 끝에서 다음 예제에 따라 자체 블록에 추가 표기를 할 수 있습니다. -``` +```js /** * @method background * @param {String} colorstring color string, possible formats include: integer @@ -122,7 +122,7 @@ __[필요한 예제 목록](https://github.com/processing/p5.js/issues/1954) (gr 프로퍼티 또는 변수가 상수 인 경우 `@final` 사용합니다: -``` +```js /** * PI is a mathematical constant with the value 3.14159265358979323846. * @property PI @@ -135,7 +135,7 @@ __[필요한 예제 목록](https://github.com/processing/p5.js/issues/1954) (gr 프로퍼티 또는 변수가 private 변수 인 경우 `@private`를 사용합니다 (기본값은 `@public`이므로 지정할 필요가 없음). -``` +```js /** * _start calls preload() setup() and draw() * @@ -149,7 +149,7 @@ __[필요한 예제 목록](https://github.com/processing/p5.js/issues/1954) (gr 각 *파일* 상단에는 `@module` 태그가 있어야합니다. 모듈은 JavaScript 파일 (또는 require.js 모듈)과 일치해야 하며, 항목리스트에서 그룹으로 작업할 수 있습니다. 여기를 참조해주세요: http://p5js.org/api/#methods(모듈은 COLOR, IMAGE, PVECTOR 등이 있습니다.) -``` +```js /** * @module image */ @@ -163,7 +163,7 @@ define(function (require) { 생성자는 `@class`로 정의됩니다. 각 생성자는 `@class` 태그와 클래스명, `@constructor` 태그 및 필요한 모든 `@param` 태그를 가지고 있어야 합니다. -``` +```js /** * The p5 constructor function. * @class p5 diff --git a/contributor_docs/ko/release_process.md b/contributor_docs/ko/release_process.md index 32df4de3dd..72808ffca4 100644 --- a/contributor_docs/ko/release_process.md +++ b/contributor_docs/ko/release_process.md @@ -10,8 +10,8 @@ * 높은 대역폭: 다운로드/풀/푸쉬 할것이 많습니다. (총 \~190MB 예상) ## 사용법 -``` -npm run release +```shell +$ npm run release ``` * 빌드 단계가 실행되며 프로세스를 마치려면 `np`에서 제공하는 프롬프트를 따라야합니다. diff --git a/contributor_docs/ko/unit_testing.md b/contributor_docs/ko/unit_testing.md index 8d20119b07..7aa88646e6 100644 --- a/contributor_docs/ko/unit_testing.md +++ b/contributor_docs/ko/unit_testing.md @@ -93,7 +93,7 @@ p5.js 레파지토리에서 풀리퀘스트를 오픈하면, 자동으로 [테 `p5.prototype.isKeyPressed`를 위한 테스트 스위트를 생성하고, 테스트를 작성할 수 잇습니다. 단위테스트를 구성하기 위해 mocha를 사용할 것입니다. -``` +```js suite('p5.prototype.keyIsPressed', function() { test('keyIsPressed is a boolean', function() { //이곳에서 테스트 작성 @@ -113,7 +113,7 @@ suite('p5.prototype.keyIsPressed', function() { 다음을 고려해 보세요: -``` +```js test('keyIsPressed is a boolean', function() { assert.isBoolean(myp5.keyIsPressed); //해당 값이 boolean인지 확인 }); diff --git a/contributor_docs/project_wrapups/sakshamsaxena_gsoc_2017.md b/contributor_docs/project_wrapups/sakshamsaxena_gsoc_2017.md index 7b7a655194..967fcf4509 100644 --- a/contributor_docs/project_wrapups/sakshamsaxena_gsoc_2017.md +++ b/contributor_docs/project_wrapups/sakshamsaxena_gsoc_2017.md @@ -20,8 +20,8 @@ Some helpful comments are added alongside to make the experience of reporting an This task was inspired by [Issue #94](https://github.com/processing/p5.js/issues/94). The goal was to implement such a functionality which enables users to select the desired components/modules which they want to use, and only those components would be bundled then itself to generate a custom build of p5.js. Currently, the usage is through invoking a Grunt task manually from the command line : -``` -grunt combineModules:module_a[:module_b][:module_c] +```shell +$ grunt combineModules:module_a[:module_b][:module_c] ``` where `module_X` refers to the name of the _*folder*_ of the desired component, viz. : ``` diff --git a/contributor_docs/release_process.md b/contributor_docs/release_process.md index fe2952f707..bdf3a57745 100644 --- a/contributor_docs/release_process.md +++ b/contributor_docs/release_process.md @@ -10,8 +10,8 @@ * High Bandwidth : Lots of things to download/pull/push (\~190 MB total I presume) ## Usage -``` -npm run release +```shell +$ npm run release ``` * This will run the build steps and you should follow the prompt provided by `np` to finish the process. diff --git a/contributor_docs/sk/README.md b/contributor_docs/sk/README.md index e2a98f0d57..76e92d8396 100644 --- a/contributor_docs/sk/README.md +++ b/contributor_docs/sk/README.md @@ -46,13 +46,13 @@ Vývojárske nástroje zahrnuté v kóde p5.js sú zámerne veľmi striktné oh p5.js požaduje čistý a štylisticky konzistentnú syntax kódu, ktorá je presadzovaná pomocou [Prettier](https://prettier.io/) a [ESlint](https://eslint.org/). Pravidlá sa kontrolujú pred odovzdaním kódu, avšak môžes si nainštalovať [ESlint plugin](https://eslint.org/docs/user-guide/integrations#editors) do svojho editora kódu, aby ti zvýraznil chyby hneď ako ich píšeš, čo ti pravdepodobne pomože predčasne predísť problémom s odovzdaním kódu s Gitom. Vo všeobecnosti sa mýlime na strane flexibility, pokiaľ ide o štýl kódovania, aby sme znížili prekážky účasti a príspevku. Pre odhalenie chýb vykonaj nasledujúci príkaz vo svojom oblúbenom príkazovom riadku (nepíš znak `$`): -``` +```shell $ npm run lint ``` Niektoré syntaktické chyby je však možné opraviť automaticky pomocou príkazu: -``` +```shell $ npm run lint:fix ``` Lepšie je držať sa zavedeného štýlu projektu, ale [príležitostne](https://github.com/processing/p5.js/search?utf8=%E2%9C%93&q=prettier-ignore&type=) by sa mohla použiť alternatívna syntax. Uľahčite tým pochopenie kódu. V týchto prípadoch Prettier [ponúka výnimky](https://prettier.io/docs/en/ignore.html), komentár `// prettier-ignore`, ktorý môžete použiť na získanie podrobných výnimiek. Pokúste sa vyhnúť použitiu tohto, ak je to možné, pretože existujú dobré dôvody pre väčšinu preferencií štýlov vynútených štylistickým procesorom. @@ -72,7 +72,7 @@ Unit testy sú malé časti kódu, ktoré sú vytvorené ako doplnok k hlavnej l Aby bolo možné spustiť unit testy, budeš musieť nainštalovať závislosti projektu. -``` +```shell $ npm ci ``` @@ -83,13 +83,13 @@ Tento príkaz nainštaluje *všetky* závislosti p5.js; stručne, najdôležitej Ak sú závislosti nainštalované, použi Grunt pre spustenie unit testov. -``` +```shell $ grunt ``` Niekedy je užitočné spustiť testy v priamo v prehliadači miesto príkazového riadku. Aby si tak urobil, najprv naštartuj [connect](https://github.com/gruntjs/grunt-contrib-connect) server: -``` +```shell $ npm run dev ``` @@ -103,20 +103,20 @@ Kompletný návod k unit testovaniu je nad rámec rozsahu p5.js dokumentácie, a 2. [Rozvetvi](https://help.github.com/articles/fork-a-repo) [repozitár p5.js](https://github.com/processing/p5.js) do svojho GitHub účtu. 3. [Vyklonuj](https://help.github.com/articles/cloning-a-repository/) svoj novo-rozvetvený repozitár z GitHub-u do svoj lokálneho počítača. - ``` + ```shell $ git clone https://github.com/YOUR_USERNAME/p5.js.git ``` 4. Prejdi do priečniku projektu a nainštaluj všetky nevyhnutné závislosti s npm. - ``` + ```shell $ cd p5.js $ npm ci ``` 5. [Grunt](https://gruntjs.com/) by mal byť teraz nainštalovaný a môžeš ho teda použiť na vybudovanie knižnice zo zdrojového kódu. - ``` + ```shell $ npm run grunt ``` @@ -124,7 +124,7 @@ Kompletný návod k unit testovaniu je nad rámec rozsahu p5.js dokumentácie, a 6. Vykonaj nejaké zmeny v lokálnom kóde a [odovzdaj](https://help.github.com/articles/github-glossary/#commit) ich s Git-om. - ``` + ```shell $ git add -u $ git commit -m "YOUR COMMIT MESSAGE" ``` @@ -133,7 +133,7 @@ Kompletný návod k unit testovaniu je nad rámec rozsahu p5.js dokumentácie, a 8. [Vypropaguj](https://help.github.com/articles/github-glossary/#push) svoje nové zmeny do svojho rozvetveného repozitára na GitHub-e. - ``` + ```shell $ git push ``` @@ -145,7 +145,7 @@ Tento proces je tiež pokrytý [vo videu od The Coding Train.](https://youtu.be/ Vnorené komentáre v p5.js sa budujú do verejnej [referenčnej príručky](https://p5js.org/reference/). Túto príručku si vieš pozrieť aj lokálne: -``` +```shell $ npm run docs:dev ``` diff --git a/contributor_docs/unit_testing.md b/contributor_docs/unit_testing.md index e060752fa6..f0f4f76cab 100644 --- a/contributor_docs/unit_testing.md +++ b/contributor_docs/unit_testing.md @@ -11,7 +11,7 @@ Here's a [good, quick intro to unit testing](https://codeburst.io/javascript-uni In the repo root, use the following command in your terminal ```shellsession -npm test +$ npm test ``` ## Test Coverage @@ -91,7 +91,7 @@ Now you can think of various tests against this expected behaviour. Possible tes We can create a test suite for `p5.prototype.keyIsPressed` and start creating tests for it. We will use mocha for structuring our unit tests. -``` +```js suite('p5.prototype.keyIsPressed', function() { test('keyIsPressed is a boolean', function() { //write test here @@ -110,7 +110,7 @@ suite('p5.prototype.keyIsPressed', function() { We have structured out tests but we haven't written the tests yet. We will be using chai's assert for that. Consider the following: -``` +```js test('keyIsPressed is a boolean', function() { assert.isBoolean(myp5.keyIsPressed); //Asserts that value is a boolean. }); diff --git a/contributor_docs/zh/README.md b/contributor_docs/zh/README.md index db4864cfe0..ce10d2c29d 100644 --- a/contributor_docs/zh/README.md +++ b/contributor_docs/zh/README.md @@ -63,20 +63,20 @@ p5.js 项目除了这个代码库外还包括了以下几个其他的代码库 3. [复制](https://help.github.com/articles/cloning-a-repository/) 此代码库的新 fork 到本地电脑: - ``` + ```shell $ git clone https://github.com/您的用户名/p5.js.git ``` 4. 导航到项目文件夹,并使用 npm 安装其所有所需的程式包。 - ``` + ```shell $ cd p5.js $ npm ci ``` 5. [Grunt](https://gruntjs.com/) 需要被安装,您可以使用它从源代码构建程式库。 - ``` + ```shell $ npm run grunt ``` @@ -84,7 +84,7 @@ p5.js 项目除了这个代码库外还包括了以下几个其他的代码库 6. 在本地源代码更改然后用 Git [commit](https://help.github.com/articles/github-glossary/#commit) 它们。 - ``` + ```shell $ git add -u $ git commit -m "YOUR COMMIT MESSAGE" ``` @@ -93,7 +93,7 @@ p5.js 项目除了这个代码库外还包括了以下几个其他的代码库 8. 将您对 GitHub 上的 fork 上载([Push](https://help.github.com/articles/github-glossary/#push))新更改。 - ``` + ```shell $ git push ``` @@ -109,13 +109,13 @@ p5.js 要求整齐且在风格上一致的代码语法,它使用称为 [Pretti 要检查错误,在命令行输入以下指令(不要键入 `$` 提示符): -``` +```shell $ npm run lint ``` 一些语法错误可以自动修复: -``` +```shell $ npm run lint:fix ``` @@ -142,7 +142,7 @@ $ npm run lint:fix 以运行单元测试,您需要确保已安装项目的依赖项。 -``` +```shell $ npm ci ``` @@ -153,13 +153,13 @@ $ npm ci 一旦安装了依赖项,请使用Grunt运行单元测试。 -``` +```shell $ grunt ``` 在浏览器而不是命令行中运行测试有时很有用。 为此,请首先启动 [connect](https://github.com/gruntjs/grunt-contrib-connect) 服务器: -``` +```shell $ npm run dev ``` From 69509891fddba6357b818d9fa6f5f60a0261d3c4 Mon Sep 17 00:00:00 2001 From: stampyzfanz <34364128+stampyzfanz@users.noreply.github.com> Date: Wed, 2 Feb 2022 19:48:37 +1100 Subject: [PATCH 015/131] docs(contributing md): add $ prefix to shell code blocks --- contributor_docs/hi/preparing_a_pull_request.md | 12 ++++++------ contributor_docs/ko/preparing_a_pull_request.md | 12 ++++++------ contributor_docs/preparing_a_pull_request.md | 10 +++++----- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/contributor_docs/hi/preparing_a_pull_request.md b/contributor_docs/hi/preparing_a_pull_request.md index 694dd139f3..6ce9587380 100644 --- a/contributor_docs/hi/preparing_a_pull_request.md +++ b/contributor_docs/hi/preparing_a_pull_request.md @@ -12,21 +12,21 @@ ### परिवर्तनों के बारे में जानें सुनिश्चित करें कि आप अपस्ट्रीम p5.js रिपॉजिटरी को ट्रैक कर रहे हैं। - git remote show upstream + $ git remote show upstream यदि आपको कोई त्रुटि दिखाई देती है, तो आपको "upstream" रिमोट रिपॉजिटरी के रूप में मुख्य p5.js रेपो को ट्रैक करना शुरू करना होगा। आपको केवल एक बार ऐसा करने की आवश्यकता होगी! लेकिन, अगर आप इसे दूसरी बार चलाते हैं तो कोई नुकसान नहीं होता है। - git remote add upstream https://github.com/processing/p5.js + $ git remote add upstream https://github.com/processing/p5.js फिर नवीनतम परिवर्तनों के बारे में पूछें। - git fetch upstream + $ git fetch upstream ### शायद ज़रुरत पड़े- एक नई शाखा में अपने परिवर्तनों की एक प्रति बनाएँ - git branch your-branch-name-backup + $ git branch your-branch-name-backup ### मुख्य शाखा से परिवर्तन लागू करता है, *बाद में* अपने परिवर्तन जोड़ता है - git rebase upstream/main + $ git rebase upstream/main ### विवादों का समाधान आपकी शाखा में कुछ उलझनें हो सकती हैं! @@ -39,7 +39,7 @@ यदि आपके पास अन्य फ़ाइलों में विरोध है और आप सुनिश्चित नहीं हैं कि उन्हें कैसे हल किया जाए ... मदद के लिए पूछें! ### और अंत में, महान गौरव के लिए - git push origin + $ git push origin यदि आप तकनीकी विवरणों के बारे में गहन जानकारी प्राप्त कर रहे हैं, तो रेबेसिंग पर एक अच्छा संदर्भ है। https://www.atlassian.com/git/tutorials/merging-vs-rebasing diff --git a/contributor_docs/ko/preparing_a_pull_request.md b/contributor_docs/ko/preparing_a_pull_request.md index f265d44832..059191b5a7 100644 --- a/contributor_docs/ko/preparing_a_pull_request.md +++ b/contributor_docs/ko/preparing_a_pull_request.md @@ -12,21 +12,21 @@ ### 변경사항을 확인해주세요 upstream p5.js 저장소를 트래킹하고 있는지 확인해주세요. - git remote show upstream + $ git remote show upstream 에러를 보게 되면, 메인 p5.js 저장소를 "upstream" 원격 저장소로 트래킹해야 합니다. 이 작업은 한 번만 하면 됩니다! 하지만, 두 번 실행해도 아무 문제 없습니다. - git remote add upstream https://github.com/processing/p5.js + $ git remote add upstream https://github.com/processing/p5.js 그런 다음 git에서 최신 변경 사항을 확인해 봅니다. - git fetch upstream + $ git fetch upstream ### 만일의 경우를 대비해, 변경사항을 새 브랜치로 복사하세요. - git branch your-branch-name-backup + $ git branch your-branch-name-backup ### main 브랜치로부터의 변경사항을 *적용한 후* 여러분이 작업한 변경 사항을 추가하세요 - git rebase upstream/main + $ git rebase upstream/main ### 충돌 해결하기 충돌이 있을 수 있습니다! @@ -39,7 +39,7 @@ lib/p5.js와 lib/p5.min.js라면 쉽게 고칠 수 있습니다. grunt로 프로 다른 파일과 충돌이 있고, 어떻게 해결해야 하는지 모른다면... 도움을 요청해 주세요! ### 마침내 - git push origin + $ git push origin 기술적으로 세부사항에 대해 궁금한 점이 있을 경우, 여기 리베이싱에 대한 좋은 레퍼런스가 있습니다. https://www.atlassian.com/git/tutorials/merging-vs-rebasing diff --git a/contributor_docs/preparing_a_pull_request.md b/contributor_docs/preparing_a_pull_request.md index a8d2e37200..fd461ded82 100644 --- a/contributor_docs/preparing_a_pull_request.md +++ b/contributor_docs/preparing_a_pull_request.md @@ -12,18 +12,18 @@ Pull-requests are easier when your code is up to date! You can use git rebase to ### Find out about changes Make sure you're tracking upstream p5.js repository. - git remote show upstream + $ git remote show upstream If you see an error, you'll need to start tracking the main p5.js repo as an "upstream" remote repository. You'll only need to do this once! But, no harm is done if you run it a second time. - git remote add upstream https://github.com/processing/p5.js + $ git remote add upstream https://github.com/processing/p5.js Then ask git about the latest changes. - git fetch upstream + $ git fetch upstream ### Just in case: make a copy of your changes in a new branch - git branch your-branch-name-backup + $ git branch your-branch-name-backup ### Apply changes from main branch, adds your changes *after* git rebase upstream/main @@ -39,7 +39,7 @@ If it’s just lib/p5.js and lib/p5.min.js, it’s easy to fix. just build the p If you have conflicts in other files & you're not sure how to resolve them... ask for help! ### And finally, for great glory - git push origin + $ git push origin Here's a good reference on rebasing, in case you're intensely curious about the technical details. https://www.atlassian.com/git/tutorials/merging-vs-rebasing From 59199cfad20d8aee97283af281eb380fbbdc3e3a Mon Sep 17 00:00:00 2001 From: stampyzfanz <34364128+stampyzfanz@users.noreply.github.com> Date: Wed, 2 Feb 2022 21:19:56 +1100 Subject: [PATCH 016/131] docs(contributing/organization.md): correct small word error --- contributor_docs/organization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributor_docs/organization.md b/contributor_docs/organization.md index f788685b3b..f42c008ea6 100644 --- a/contributor_docs/organization.md +++ b/contributor_docs/organization.md @@ -19,7 +19,7 @@ Helping with organization can be a great way to contribute. If a bug report is m ## Pull Requests - **All pull requests should be associated with an issue** - If you want to fix a bug or add a feature, start by opening an issue so the community can discuss it. - - If a pull request is opened without an associated issue, comment and ask the contributor to open a pull request. + - If a pull request is opened without an associated issue, comment and ask the contributor to open an issue. From e9f3a06ee1161de0e3a18eb1d8455d72b8ae0ad9 Mon Sep 17 00:00:00 2001 From: Zearin Date: Sat, 5 Feb 2022 10:28:19 -0500 Subject: [PATCH 017/131] docs(src/data): Use `describe()` instead of `@alt` --- src/data/local_storage.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/data/local_storage.js b/src/data/local_storage.js index cd19af5597..c316da5ad2 100644 --- a/src/data/local_storage.js +++ b/src/data/local_storage.js @@ -39,6 +39,8 @@ import p5 from '../core/main'; * if (myText === null) { * myText = ''; * } + * describe(`When you type the key name is displayed as black text on white background. + * If you reload the page, the last letter typed is still displaying.`); * } * * function draw() { @@ -52,10 +54,6 @@ import p5 from '../core/main'; * storeItem('myText', myText); * } *
- * - * @alt - * When you type the key name is displayed as black text on white background. - * If you reload the page, the last letter typed is still displaying. */ p5.prototype.storeItem = function(key, value) { if (typeof key !== 'string') { @@ -127,6 +125,9 @@ p5.prototype.storeItem = function(key, value) { * if (myColor !== null) { * background(myColor); * } + * describe(`If you click, the canvas changes to a random color.· + * If you reload the page, the canvas is still the color it was when the + * page was previously loaded.`); * } * * function mousePressed() { @@ -134,11 +135,6 @@ p5.prototype.storeItem = function(key, value) { * storeItem('myColor', myColor); * } *
- * - * @alt - * If you click, the canvas changes to a random color. - * If you reload the page, the canvas is still the color it - * was when the page was previously loaded. */ p5.prototype.getItem = function(key) { let value = localStorage.getItem(key); From b8c5da317372bf6ed3349c9b023b9b1203b26267 Mon Sep 17 00:00:00 2001 From: Reeju Bhattacharya Date: Sun, 6 Feb 2022 22:42:59 +0530 Subject: [PATCH 018/131] fixes issue #5191 along with minor grammatical edits --- src/events/mouse.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/events/mouse.js b/src/events/mouse.js index ae449c3191..5380952720 100644 --- a/src/events/mouse.js +++ b/src/events/mouse.js @@ -984,7 +984,10 @@ p5.prototype._onwheel = function(e) { * Note that not all browsers support this feature. * This enables you to create experiences that aren't limited by the mouse moving out of the screen * even if it is repeatedly moved into one direction. - * For example, a first person perspective experience. + * For example, a first person perspective experience. It is recommended to + * use requestPointerLock() as a result + * of any user interaction, like mouseClicked() + * or keyPressed() * * @method requestPointerLock * @example @@ -993,7 +996,6 @@ p5.prototype._onwheel = function(e) { * let cam; * function setup() { * createCanvas(100, 100, WEBGL); - * requestPointerLock(); * cam = createCamera(); * } * @@ -1003,6 +1005,10 @@ p5.prototype._onwheel = function(e) { * cam.tilt(movedY * 0.001); * sphere(25); * } + * + * function mouseClicked() { + * requestPointerLock(); + * } *
*
* @@ -1024,8 +1030,8 @@ p5.prototype.requestPointerLock = function() { /** * The function exitPointerLock() - * exits a previously triggered pointer Lock - * for example to make ui elements usable etc + * exits a previously triggered pointer Lock. + * For example, it might be used to make UI elements usable once again. * * @method exitPointerLock * @example From 2adf53d5d47d8abd52b85442220a3a284e60e093 Mon Sep 17 00:00:00 2001 From: Zearin Date: Sun, 6 Feb 2022 12:29:47 -0500 Subject: [PATCH 019/131] docs(src/events): Use `describe()` instead of `@alt` Addresses #5139 --- src/events/acceleration.js | 72 ++++++++++---------------- src/events/keyboard.js | 39 ++++++-------- src/events/mouse.js | 102 +++++++++++++------------------------ src/events/touch.js | 26 ++++------ 4 files changed, 90 insertions(+), 149 deletions(-) diff --git a/src/events/acceleration.js b/src/events/acceleration.js index 0021609549..7ca8f371aa 100644 --- a/src/events/acceleration.js +++ b/src/events/acceleration.js @@ -35,11 +35,10 @@ p5.prototype.deviceOrientation = * background(220, 50); * fill('magenta'); * ellipse(width / 2, height / 2, accelerationX); + * describe('Magnitude of device acceleration is displayed as ellipse size.'); * } * *
- * @alt - * Magnitude of device acceleration is displayed as ellipse size */ p5.prototype.accelerationX = 0; @@ -58,11 +57,10 @@ p5.prototype.accelerationX = 0; * background(220, 50); * fill('magenta'); * ellipse(width / 2, height / 2, accelerationY); + * describe('Magnitude of device acceleration is displayed as ellipse size'); * } *
*
- * @alt - * Magnitude of device acceleration is displayed as ellipse size */ p5.prototype.accelerationY = 0; @@ -82,12 +80,10 @@ p5.prototype.accelerationY = 0; * background(220, 50); * fill('magenta'); * ellipse(width / 2, height / 2, accelerationZ); + * describe('Magnitude of device acceleration is displayed as ellipse size'); * } *
*
- * - * @alt - * Magnitude of device acceleration is displayed as ellipse size */ p5.prototype.accelerationZ = 0; @@ -157,11 +153,11 @@ p5.prototype._updatePAccelerations = function() { * rotateX(radians(rotationX)); * //rotateY(radians(rotationY)); * box(200, 200, 200); + * describe(`red horizontal line right, green vertical line bottom. + * black background.`); * } * *
- * @alt - * red horizontal line right, green vertical line bottom. black background. */ p5.prototype.rotationX = 0; @@ -190,11 +186,11 @@ p5.prototype.rotationX = 0; * //rotateX(radians(rotationX)); * rotateY(radians(rotationY)); * box(200, 200, 200); + * describe(`red horizontal line right, green vertical line bottom. + * black background.`); * } *
*
- * @alt - * red horizontal line right, green vertical line bottom. black background. */ p5.prototype.rotationY = 0; @@ -224,15 +220,14 @@ p5.prototype.rotationY = 0; * //rotateX(radians(rotationX)); * //rotateY(radians(rotationY)); * box(200, 200, 200); + * describe(`red horizontal line right, green vertical line bottom. + * black background.`); * } * *
* * @property {Number} rotationZ * @readOnly - * - * @alt - * red horizontal line right, green vertical line bottom. black background. */ p5.prototype.rotationZ = 0; @@ -271,12 +266,10 @@ p5.prototype.rotationZ = 0; * } * * print(rotateDirection); + * describe('no image to display.'); * *
* - * @alt - * no image to display. - * * @property {Number} pRotationX * @readOnly */ @@ -316,12 +309,10 @@ p5.prototype.pRotationX = 0; * rotateDirection = 'counter-clockwise'; * } * print(rotateDirection); + * describe('no image to display.'); *
*
* - * @alt - * no image to display. - * * @property {Number} pRotationY * @readOnly */ @@ -357,12 +348,10 @@ p5.prototype.pRotationY = 0; * rotateDirection = 'counter-clockwise'; * } * print(rotateDirection); + * describe('no image to display.'); * *
* - * @alt - * no image to display. - * * @property {Number} pRotationZ * @readOnly */ @@ -403,6 +392,10 @@ p5.prototype._updatePRotations = function() { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`50×50 black rect in center of canvas. + * turns white on mobile when device turns`); + * describe(`50×50 black rect in center of canvas. + * turns white on mobile when x-axis turns`); * } * function deviceTurned() { * if (turnAxis === 'X') { @@ -415,10 +408,6 @@ p5.prototype._updatePRotations = function() { * } * *
- * - * @alt - * 50×50 black rect in center of canvas. turns white on mobile when device turns - * 50×50 black rect in center of canvas. turns white on mobile when x-axis turns */ p5.prototype.turnAxis = undefined; @@ -446,6 +435,8 @@ let shake_threshold = 30; * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`50×50 black rect in center of canvas. + * turns white on mobile when device moves`); * } * function deviceMoved() { * value = value + 5; @@ -458,9 +449,6 @@ let shake_threshold = 30; * } *
*
- * - * @alt - * 50×50 black rect in center of canvas. turns white on mobile when device moves */ p5.prototype.setMoveThreshold = function(val) { @@ -489,6 +477,8 @@ p5.prototype.setMoveThreshold = function(val) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`50×50 black rect in center of canvas. + * turns white on mobile when device is being shaked`); * } * function deviceMoved() { * value = value + 5; @@ -501,10 +491,6 @@ p5.prototype.setMoveThreshold = function(val) { * } *
*
- * - * @alt - * 50×50 black rect in center of canvas. turns white on mobile when device - * is being shaked */ p5.prototype.setShakeThreshold = function(val) { @@ -529,6 +515,8 @@ p5.prototype.setShakeThreshold = function(val) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`50×50 black rect in center of canvas. + * turns white on mobile when device moves`); * } * function deviceMoved() { * value = value + 5; @@ -538,9 +526,6 @@ p5.prototype.setShakeThreshold = function(val) { * } * *
- * - * @alt - * 50×50 black rect in center of canvas. turns white on mobile when device moves */ /** @@ -583,6 +568,10 @@ p5.prototype.setShakeThreshold = function(val) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`50×50 black rect in center of canvas. + * turns white on mobile when device turns`); + * describe(`50×50 black rect in center of canvas. + * turns white on mobile when x-axis turns`); * } * function deviceTurned() { * if (turnAxis === 'X') { @@ -595,10 +584,6 @@ p5.prototype.setShakeThreshold = function(val) { * } *
*
- * - * @alt - * 50×50 black rect in center of canvas. turns white on mobile when device turns - * 50×50 black rect in center of canvas. turns white on mobile when x-axis turns */ /** @@ -618,6 +603,8 @@ p5.prototype.setShakeThreshold = function(val) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`50×50 black rect in center of canvas. + * turns white on mobile when device shakes`); * } * function deviceShaken() { * value = value + 5; @@ -627,9 +614,6 @@ p5.prototype.setShakeThreshold = function(val) { * } *
*
- * - * @alt - * 50×50 black rect in center of canvas. turns white on mobile when device shakes */ p5.prototype._ondeviceorientation = function(e) { diff --git a/src/events/keyboard.js b/src/events/keyboard.js index 4ee87f313f..228567e0e1 100644 --- a/src/events/keyboard.js +++ b/src/events/keyboard.js @@ -23,12 +23,10 @@ import p5 from '../core/main'; * fill(255); * } * rect(25, 25, 50, 50); + * describe('50×50 white rect that turns black on keypress.'); * } * *
- * - * @alt - * 50×50 white rect that turns black on keypress. */ p5.prototype.isKeyPressed = false; p5.prototype.keyIsPressed = false; // khan @@ -53,11 +51,9 @@ p5.prototype.keyIsPressed = false; // khan * function draw() { * background(200); * text(key, 33, 65); // Display last key pressed. + * describe('canvas displays any key value that is pressed in pink font.'); * } *
- * - * @alt - * canvas displays any key value that is pressed in pink font. */ p5.prototype.key = ''; @@ -76,6 +72,8 @@ p5.prototype.key = ''; * function draw() { * fill(fillVal); * rect(25, 25, 50, 50); + * describe(`Grey rect center. turns white when up arrow pressed and black when down. + * Display key pressed and its keyCode in a yellow box.`); * } * * function keyPressed() { @@ -94,9 +92,6 @@ p5.prototype.key = ''; * print(key, ' ', keyCode); * } *
- * @alt - * Grey rect center. turns white when up arrow pressed and black when down - * Display key pressed and its keyCode in a yellow box */ p5.prototype.keyCode = 0; @@ -130,6 +125,8 @@ p5.prototype.keyCode = 0; * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`black rect center. turns white when key pressed and black + * when released.`); * } * function keyPressed() { * if (value === 0) { @@ -146,6 +143,8 @@ p5.prototype.keyCode = 0; * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`black rect center. turns white when left arrow pressed and + * black when right.`); * } * function keyPressed() { * if (keyCode === LEFT_ARROW) { @@ -164,10 +163,6 @@ p5.prototype.keyCode = 0; * } *
*
- * - * @alt - * black rect center. turns white when key pressed and black when released - * black rect center. turns white when left arrow pressed and black when right. */ p5.prototype._onkeydown = function(e) { if (this._downKeys[e.which]) { @@ -203,6 +198,8 @@ p5.prototype._onkeydown = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`black rect center. turns white when key pressed and black + * when pressed again`); * } * function keyReleased() { * if (value === 0) { @@ -214,9 +211,6 @@ p5.prototype._onkeydown = function(e) { * } * *
- * - * @alt - * black rect center. turns white when key pressed and black when pressed again */ p5.prototype._onkeyup = function(e) { this._downKeys[e.which] = false; @@ -263,6 +257,8 @@ p5.prototype._onkeyup = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`black rect center. turns white when 'a' key typed and + * black when 'b' pressed`); * } * function keyTyped() { * if (key === 'a') { @@ -275,9 +271,6 @@ p5.prototype._onkeyup = function(e) { * } * *
- * - * @alt - * black rect center. turns white when 'a' key typed and black when 'b' pressed */ p5.prototype._onkeypress = function(e) { if (e.which === this._lastKeyCodeTyped) { @@ -345,6 +338,8 @@ p5.prototype._onblur = function(e) { * * clear(); * ellipse(x, y, 50, 50); + * describe(`50×50 red ellipse moves left, right, up, and + * down with arrow presses.`); * } *
* @@ -369,12 +364,10 @@ p5.prototype._onblur = function(e) { * clear(); * fill(255, 0, 0); * ellipse(50, 50, diameter, diameter); + * describe(`50×50 red ellipse gets bigger or smaller when + * + or - are pressed.`); * } *
- * - * @alt - * 50×50 red ellipse moves left, right, up and down with arrow presses. - * 50×50 red ellipse gets bigger or smaller when + or - are pressed. */ p5.prototype.keyIsDown = function(code) { p5._validateParameters('keyIsDown', arguments); diff --git a/src/events/mouse.js b/src/events/mouse.js index ae449c3191..a8e3df0878 100644 --- a/src/events/mouse.js +++ b/src/events/mouse.js @@ -32,11 +32,11 @@ import * as constants from '../core/constants'; * background(237, 34, 93); * fill(0); * rect(x, 50, 50, 50); + * describe(`box moves left and right according to mouse movement + * then slowly back towards the center`); * } *
*
- * @alt - * box moves left and right according to mouse movement then slowly back towards the center */ p5.prototype.movedX = 0; @@ -62,11 +62,11 @@ p5.prototype.movedX = 0; * background(237, 34, 93); * fill(0); * rect(y, 50, 50, 50); + * describe(`box moves up and down according to mouse movement then + * slowly back towards the center`); * } * *
- * @alt - * box moves up and down according to mouse movement then slowly back towards the center */ p5.prototype.movedY = 0; /* @@ -94,12 +94,10 @@ p5.prototype._hasMouseInteracted = false; * function draw() { * background(244, 248, 252); * line(mouseX, 0, mouseX, 100); + * describe(`horizontal black line moves left and right with mouse x-position`); * } * *
- * - * @alt - * horizontal black line moves left and right with mouse x-position */ p5.prototype.mouseX = 0; @@ -120,12 +118,10 @@ p5.prototype.mouseX = 0; * function draw() { * background(244, 248, 252); * line(0, mouseY, 100, mouseY); + * describe(`vertical black line moves up and down with mouse y-position`); * } * * - * - * @alt - * vertical black line moves up and down with mouse y-position */ p5.prototype.mouseY = 0; @@ -152,12 +148,11 @@ p5.prototype.mouseY = 0; * background(244, 248, 252); * line(mouseX, mouseY, pmouseX, pmouseY); * print(pmouseX + ' -> ' + mouseX); + * describe(`line trail is created from cursor movements. + * faster movement make longer line.`); * } * * - * - * @alt - * line trail is created from cursor movements. faster movement make longer line. */ p5.prototype.pmouseX = 0; @@ -183,12 +178,11 @@ p5.prototype.pmouseX = 0; * } * * print(pmouseY + ' -> ' + mouseY); + * describe(`60×60 black rect center, fuchsia background. + * rect flickers on mouse movement`); * } * * - * - * @alt - * 60×60 black rect center, fuchsia background. rect flickers on mouse movement */ p5.prototype.pmouseY = 0; @@ -221,12 +215,11 @@ p5.prototype.pmouseY = 0; * * //the y of the square is relative to the canvas * rect(20, mouseY, 60, 60); + * describe(`60×60 black rect y moves with mouse y and fuchsia + * canvas moves with mouse x`); * } * * - * - * @alt - * 60×60 black rect y moves with mouse y and fuchsia canvas moves with mouse x */ p5.prototype.winMouseX = 0; @@ -259,12 +252,11 @@ p5.prototype.winMouseX = 0; * * //the x of the square is relative to the canvas * rect(mouseX, 20, 60, 60); + * describe(`60×60 black rect x moves with mouse x and + * fuchsia canvas y moves with mouse y`); * } * * - * - * @alt - * 60×60 black rect x moves with mouse x and fuchsia canvas y moves with mouse y */ p5.prototype.winMouseY = 0; @@ -299,12 +291,11 @@ p5.prototype.winMouseY = 0; * ellipse(50, 50, 10 + speed * 5, 10 + speed * 5); * //move the canvas to the mouse position * myCanvas.position(winMouseX + 1, winMouseY + 1); + * describe(`fuchsia ellipse moves with mouse x and y. + * Grows and shrinks with mouse speed`); * } * * - * - * @alt - * fuchsia ellipse moves with mouse x and y. Grows and shrinks with mouse speed */ p5.prototype.pwinMouseX = 0; @@ -339,12 +330,11 @@ p5.prototype.pwinMouseX = 0; * ellipse(50, 50, 10 + speed * 5, 10 + speed * 5); * //move the canvas to the mouse position * myCanvas.position(winMouseX + 1, winMouseY + 1); + * describe(`fuchsia ellipse moves with mouse x and y. + * Grows and shrinks with mouse speed`); * } * * - * - * @alt - * fuchsia ellipse moves with mouse x and y. Grows and shrinks with mouse speed */ p5.prototype.pwinMouseY = 0; @@ -377,12 +367,11 @@ p5.prototype.pwinMouseY = 0; * } * * print(mouseButton); + * describe(`50×50 black ellipse appears on center of fuchsia + * canvas on mouse click/press.`); * } * * - * - * @alt - * 50×50 black ellipse appears on center of fuchsia canvas on mouse click/press. */ p5.prototype.mouseButton = 0; @@ -407,12 +396,11 @@ p5.prototype.mouseButton = 0; * } * * print(mouseIsPressed); + * describe(`black 50×50 rect becomes ellipse with mouse click/press. + * fuchsia background.`); * } * * - * - * @alt - * black 50×50 rect becomes ellipse with mouse click/press. fuchsia background. */ p5.prototype.mouseIsPressed = false; @@ -497,6 +485,8 @@ p5.prototype._setMouseButton = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`black 50×50 rect becomes lighter with mouse movements until + * white then resets no image displayed`); * } * function mouseMoved() { * value = value + 5; @@ -526,10 +516,6 @@ p5.prototype._setMouseButton = function(e) { * } * * - * - * @alt - * black 50×50 rect becomes lighter with mouse movements until white then resets - * no image displayed */ /** @@ -552,6 +538,8 @@ p5.prototype._setMouseButton = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`black 50×50 rect turns lighter with mouse click and + * drag until white, resets`); * } * function mouseDragged() { * value = value + 5; @@ -581,10 +569,6 @@ p5.prototype._setMouseButton = function(e) { * } * * - * - * @alt - * black 50×50 rect turns lighter with mouse click and drag until white, resets - * no image displayed */ p5.prototype._onmousemove = function(e) { const context = this._isGlobal ? window : this; @@ -634,6 +618,7 @@ p5.prototype._onmousemove = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`black 50×50 rect turns white with mouse click/press.`); * } * function mousePressed() { * if (value === 0) { @@ -664,10 +649,6 @@ p5.prototype._onmousemove = function(e) { * } * * - * - * @alt - * black 50×50 rect turns white with mouse click/press. - * no image displayed */ p5.prototype._onmousedown = function(e) { const context = this._isGlobal ? window : this; @@ -714,6 +695,7 @@ p5.prototype._onmousedown = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`black 50×50 rect turns white with mouse click/press.`); * } * function mouseReleased() { * if (value === 0) { @@ -744,10 +726,6 @@ p5.prototype._onmousedown = function(e) { * } * * - * - * @alt - * black 50×50 rect turns white with mouse click/press. - * no image displayed */ p5.prototype._onmouseup = function(e) { const context = this._isGlobal ? window : this; @@ -792,6 +770,7 @@ p5.prototype._ondragover = p5.prototype._onmousemove; * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`black 50×50 rect turns white with mouse click/press.`); * } * * function mouseClicked() { @@ -823,10 +802,6 @@ p5.prototype._ondragover = p5.prototype._onmousemove; * } * * - * - * @alt - * black 50×50 rect turns white with mouse click/press. - * no image displayed */ p5.prototype._onclick = function(e) { const context = this._isGlobal ? window : this; @@ -860,6 +835,7 @@ p5.prototype._onclick = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`black 50×50 rect turns white with mouse doubleClick/press.`); * } * * function doubleClicked() { @@ -891,10 +867,6 @@ p5.prototype._onclick = function(e) { * } * * - * - * @alt - * black 50×50 rect turns white with mouse doubleClick/press. - * no image displayed */ p5.prototype._ondblclick = function(e) { @@ -949,6 +921,8 @@ p5.prototype._pmouseWheelDeltaY = 0; * background(237, 34, 93); * fill(0); * rect(25, pos, 50, 50); + * describe(`black 50×50 rect moves up and down with vertical scroll. + * fuchsia background`); * } * * function mouseWheel(event) { @@ -960,9 +934,6 @@ p5.prototype._pmouseWheelDeltaY = 0; * } * * - * - * @alt - * black 50×50 rect moves up and down with vertical scroll. fuchsia background */ p5.prototype._onwheel = function(e) { const context = this._isGlobal ? window : this; @@ -1002,12 +973,11 @@ p5.prototype._onwheel = function(e) { * cam.pan(-movedX * 0.001); * cam.tilt(movedY * 0.001); * sphere(25); + * describe(`3D scene moves according to mouse mouse movement in a + * first person perspective`); * } * * - * - * @alt - * 3D scene moves according to mouse mouse movement in a first person perspective */ p5.prototype.requestPointerLock = function() { // pointer lock object forking for cross browser @@ -1036,6 +1006,7 @@ p5.prototype.requestPointerLock = function() { * let locked = false; * function draw() { * background(237, 34, 93); + * describe(`cursor gets locked / unlocked on mouse-click`); * } * function mouseClicked() { * if (!locked) { @@ -1048,9 +1019,6 @@ p5.prototype.requestPointerLock = function() { * } * * - * - * @alt - * cursor gets locked / unlocked on mouse-click */ p5.prototype.exitPointerLock = function() { document.exitPointerLock(); diff --git a/src/events/touch.js b/src/events/touch.js index 4849dc5d13..bfda5e3a06 100644 --- a/src/events/touch.js +++ b/src/events/touch.js @@ -29,12 +29,11 @@ import p5 from '../core/main'; * clear(); * let display = touches.length + ' touches'; * text(display, 5, 10); + * describe(`Number of touches currently registered are displayed + * on the canvas`); * } * * - * - * @alt - * Number of touches currently registered are displayed on the canvas */ p5.prototype.touches = []; @@ -88,6 +87,7 @@ function getTouchInfo(canvas, w, h, e, i = 0) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`50×50 black rect turns white with touch event.`); * } * function touchStarted() { * if (value === 0) { @@ -106,6 +106,7 @@ function getTouchInfo(canvas, w, h, e, i = 0) { * // prevent default * return false; * } + * describe('no image displayed'); * * * @@ -116,12 +117,9 @@ function getTouchInfo(canvas, w, h, e, i = 0) { * function touchStarted(event) { * console.log(event); * } + * describe('no image displayed'); * * - * - * @alt - * 50×50 black rect turns white with touch event. - * no image displayed */ p5.prototype._ontouchstart = function(e) { const context = this._isGlobal ? window : this; @@ -168,6 +166,7 @@ p5.prototype._ontouchstart = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`50×50 black rect turns lighter with touch until white. resets`); * } * function touchMoved() { * value = value + 5; @@ -185,6 +184,7 @@ p5.prototype._ontouchstart = function(e) { * // prevent default * return false; * } + * describe('no image displayed'); * * * @@ -195,12 +195,9 @@ p5.prototype._ontouchstart = function(e) { * function touchMoved(event) { * console.log(event); * } + * describe('no image displayed'); * * - * - * @alt - * 50×50 black rect turns lighter with touch until white. resets - * no image displayed */ p5.prototype._ontouchmove = function(e) { const context = this._isGlobal ? window : this; @@ -240,6 +237,7 @@ p5.prototype._ontouchmove = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`50×50 black rect turns white with touch.`); * } * function touchEnded() { * if (value === 0) { @@ -258,6 +256,7 @@ p5.prototype._ontouchmove = function(e) { * // prevent default * return false; * } + * describe('no image displayed'); * * * @@ -268,12 +267,9 @@ p5.prototype._ontouchmove = function(e) { * function touchEnded(event) { * console.log(event); * } + * describe('no image displayed'); * * - * - * @alt - * 50×50 black rect turns white with touch. - * no image displayed */ p5.prototype._ontouchend = function(e) { this._setProperty('mouseIsPressed', false); From a9bd48161269321948ee7d8f5009c41bccac198f Mon Sep 17 00:00:00 2001 From: Zearin Date: Sun, 6 Feb 2022 12:54:44 -0500 Subject: [PATCH 020/131] docs(src/io): Use `describe()` instead of `@alt` Addresses #5139 --- src/io/files.js | 63 +++++++++++++++------------------ src/io/p5.Table.js | 81 +++++++++++++++---------------------------- src/io/p5.TableRow.js | 29 ++++++---------- src/io/p5.XML.js | 5 ++- 4 files changed, 67 insertions(+), 111 deletions(-) diff --git a/src/io/files.js b/src/io/files.js index 49ae034753..656cc26e2f 100644 --- a/src/io/files.js +++ b/src/io/files.js @@ -69,6 +69,8 @@ import '../core/friendly_errors/fes_core'; * ellipse(width / 2, height / 2, earthquakeMag * 10, earthquakeMag * 10); * textAlign(CENTER); * text(earthquakeName, 0, height - 30, width, 30); + * describe(`50×50 ellipse that changes from black to white + * depending on the current humidity`); * } * * @@ -85,6 +87,8 @@ import '../core/friendly_errors/fes_core'; * * function draw() { * background(200); + * describe(`50×50 ellipse that changes from black to white + * depending on the current humidity`); * } * * function drawEarthquake(earthquakes) { @@ -96,10 +100,6 @@ import '../core/friendly_errors/fes_core'; * text(earthquakeName, 0, height - 30, width, 30); * } * - * - * @alt - * 50×50 ellipse that changes from black to white depending on the current humidity - * 50×50 ellipse that changes from black to white depending on the current humidity */ /** * @method loadJSON @@ -217,6 +217,8 @@ p5.prototype.loadJSON = function(...args) { * function setup() { * background(200); * text(random(result), 10, 10, 80, 80); + * describe(`randomly generated text from a file, + * for example "i smell like butter"`); * } * * @@ -226,6 +228,8 @@ p5.prototype.loadJSON = function(...args) { *
* function setup() { * loadStrings('assets/test.txt', pickString); + * describe(`randomly generated text from a file, + * for example "i have three feet"`); * } * * function pickString(result) { @@ -233,10 +237,6 @@ p5.prototype.loadJSON = function(...args) { * text(random(result), 10, 10, 80, 80); * } *
- * - * @alt - * randomly generated text from a file, for example "i smell like butter" - * randomly generated text from a file, for example "i have three feet" */ p5.prototype.loadStrings = function(...args) { p5._validateParameters('loadStrings', args); @@ -364,13 +364,11 @@ p5.prototype.loadStrings = function(...args) { * for (let c = 0; c < table.getColumnCount(); c++) { * print(table.getString(r, c)); * } + * describe(`randomly generated text from a file, + * for example "i smell like butter"`); * } * * - * - * @alt - * randomly generated text from a file, for example "i smell like butter" - * randomly generated text from a file, for example "i have three feet" */ p5.prototype.loadTable = function(path) { // p5._validateParameters('loadTable', arguments); @@ -634,6 +632,7 @@ function makeObject(row, headers) { * let name = children[i].getContent(); * print(id + ', ' + coloring + ', ' + name); * } + * describe(`no image displayed`); * } * * // Sketch prints: @@ -641,9 +640,6 @@ function makeObject(row, headers) { * // 1, Panthera pardus, Leopard * // 2, Equus zebra, Zebra * - * - * @alt - * no image displayed */ p5.prototype.loadXML = function(...args) { const ret = new p5.XML(); @@ -712,11 +708,9 @@ p5.prototype.loadXML = function(...args) { * for (let i = 0; i < 5; i++) { * console.log(data.bytes[i].toString(16)); * } + * describe(`no image displayed`); * } * - * - * @alt - * no image displayed */ p5.prototype.loadBytes = function(file, callback, errorCallback) { const ret = {}; @@ -1434,18 +1428,21 @@ p5.PrintWriter = function(filename, extension) { * * // Saves the canvas as an image by default * save('myCanvas.jpg'); + * describe(`An example for saving a canvas as an image.`); * * - *
+ *
* // Saves p5.Image as an image * img = createImage(10, 10); * save(img, 'myImage.png'); + * describe(`An example for saving a p5.Image element as an image.`); *
* *
* // Saves p5.Renderer object as an image * obj = createGraphics(100, 100); * save(obj, 'myObject.png'); + * describe(`An example for saving a p5.Renderer element.`); *
* *
@@ -1458,6 +1455,9 @@ p5.PrintWriter = function(filename, extension) { * * // Tab Separated Values * save(myTable, 'myTable.tsv'); + * + * describe(`An example showing how to save a table in formats of + * HTML, CSV and TSV.`); *
* *
@@ -1468,21 +1468,17 @@ p5.PrintWriter = function(filename, extension) { * * // Optimizes JSON filesize * save(myJSON, 'my.json', true); + * + * describe(`An example for saving JSON to a txt file with some extra arguments.`); *
* *
* // Saves array of strings to text file with line breaks after each item * let arrayOfStrings = ['a', 'b']; * save(arrayOfStrings, 'my.txt'); + * describe(`An example for saving an array of strings to text file + * with line breaks.`); *
- * - * @alt - * An example for saving a canvas as an image. - * An example for saving a p5.Image element as an image. - * An example for saving a p5.Renderer element. - * An example showing how to save a table in formats of HTML, CSV and TSV. - * An example for saving JSON to a txt file with some extra arguments. - * An example for saving an array of strings to text file with line breaks. */ p5.prototype.save = function(object, _filename, _options) { @@ -1556,6 +1552,7 @@ p5.prototype.save = function(object, _filename, _options) { * createCanvas(100, 100); * background(200); * text('click here to save', 10, 10, 70, 80); + * describe(`no image displayed`); * } * * function mousePressed() { @@ -1571,9 +1568,6 @@ p5.prototype.save = function(object, _filename, _options) { * // "name": "Lion" * // } *
- * - * @alt - * no image displayed */ p5.prototype.saveJSON = function(json, filename, opt) { p5._validateParameters('saveJSON', arguments); @@ -1610,6 +1604,7 @@ p5.prototype.saveJSONArray = p5.prototype.saveJSON; * createCanvas(100, 100); * background(200); * text('click here to save', 10, 10, 70, 80); + * describe(`no image displayed`); * } * * function mousePressed() { @@ -1625,9 +1620,6 @@ p5.prototype.saveJSONArray = p5.prototype.saveJSON; * // cat * // dog * - * - * @alt - * no image displayed */ p5.prototype.saveStrings = function(list, filename, extension, isCRLF) { p5._validateParameters('saveStrings', arguments); @@ -1682,15 +1674,14 @@ function escapeHelper(content) { * * // To save, un-comment next line then click 'run' * // saveTable(table, 'new.csv'); + * + * describe(`no image displayed`); * } * * // Saves the following to a file called 'new.csv': * // id,species,name * // 0,Panthera leo,Lion * - * - * @alt - * no image displayed */ p5.prototype.saveTable = function(table, filename, options) { p5._validateParameters('saveTable', arguments); diff --git a/src/io/p5.Table.js b/src/io/p5.Table.js index 9dc0f6d286..b4be8220ad 100644 --- a/src/io/p5.Table.js +++ b/src/io/p5.Table.js @@ -125,12 +125,11 @@ p5.Table = function(rows) { * for (let r = 0; r < table.getRowCount(); r++) * for (let c = 0; c < table.getColumnCount(); c++) * print(table.getString(r, c)); + * + * describe(`no image displayed`); * } * * - * - * @alt - * no image displayed */ p5.Table.prototype.addRow = function(row) { // make sure it is a valid TableRow @@ -178,12 +177,11 @@ p5.Table.prototype.addRow = function(row) { * for (let r = 0; r < table.getRowCount(); r++) * for (let c = 0; c < table.getColumnCount(); c++) * print(table.getString(r, c)); + * + * describe(`no image displayed`); * } * * - * - * @alt - * no image displayed */ p5.Table.prototype.removeRow = function(id) { this.rows[id].table = null; // remove reference to table @@ -226,12 +224,11 @@ p5.Table.prototype.removeRow = function(id) { * for (let c = 0; c < table.getColumnCount(); c++) { * print(row.getString(c)); * } + * + * describe(`no image displayed`); * } * * - * - *@alt - * no image displayed */ p5.Table.prototype.getRow = function(r) { return this.rows[r]; @@ -274,12 +271,11 @@ p5.Table.prototype.getRow = function(r) { * for (let r = 0; r < table.getRowCount(); r++) * for (let c = 0; c < table.getColumnCount(); c++) * print(table.getString(r, c)); + * + * describe(`no image displayed`); * } * * - * - * @alt - * no image displayed */ p5.Table.prototype.getRows = function() { return this.rows; @@ -322,12 +318,10 @@ p5.Table.prototype.getRows = function() { * let row = table.findRow('Zebra', 'name'); * //find the corresponding species * print(row.getString('species')); + * describe(`no image displayed`); * } * * - * - * @alt - * no image displayed */ p5.Table.prototype.findRow = function(value, column) { // try the Object @@ -391,12 +385,10 @@ p5.Table.prototype.findRow = function(value, column) { * //find the rows containing animals named Goat * let rows = table.findRows('Goat', 'name'); * print(rows.length + ' Goats found'); + * describe(`no image displayed`); * } * * - * - *@alt - * no image displayed */ p5.Table.prototype.findRows = function(value, column) { const ret = []; @@ -573,12 +565,10 @@ p5.Table.prototype.matchRows = function(regexp, column) { * //getColumn returns an array that can be printed directly * print(table.getColumn('species')); * //outputs ["Capra hircus", "Panthera pardus", "Equus zebra"] + * describe(`no image displayed`); * } * * - * - *@alt - * no image displayed */ p5.Table.prototype.getColumn = function(value) { const ret = []; @@ -623,12 +613,10 @@ p5.Table.prototype.getColumn = function(value) { * table.clearRows(); * print(table.getRowCount() + ' total rows in table'); * print(table.getColumnCount() + ' total columns in table'); + * describe(`no image displayed`); * } * * - * - *@alt - * no image displayed */ p5.Table.prototype.clearRows = function() { delete this.rows; @@ -673,12 +661,11 @@ p5.Table.prototype.clearRows = function() { * for (let r = 0; r < table.getRowCount(); r++) * for (let c = 0; c < table.getColumnCount(); c++) * print(table.getString(r, c)); + * + * describe(`no image displayed`); * } * * - * - *@alt - * no image displayed */ p5.Table.prototype.addColumn = function(title) { const t = title || null; @@ -925,12 +912,10 @@ p5.Table.prototype.trim = function(column) { * function setup() { * table.removeColumn('id'); * print(table.getColumnCount()); + * describe(`no image displayed`); * } * * - * - *@alt - * no image displayed */ p5.Table.prototype.removeColumn = function(c) { let cString; @@ -995,12 +980,11 @@ p5.Table.prototype.removeColumn = function(c) { * for (let r = 0; r < table.getRowCount(); r++) * for (let c = 0; c < table.getColumnCount(); c++) * print(table.getString(r, c)); + * + * describe(`no image displayed`); * } * * - * - *@alt - * no image displayed */ p5.Table.prototype.set = function(row, column, value) { this.rows[row].set(column, value); @@ -1041,12 +1025,11 @@ p5.Table.prototype.set = function(row, column, value) { * * print(table.getColumn(0)); * //["0", 1, "2"] + * + * describe(`no image displayed`); * } * * - * - *@alt - * no image displayed */ p5.Table.prototype.setNum = function(row, column, value) { this.rows[row].setNum(column, value); @@ -1087,11 +1070,10 @@ p5.Table.prototype.setNum = function(row, column, value) { * newRow.setString('name', 'Wolf'); * * print(table.getArray()); + * + * describe(`no image displayed`); * } * - * - * @alt - * no image displayed */ p5.Table.prototype.setString = function(row, column, value) { this.rows[row].setString(column, value); @@ -1132,12 +1114,10 @@ p5.Table.prototype.setString = function(row, column, value) { * //Capra hircus * print(table.get(0, 'species')); * //Capra hircus + * describe(`no image displayed`); * } * * - * - *@alt - * no image displayed */ p5.Table.prototype.get = function(row, column) { return this.rows[row].get(column); @@ -1176,12 +1156,10 @@ p5.Table.prototype.get = function(row, column) { * function setup() { * print(table.getNum(1, 0) + 100); * //id 1 + 100 = 101 + * describe(`no image displayed`); * } * * - * - *@alt - * no image displayed */ p5.Table.prototype.getNum = function(row, column) { return this.rows[row].getNum(column); @@ -1227,12 +1205,10 @@ p5.Table.prototype.getNum = function(row, column) { * print(table.getString(2, 0)); // 2 * print(table.getString(2, 1)); // Equus zebra * print(table.getString(2, 2)); // Zebra + * describe(`no image displayed`); * } * * - * - *@alt - * no image displayed */ p5.Table.prototype.getString = function(row, column) { @@ -1273,12 +1249,11 @@ p5.Table.prototype.getString = function(row, column) { * * print(tableObject); * //outputs an object + * + * describe(`no image displayed`); * } * * - * - *@alt - * no image displayed */ p5.Table.prototype.getObject = function(headerColumn) { const tableObject = {}; @@ -1332,12 +1307,10 @@ p5.Table.prototype.getObject = function(headerColumn) { * for (let i = 0; i < tableArray.length; i++) { * print(tableArray[i]); * } + * describe(`no image displayed`); * } * * - * - *@alt - * no image displayed */ p5.Table.prototype.getArray = function() { const tableArray = []; diff --git a/src/io/p5.TableRow.js b/src/io/p5.TableRow.js index d13b131bbb..016cb7b57d 100644 --- a/src/io/p5.TableRow.js +++ b/src/io/p5.TableRow.js @@ -71,11 +71,10 @@ p5.TableRow = function(str, separator) { * * //print the results * print(table.getArray()); + * + * describe(`no image displayed`); * } * - * - * @alt - * no image displayed */ p5.TableRow.prototype.set = function(column, value) { // if typeof column is string, use .obj @@ -132,11 +131,10 @@ p5.TableRow.prototype.set = function(column, value) { * } * * print(table.getArray()); + * + * describe(`no image displayed`); * } * - * - * @alt - * no image displayed */ p5.TableRow.prototype.setNum = function(column, value) { const floatVal = parseFloat(value); @@ -177,11 +175,10 @@ p5.TableRow.prototype.setNum = function(column, value) { * } * * print(table.getArray()); + * + * describe(`no image displayed`); * } * - * - * @alt - * no image displayed */ p5.TableRow.prototype.setString = function(column, value) { const stringVal = value.toString(); @@ -222,11 +219,10 @@ p5.TableRow.prototype.setString = function(column, value) { * } * * print(names); + * + * describe(`no image displayed`); * } * - * - * @alt - * no image displayed */ p5.TableRow.prototype.get = function(column) { if (typeof column === 'string') { @@ -272,11 +268,9 @@ p5.TableRow.prototype.get = function(column) { * maxId = min(maxId, id); * } * print('minimum id = ' + minId + ', maximum id = ' + maxId); + * describe(`no image displayed`); * } * - * - * @alt - * no image displayed */ p5.TableRow.prototype.getNum = function(column) { let ret; @@ -329,11 +323,10 @@ p5.TableRow.prototype.getNum = function(column) { * } * * print('longest: ' + longest); + * + * describe(`no image displayed`); * } * - * - * @alt - * no image displayed */ p5.TableRow.prototype.getString = function(column) { if (typeof column === 'string') { diff --git a/src/io/p5.XML.js b/src/io/p5.XML.js index ac6e96f677..acd2d86415 100644 --- a/src/io/p5.XML.js +++ b/src/io/p5.XML.js @@ -39,6 +39,8 @@ import p5 from '../core/main'; * let name = children[i].getContent(); * print(id + ', ' + coloring + ', ' + name); * } + * + * describe(`no image displayed`); * } * * // Sketch prints: @@ -46,9 +48,6 @@ import p5 from '../core/main'; * // 1, Panthera pardus, Leopard * // 2, Equus zebra, Zebra * - * - * @alt - * no image displayed */ p5.XML = function(DOM) { if (!DOM) { From 861cf746a08c287e7e36ea66b46680b9754d967c Mon Sep 17 00:00:00 2001 From: Zearin Date: Sun, 6 Feb 2022 13:54:02 -0500 Subject: [PATCH 021/131] docs(src/math): Use `describe()` instead of `@alt` Addresses #5139 --- src/math/calculation.js | 111 +++++++++++++++++++-------------------- src/math/math.js | 4 +- src/math/noise.js | 17 +++--- src/math/p5.Vector.js | 6 +-- src/math/random.js | 22 ++++---- src/math/trigonometry.js | 24 ++++----- 6 files changed, 84 insertions(+), 100 deletions(-) diff --git a/src/math/calculation.js b/src/math/calculation.js index 7bc94ea85b..80a30d265e 100644 --- a/src/math/calculation.js +++ b/src/math/calculation.js @@ -22,11 +22,10 @@ import p5 from '../core/main'; * * print(x); // -3 * print(y); // 3 + * + * describe(`no image displayed`); * } * - * - * @alt - * no image displayed */ p5.prototype.abs = Math.abs; @@ -61,11 +60,11 @@ p5.prototype.abs = Math.abs; * noStroke(); * text(nfc(ax, 2), ax, ay - 5); * text(nfc(bx, 1), bx, by - 5); + * + * describe(`2 horizontal lines & number sets. increase with + * mouse x. bottom to 2 decimals`); * } * - * - * @alt - * 2 horizontal lines & number sets. increase with mouse x. bottom to 2 decimals */ p5.prototype.ceil = Math.ceil; @@ -102,11 +101,11 @@ p5.prototype.ceil = Math.ceil; * ellipse(xm, 33, 9, 9); // Not Constrained * fill(0); * ellipse(xc, 66, 9, 9); // Constrained + * + * describe(`2 vertical lines. 2 ellipses move with mouse X, + * 1 does not move past lines`); * } * - * - * @alt - * 2 vertical lines. 2 ellipses move with mouse X 1 does not move passed lines */ p5.prototype.constrain = function(n, low, high) { p5._validateParameters('constrain', arguments); @@ -152,11 +151,11 @@ p5.prototype.constrain = function(n, low, high) { * text(nfc(d, 1), 0, -5); * pop(); * // Fancy! + * + * describe(`2 ellipses joined by line. 1 ellipse moves with + * mouse X&Y. Distance displayed.`); * } * - * - * @alt - * 2 ellipses joined by line. 1 ellipse moves with mouse X&Y. Distance displayed. */ /** * @method dist @@ -220,11 +219,10 @@ p5.prototype.dist = function(...args) { * endShape(); * line(0, 0, 0, height); * line(0, height - 1, width, height - 1); + * + * describe(`ellipse moves along a curve with mouse x. e^n displayed.`); * } * - * - * @alt - * ellipse moves along a curve with mouse x. e^n displayed. */ p5.prototype.exp = Math.exp; @@ -258,11 +256,11 @@ p5.prototype.exp = Math.exp; * noStroke(); * text(nfc(ax, 2), ax, ay - 5); * text(nfc(bx, 1), bx, by - 5); + * + * describe(`2 horizontal lines & number sets. + * increase with mouse x. bottom to 2 decimals`); * } * - * - * @alt - * 2 horizontal lines & number sets. increase with mouse x. bottom to 2 decimals */ p5.prototype.floor = Math.floor; @@ -302,11 +300,11 @@ p5.prototype.floor = Math.floor; * point(c, y); * point(d, y); * point(e, y); + * + * describe(`5 points horizontally staggered mid-canvas. + * mid 3 are grey, outer black`); * } * - * - * @alt - * 5 points horizontally staggered mid-canvas. mid 3 are grey, outer black */ p5.prototype.lerp = function(start, stop, amt) { p5._validateParameters('lerp', arguments); @@ -360,11 +358,11 @@ p5.prototype.lerp = function(start, stop, amt) { * endShape(); * line(0, 0, 0, height); * line(0, height / 2, width, height / 2); + * + * describe(`ellipse moves along a curve with mouse x. + * natural logarithm of n displayed.`); * } * - * - * @alt - * ellipse moves along a curve with mouse x. natural logarithm of n displayed. */ p5.prototype.log = Math.log; @@ -395,11 +393,10 @@ p5.prototype.log = Math.log; * print(mag(x1, y2)); // Prints "72.80109889280519" * line(0, 0, x2, y2); * print(mag(x2, y2)); // Prints "106.3014581273465" + * + * describe(`4 lines of different length radiate from top left of canvas.`); * } * - * - * @alt - * 4 lines of different length radiate from top left of canvas. */ p5.prototype.mag = function(x, y) { p5._validateParameters('mag', arguments); @@ -426,6 +423,7 @@ p5.prototype.mag = function(x, y) { * let value = 25; * let m = map(value, 0, 100, 0, width); * ellipse(m, 50, 10, 10); + * describe(`10×10 white ellipse with in mid left canvas`); * *
@@ -441,12 +439,11 @@ p5.prototype.mag = function(x, y) { * //after setting withinBounds to true * let x2 = map(mouseX, 0, width, 0, 100, true); * ellipse(x2, 75, 25, 25); + * + * describe(`Two 25×25 white ellipses move with mouse x. + * Bottom has more range from X`); * }
- * - * @alt - * 10 by 10 white ellipse with in mid left canvas - * 2 25 by 25 white ellipses move with mouse x. Bottom has more range from X */ p5.prototype.map = function(n, start1, stop1, start2, stop2, withinBounds) { p5._validateParameters('map', arguments); @@ -490,11 +487,11 @@ p5.prototype.map = function(n, start1, stop1, start2, stop2, withinBounds) { * // Draw the Maximum value in the array. * textSize(32); * text(max(numArray), maxX, maxY); + * + * describe(`Small text at top reads: Array Elements 2 1 5 4 8 9. + * Large text at center: 9`); * } * - * - * @alt - * Small text at top reads: Array Elements 2 1 5 4 8 9. Large text at center: 9 */ /** * @method max @@ -538,11 +535,11 @@ p5.prototype.max = function(...args) { * // Draw the Minimum value in the array. * textSize(32); * text(min(numArray), maxX, maxY); + * + * describe(`Small text at top reads: Array Elements 2 1 5 4 8 9. + * Large text at center: 1`); * } * - * - * @alt - * Small text at top reads: Array Elements 2 1 5 4 8 9. Large text at center: 1 */ /** * @method min @@ -598,11 +595,11 @@ p5.prototype.min = function(...args) { * let normalY = 40; * let normalX = 20; * text(normalized, normalX, normalY); + * + * describe(`ellipse moves with mouse. 0 shown left, 100 right, + * and updating values center`); * } * - * - * @alt - * ellipse moves with mouse. 0 shown left & 100 right and updating values center */ p5.prototype.norm = function(n, start, stop) { p5._validateParameters('norm', arguments); @@ -635,11 +632,10 @@ p5.prototype.norm = function(n, start, stop) { * ellipse(eLoc * 4, eLoc * 4, pow(eSize, 3), pow(eSize, 3)); * * ellipse(eLoc * 8, eLoc * 8, pow(eSize, 4), pow(eSize, 4)); + * + * describe(`small to large ellipses radiating from top left of canvas`); * } * - * - * @alt - * small to large ellipses radiating from top left of canvas */ p5.prototype.pow = Math.pow; @@ -655,10 +651,12 @@ p5.prototype.pow = Math.pow; *
* let x = round(3.7); * text(x, width / 2, height / 2); + * describe(`"4" written in middle of canvas`); *
*
* let x = round(12.782383, 2); * text(x, width / 2, height / 2); + * describe(`"12.78" written in middle of canvas`); *
*
* function draw() { @@ -682,13 +680,10 @@ p5.prototype.pow = Math.pow; * noStroke(); * text(nfc(ax, 2), ax, ay - 5); * text(nfc(bx, 1), bx, by - 5); + * + * describe(`two horizontal lines rounded values displayed on top.`); * } *
- * - * @alt - * "4" written in middle of canvas - * "12.78" written in middle of canvas - * two horizontal lines rounded values displayed on top. */ p5.prototype.round = function(n, decimals) { if (!decimals) { @@ -734,11 +729,11 @@ p5.prototype.round = function(n, decimals) { * fill(0); * text('x = ' + x1, 0, y1 + spacing); * text('sq(x) = ' + x2, 0, y2 + spacing); + * + * describe(`horizontal center line squared values displayed on + * top and regular on bottom.`); * } * - * - * @alt - * horizontal center line squared values displayed on top and regular on bottom. */ p5.prototype.sq = n => n * n; @@ -779,11 +774,11 @@ p5.prototype.sq = n => n * n; * let spacing = 15; * text('x = ' + x1, 0, y1 + spacing); * text('sqrt(x) = ' + x2, 0, y2 + spacing); + * + * describe(`horizontal center line squareroot values displayed on + * top and regular on bottom.`); * } * - * - * @alt - * horizontal center line squareroot values displayed on top and regular on bottom. */ p5.prototype.sqrt = Math.sqrt; @@ -839,16 +834,16 @@ function hypot(x, y, z) { *
* text(7345.73472742, 10, 25); * text(fract(7345.73472742), 10, 75); + * describe(`first row having a number and the second having + * the fractional part of the number`); *
* *
* text(1.4215e-15, 10, 25); * text(fract(1.4215e-15), 10, 75); + * describe(`first row having a number expressed in scientific + * notation and the second having the fractional part of the number`); *
- * - * @alt - * first row having a number and the second having the fractional part of the number - * first row having a number expressed in scientific notation and the second having the fractional part of the number */ p5.prototype.fract = function(toConvert) { p5._validateParameters('fract', arguments); diff --git a/src/math/math.js b/src/math/math.js index 89d07aaeef..f8b9e475b3 100644 --- a/src/math/math.js +++ b/src/math/math.js @@ -30,11 +30,9 @@ import p5 from '../core/main'; * function draw() { * background(255); * line(v1.x, v1.y, mouseX, mouseY); + * describe(`draws a line from center of canvas to mouse pointer position.`); * } * - * - * @alt - * draws a line from center of canvas to mouse pointer position. */ p5.prototype.createVector = function(x, y, z) { if (this instanceof p5) { diff --git a/src/math/noise.js b/src/math/noise.js index cb58e0744d..44e44a48fc 100644 --- a/src/math/noise.js +++ b/src/math/noise.js @@ -76,6 +76,8 @@ let perlin; // will be initialized lazily by noise() or noiseSeed() * xoff = xoff + 0.01; * let n = noise(xoff) * width; * line(n, 0, n, height); + * describe(`vertical line moves left to right with updating + * noise values.`); * } * * @@ -89,13 +91,11 @@ let perlin; // will be initialized lazily by noise() or noiseSeed() * stroke(noiseVal*255); * line(x, mouseY+noiseVal*80, x, height); * } + * describe(`horizontal wave pattern effected by mouse x-position + * & updating noise values.`); * } * * - * - * @alt - * vertical line moves left to right with updating noise values. - * horizontal wave pattern effected by mouse x-position & updating noise values. */ p5.prototype.noise = function(x, y = 0, z = 0) { @@ -224,12 +224,11 @@ p5.prototype.noise = function(x, y = 0, z = 0) { * point(x + width / 2, y); * } * } + * describe(`2 vertical grey smokey patterns affected by + * mouse x-position and noise.`); * } * * - * - * @alt - * 2 vertical grey smokey patterns affected my mouse x-position and noise. */ p5.prototype.noiseDetail = function(lod, falloff) { if (lod > 0) { @@ -261,12 +260,10 @@ p5.prototype.noiseDetail = function(lod, falloff) { * xoff = xoff + .01; * let n = noise(xoff) * width; * line(n, 0, n, height); + * describe(`vertical grey lines drawing in pattern affected by noise.`); * } * * - * - * @alt - * vertical grey lines drawing in pattern affected by noise. */ p5.prototype.noiseSeed = function(seed) { // Linear Congruential Generator diff --git a/src/math/p5.Vector.js b/src/math/p5.Vector.js index fd0879cfc3..6469580d59 100644 --- a/src/math/p5.Vector.js +++ b/src/math/p5.Vector.js @@ -41,11 +41,11 @@ import * as constants from '../core/constants'; * ellipse(v2.x, v2.y, 50, 50); * v1.add(v2); * ellipse(v1.x, v1.y, 50, 50); + * + * describe(`2 white ellipses. One center-left the other + * bottom right and off canvas`); * * - * - * @alt - * 2 white ellipses. One center-left the other bottom right and off canvas */ p5.Vector = function Vector() { let x, y, z; diff --git a/src/math/random.js b/src/math/random.js index 2914020d33..6f37be8d5b 100644 --- a/src/math/random.js +++ b/src/math/random.js @@ -52,11 +52,9 @@ p5.prototype._lcgSetSeed = function(stateProperty, val) { * stroke(r); * line(i, 0, i, 100); * } + * describe(`many vertical lines drawn in white, black, or grey.`); * * - * - * @alt - * many vertical lines drawn in white, black or grey. */ p5.prototype.randomSeed = function(seed) { this._lcgSetSeed(randomStateProp, seed); @@ -92,6 +90,8 @@ p5.prototype.randomSeed = function(seed) { * stroke(r * 5); * line(50, i, 50 + r, i); * } + * describe(`100 horizontal lines from center canvas to right. + * The size and fill change each time.`); * * *
@@ -100,6 +100,8 @@ p5.prototype.randomSeed = function(seed) { * let r = random(-50, 50); * line(50, i, 50 + r, i); * } + * describe(`100 horizontal lines from center of canvas. + * The height & side change each render.`); * *
*
@@ -108,13 +110,9 @@ p5.prototype.randomSeed = function(seed) { * let words = ['apple', 'bear', 'cat', 'dog']; * let word = random(words); // select random word * text(word, 10, 50); // draw the word + * describe(`word displayed at random. Either apple, bear, cat, or dog.`); * *
- * - * @alt - * 100 horizontal lines from center canvas to right. size+fill change each time - * 100 horizontal lines from center of canvas. height & side change each render - * word displayed at random. Either apple, bear, cat, or dog */ /** * @method random @@ -175,6 +173,8 @@ p5.prototype.random = function(min, max) { * let x = randomGaussian(50, 15); * line(50, y, x, y); * } + * describe(`100 horizontal lines from center of canvas. + * The height & side change each render.`); * * *
@@ -199,12 +199,12 @@ p5.prototype.random = function(min, max) { * let dist = abs(distribution[i]); * line(0, 0, dist, 0); * } + * + * describe(`black lines radiate from center of canvas. + * The size changes each render.`); * } * *
- * @alt - * 100 horizontal lines from center of canvas. height & side change each render - * black lines radiate from center of canvas. size determined each render */ p5.prototype.randomGaussian = function(mean, sd = 1) { let y1, x1, x2, w; diff --git a/src/math/trigonometry.js b/src/math/trigonometry.js index d71449cfc2..40aa19a31b 100644 --- a/src/math/trigonometry.js +++ b/src/math/trigonometry.js @@ -145,12 +145,10 @@ p5.prototype.atan = function(ratio) { * let a = atan2(mouseY - height / 2, mouseX - width / 2); * rotate(a); * rect(-30, -5, 60, 10); + * describe(`60×10 rect at center of canvas rotates with mouse movements`); * } * * - * - * @alt - * 60 by 10 rect at center of canvas rotates with mouse movements */ p5.prototype.atan2 = function(y, x) { return this._fromRadians(Math.atan2(y, x)); @@ -173,11 +171,10 @@ p5.prototype.atan2 = function(y, x) { * line(i * 4, 50, i * 4, 50 + cos(a) * 40.0); * a = a + inc; * } + * describe(`vertical black lines form wave patterns, extend-down on + * left and right side`); * * - * - * @alt - * vertical black lines form wave patterns, extend-down on left and right side */ p5.prototype.cos = function(angle) { return Math.cos(this._toRadians(angle)); @@ -200,11 +197,10 @@ p5.prototype.cos = function(angle) { * line(i * 4, 50, i * 4, 50 + sin(a) * 40.0); * a = a + inc; * } + * describe(`vertical black lines extend down and up from center + * to form wave pattern.`); * * - * - * @alt - * vertical black lines extend down and up from center to form wave pattern */ p5.prototype.sin = function(angle) { return Math.sin(this._toRadians(angle)); @@ -227,10 +223,9 @@ p5.prototype.sin = function(angle) { * line(i, 50, i, 50 + tan(a) * 2.0); * a = a + inc; * } + * describe(`vertical black lines end down and up from center to + * form spike pattern.`); * - * - * @alt - * vertical black lines end down and up from center to form spike pattern */ p5.prototype.tan = function(angle) { return Math.tan(this._toRadians(angle)); @@ -303,13 +298,12 @@ p5.prototype.radians = angle => angle * constants.DEG_TO_RAD; * angleMode(RADIANS); // Change the mode to RADIANS * rotate(a); // variable a stays the same * rect(-40, -5, 20, 10); // Smaller rectangle is rotating in radians + * describe(`40×10 rect in center rotates with mouse moves. + * 20×10 rect moves faster.`); * } * * * - * @alt - * 40 by 10 rect in center rotates with mouse moves. 20 by 10 rect moves faster. - * */ p5.prototype.angleMode = function(mode) { if (mode === constants.DEGREES || mode === constants.RADIANS) { From 8f6e58adfe5df426e1bf83371cae4a6ea907e2ef Mon Sep 17 00:00:00 2001 From: Zearin Date: Sun, 6 Feb 2022 14:07:08 -0500 Subject: [PATCH 022/131] docs(src/typography): Use `describe()` instead of `@alt` Addresses #5139 --- src/typography/attributes.js | 35 +++++++++++++++++++---------------- src/typography/p5.Font.js | 6 +++--- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/typography/attributes.js b/src/typography/attributes.js index 0b8fba11ed..f7d677fc63 100644 --- a/src/typography/attributes.js +++ b/src/typography/attributes.js @@ -39,6 +39,8 @@ import p5 from '../core/main'; * text('EFGH', 50, 50); * textAlign(LEFT); * text('IJKL', 50, 70); + * describe(`Letters ABCD displayed at top left, EFGH at center, and + * IJKL at bottom right.`); * * * @@ -62,12 +64,12 @@ import p5 from '../core/main'; * line(0, 87, width, 87); * textAlign(CENTER, BOTTOM); * text('BOTTOM', 0, 87, width); + * + * describe(`The names of the four vertical alignments (TOP, CENTER, BASELINE, + * and BOTTOM) rendered each showing that alignment's placement relative to a + * horizontal line.`); * * - * - * @alt - * Letters ABCD displayed at top left, EFGH at center and IJKL at bottom right. - * The names of the four vertical alignments (TOP, CENTER, BASELINE & BOTTOM) rendered each showing that alignment's placement relative to a horizontal line. */ /** * @method textAlign @@ -100,11 +102,11 @@ p5.prototype.textAlign = function(horizAlign, vertAlign) { * * textLeading(30); * text(lines, 70, 25); + * + * describe(`A set of L1, L2, and L3, displayed vertically 3 times. + * Spacing increases for each set.`); * * - * - * @alt - * A set of L1 L2 & L3 displayed vertically 3 times. spacing increases for each set */ /** * @method textLeading @@ -132,11 +134,12 @@ p5.prototype.textLeading = function(theLeading) { * text('Font Size 14', 10, 60); * textSize(16); * text('Font Size 16', 10, 90); + * + * describe(`'Font Size 12' displayed small, + * 'Font Size 14' medium, and + * 'Font Size 16' large`); * * - * - * @alt - * 'Font Size 12' displayed small, 'Font Size 14' medium & 'Font Size 16' large */ /** * @method textSize @@ -169,11 +172,12 @@ p5.prototype.textSize = function(theSize) { * text('Font Style Bold', 10, 65); * textStyle(BOLDITALIC); * text('Font Style Bold Italic', 10, 90); + * describe(`The words “Font Style Normal” displayed normally, + * “Font Style Italic” in italic, + * “Font Style Bold” in bold, and + * “Font Style Bold Italic” in bold italics.`); * * - * - * @alt - * Words Font Style Normal displayed normally, Italic in italic, bold in bold and bold italic in bold italics. */ /** * @method textStyle @@ -204,11 +208,10 @@ p5.prototype.textStyle = function(theStyle) { * let sWidth = textWidth(aString); * text(aString, 0, 85); * line(sWidth, 50, sWidth, 100); + * + * describe(`Letter P and p5.js are displayed with vertical lines at end.`); * * - * - * @alt - * Letter P and p5.js are displayed with vertical lines at end. */ p5.prototype.textWidth = function(...args) { args[0] += ''; diff --git a/src/typography/p5.Font.js b/src/typography/p5.Font.js index 1c65ccae2a..b632db07da 100644 --- a/src/typography/p5.Font.js +++ b/src/typography/p5.Font.js @@ -64,12 +64,12 @@ p5.Font = function(p) { * textFont(font); * textSize(12); * text(textString, 10, 30); + * + * describe(`Words “Lorem ipsum dol” go off canvas and + * contained by white bounding box`); * } * * - * - * @alt - *words Lorem ipsum dol go off canvas and contained by white bounding box */ p5.Font.prototype.textBounds = function(str, x = 0, y = 0, fontSize, opts) { // Check cache for existing bounds. Take into consideration the text alignment From f66d2c50318a7e22e8149eea4b138af98bc4a25f Mon Sep 17 00:00:00 2001 From: Gareth Williams Date: Sat, 12 Feb 2022 18:21:21 +0000 Subject: [PATCH 023/131] Updated some JsDoc definitions (#5578) * removed unused parameters * fixed parameter naming error * Added previous chainable jsDoc * reinstated removed params * removed wrongly pasted chars * linting formatting * Added 4x4 matrix method definition * linting errors * linting errors * Trying to resolve lint errors * Update transform.js * added 4x4 matrix image * Added 4-4 image to docs * Updated applymatrix images * Update transform.js * Reverted param names * changed images to match param names * Update transform.js --- .../assets/transformation-matrix-4-4.png | Bin 0 -> 6864 bytes lib/addons/p5.sound.js | 2 +- src/core/shape/vertex.js | 6 +-- src/core/transform.js | 40 +++++++++++++++--- 4 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 docs/yuidoc-p5-theme/assets/transformation-matrix-4-4.png diff --git a/docs/yuidoc-p5-theme/assets/transformation-matrix-4-4.png b/docs/yuidoc-p5-theme/assets/transformation-matrix-4-4.png new file mode 100644 index 0000000000000000000000000000000000000000..f4203b3312de13cc2c9b4bb100faaf01eb5f8373 GIT binary patch literal 6864 zcmbt(cQjnzyEiE!(R+}H(GopDbS9Y5Lxd>NJJHKT86{C-m=FXZ$^?n>)roFIVnpwv z8_^le7`?m4{r%px?t0h#DrKd_HBo!YhPOYy4*Ec=YO?*g5sDE94NSPjJz5#C1`$CO< z^*tPX{j9z1Nz}aU?cIHxJbW!)kOPmf8E8P14E!xNGo1@w{9*rnGE&QV%6STopjB7L zv_UAL+A&EnJ)Rhe*dEO)3}qF>hvQ+ffdE88kaw62;-g8yKJry4pV85$gTJ>j;Oq#E zhY=K4@aTRbH5NbFPa_$4fbFU$n5>%+0!Mvg8I;NCDCuFK2y*i123qB75fF27&=utz zkqBCy5vn?w(X#xZ&y6_Ob6h|Xv^n?!alI8V zJuqeYzoxvLo{sjve;ZQJP(TW&X+jWD&^UAPDJAD4-a8lOgT(OJTc%+x>8B4&Rd|{_h9=&;I=T zjXJ&+punNnl9$z8Pf?09WciXF*o|{w!&VC)M1@|Qjok%@OqZC|56w&4cQH!&;mvB{ z2kr;`;0uUHG*2qAGU&(~InhXHc3INnQ8785M~W7|7k>G@BU3&=EYO=ZOMm$R9OJXU zG2y<_m-(lQ6YPUp$^P`mEc!T-f@ONK^P}7GcsxjD8uzDYGw_tyZa&)_JmZK8UY@LW zaSS*7ad8gcErZ;_1g(#jl)8+SmYP&KxG#1j@I6}}EA!h~>Gvx!t$nSlu$Of6Q$b&r z0(^SLZ`N&TE1X8r^RC?M?_#xn1ner+Ty`<~Y<~)0(auq|m<`-AT$Xelx9X?4r?_!^ zKp-6Nts9w;-PcaFs*0Ys-%9sr_Bxmi{lPBpUyiPQz4`K>N4$R=ZrdIQ`*F6Pj%K-4 zPX`kiHusxZ5)crW{vFF+(&FDS$Ewh zp>N2&$^}@Oo$KmA_CD6s18rZitPr8l2b{si@$Q8Iygm!|K^|%4Hp3@lV z|7hMXV6%EGr}3A{sEVyx(4n|61K4{J;WFEdhM>tK9Dl!ObszewfhYX9sDVo)?$So{ zzkX8?b~~0sq2Y^2$l+WRvtUH(@#)#YteWmERw?%kw3-a0j)p`2wnAapM$o_)rG1WB z4fSiHxS#-I;ULwQTN0+%Lt}-quBh;d{_`Z>p)bSv(bu_LQtkQi3R}KIV{r|Wpez~q ze)0NXZq!tbo2hSm{nK0 z_-TRam6L|qR*ueCjB<-(PZvk<7=C}s!w-CZXzOc4ViUZQ>Gv{d>v1&yIqz7deYcP} zZo0mzk@%Z^1{2Ltjo>4N+yoJ?`Y1B+=9zS=TJXoQyuMjOLF{7N;Y!=Ge~c9r;9KMo zanf6%2*%g1Z0y)a!{jNxXfaQ=Xt-q$oDkA1XclPBZ8(vn4z4V{oC5be4nP9g0S$Xf z^<1ZWW0t0b{D7V1>*ySt6cO{6&so?6m5_l=uzt2v%6dUVmWO{Ku9`0x^%VVAF^omG zij?g1-E{+hhF#z1*vmRbL4qD8W1qj2oHf4razq!UxG4+6*`a8VoK$4bO{-tM5T>xg zaj+_5iA*ut8pHwxgtU#0_QKV#JS@9`c5RH$-F1&YfX_W!-%(W^tY+s&KVD#YZ_9X) zn3{=^R{_NZTCt_3n| z)m_%$mr4|M=WorQA9fgNWNmMDoEPcTE3DO_`n1y|5(71oOdRe<#@F8v#{K=#@;xQp zSuaF@`+C%sYu}fH)+p(h?~19BL>F;5xKj0WfeJI2tLFChIr+W~aK`Jg()tgYPwx%BIvhX!r$n&uAckpKb#vLT&{^Q^8eBHbIa_-5go>Z?*Tgtqrdn&;|<( zWytuLedK#OjXuD-%=d{4!$c#D=~ya3c@Go4=(SQBPT&$rl{A&0I2!P2d2cRV8Se(rR;TXfJo;hH@%%cf9FwH_lPoG)a< z@cdmNA)6Oe|DRNI_x~oo{{_{+Zl!ZOhYNt%;-(R@HdUT;%2QRJg>5HjFS4UJDraUP zn^x^VVe6w4ia24@8sFNP*Xd`O@X5{Rh$1a_$l2ChYbg-4H3w2Bc{^!U)cH(HRo1O! zQ|uYP6BT|=lpU8g;wyvyk-2!0sH?j==V`GTxkOXNa$my-Tp^R&r7k9j?BiLoT@H>_dLd^XQ zaJP+#tm6~h*8A=8N_(V9SWH@ha6JP|RJn_5oeY8?ps+M(P7tIuQBLoGiwBI}$IuXy zlX)?r;bzgY;#Sg5hFk_x0}qCz>2-CyS(GK@>*@Dwz;_9WtsgA|*LbCZk9})H&W`_5 zXP3D2p}-!@%oQ)cJ0-Xb=0vvbBpX>&z|CeuPD+C2=%4i=n3mlCO?Q$VLYh9rdFTPY zkubTt_@c=0MN!qMHtRQw9qOfBfcplAw>pyx#EVG4cR}+M9#b_X?2lh1nW6)$O`C)2 z*Jm1QiwX+LuVf1~%K}_nyXSf8m-U)%c5|v$?Lw2W3bt;jC1MdogkCa~l=ZJ`f}hCa z*;-v`ckiQuhR{Ix@Qsd)iI_Kx2Qsj=F$o&hQQws{7K#>zr3dy(IAHr#(0$1TaByZ3 zkoJ;N($pqSKSIv5lWN?im}i)rg)ExJZ6*r!@B0BXvs&5_CUZu946x$8nL?b>v2!*T z>$QO8p0rCENwM-&IGFY^B+J*yd^N0mFL+n)U|1Iny_gqk^dm?TJ%;mQr+$Qn`bwF3 zbK^dVn0xEW6C;8RXDjc|MTYLK4jMW^WDP`Y+N2|0i-ztG*>+4`%r{+Pad z-Z3Wz;NFSvx+u@K8@O~yHyjxahih8UBc3}v90AcD?hy3!(Hi9;F|M-Tbv~9yPy^~* zej1d*dIR}Jnrnl+NuBH@DQg#y92+b8`8xG|nR2EZ04i|!ogR8MT2c!7nn)#liZlmU zosd6Fl`EI>u3wQCH&LFL6ay(Pw}v>c_QsnthmSL~HwT{>-byK;UZ5gs-zmD)9TV95 z#+fa^MZ$+0hc)c{N7_IZyhQg?xeg*0&>e!K=;E?Z6pN}uZWGb3Dq)rTJgZFB-?p&> z*(z=xIRl-M1)mz#`S5OC`u$`ciPFx)rIU1`K6Xht^7G+ePty#Ih;xLd9UZvG+R(Sb znQ~x!yZBZyR4iz%sWmQqqYX4fG)WAUs8$IH>_wccnb_LNYsC=a?#gZ4N&rMbT0P1# zlMfdn%S~`<_H@2|hu4rYMa)Uy)w|Q(&p#7hUg;Jp2vEDt1!9RDJ*t zmeZ16_yHo}&jw3K$jN5yrVLlIgs`Ro9pR|sMybs9u#1k20@TAzuWUh|Ri^2iV}I74 z<*F!UcgWpr)pCSyk#y6PxeDfGIA)Zj z3M_WZg-0DTj^(Cc)51yXC&Bk{_7&%+JN^3iwIZIBLS|ZBQ@PdRjG;rIPNO&$ZZ}Ia zxh7O8dbR9MAhwvBUoE4MAf(9S)8A@rA_6r}qDdy3ixd4!v`Las1a+x|G!%&P;JBD7 z*&MDA&yFM6L*kQ?gMh$`!7^$L{6$}!pGbZ}#TLwCMJu@9O%6UEc}x#W&Y z3Flkh5K&E|ooRdHr+s&dNzd(ZmzjoYDy-L&TCx?WIkz558s~=3a!J@g6S-{whL!(R9enub#I z#s(Lq}J{6?SLzmPJ{WCNfm1^E8>mH6*h zLoZHubfs)Cq#*<>dXRzCPC??`=45r1tHMnzD8x?HGV~1QYs7f6mZT6UO`~{d zrL^q{VBc7Utr{{LykYt^{Eu<~Pff0y+1Mp9rvXkl3anCN zwm&*F0EpAo=m${%Kc%(g8l9Id^;ocYR|U&9heTdj5gZ(Q;| zW;>hugqZG)lQ2=RWo*(tb#_wWWy#TzVwQW;FXPa2+g{CxyxATKjclVa<)mt|k+(fs zi}VL)-lo_3LWv)*X#MSvaN!`^!qEpJciFm2hLhB~cnOXZQJ{DVy$_C>U7TeZbp;Ct zc_6StTJg~uD&)9O0ZF0AxkdT))fWj?zDEz!-i{|v{*rdT=Rma`r7Qwbz`hVP8d;;R zs#9g06x|R@g=CTClt$E{vXb-y^+Y*}IQuBCyc#aEn>V!N*K-twv-QgN1ib~o`%o#_ zJ1;uHUQAyV2^I;bojaiiGs74u7)+J`FDBR>7O3(fX_C-(;C^W|uI9H0Q9JlVxHF8T zc;j}X8Sa|_46Qv7?a0B*xU4$T*@Ozj@t=5`eA&A6{ks2HJ+wbRJ(5H`4mtG?$asXf z$9kW&AMorB#N04fY|{kbz=QFC=6MaIS~AKa;$V1~xhlYgVlJQb4Hdg&9TpAm{w1Jf zn7K^Y4J$WAh#DI5&nhqi%HW9${u4d-G-3pBZRTYb=nY2)uBNSD6z+g-tmh{&x$bl_fgVJ?k?pHFLKA;F?*9*i4jkGhm$W<|%3^ zY!%|ztwI_bDfNr-<3S$<^$wmTY%T5+Wtsl)WVSWmUvc~{x@4C z%60NC%K{y_;?*Ftkac4~r*Z*M|FH4Ri?2NotTY;bl-s7tV3e+XKIX@S-uR#D{Xojs zu8TJoLJ^f`R$ zBMeq1@;~&6^$7t{3YO9xZ^xaGGm|R6o(QE&dEoygEpuK2!%`)j6VG(Q$*6{!`5w`7 zTvJyY{X-@3K1qB($5A&Bgu4q(~%xheNn1m9+(F3z=4}ZL@JM;#EBq^AM5crtS zVZo8HZJ^c0*PAi;TY7MBeq4|51R7p@m*nU7N`O%60b-dHKU(YLIa*ukNBI>QmQ=0< zn4M%O_%kMf9; z?@5>H7xOva7|#E2rno&!5q+|jF{Os3E~trVe0a&PtHrK=3Sas$@HvupIb z^RO!#)0He(;^jJ8oHkW%9WEDgT9;V_u-U=O`maGcS@IL~i2(24Kou{kj__a0$c{Er z^j=hFr;Tkj+W<;T;{+}+Ivz0WIYNPt0Hah?bBIW#YXoTNvpIKS0?GouDzlHDX%v$? zs9Ecknswc|_#|rSp4JrgZYNd>TkZ#xZ&-a*K2zwaC0#;sn7HTP7EE${P-jysK{+ya zKDrygP?3fzjg;(XF-l5Rn=?;IoqN#3}F@sN{RNpvNGJs30 zJeHD7&ck_62WOONVGRzaBEW_aLu4y7To_4RkncWDsPu5rcXsHO-Q{6b2;40&D~Has z{pQLu5w8jw`UwY_M*Kv|UWu@8akM)RsMws3?$;fA)v4Ts!sbAcT`@@!EJelAE15v~ zZ6ZVz6V1bA$Nr_6(;-RJqio>e&=dOM;xrTDBF`fFbr{RuAxj$XXfx9%l!f}V?mb!G zf)k+Fm3u!D!>&sumJgf-o>-$9Lcy zlukzzvz)G+p*oeBxpn_h%@u!d`eU}FztBu~W>lF0ujXfz4hv0%Znw_P8^W5My%JGr zxo+>*Sy}V3W~|+N9&qM1l<;gp+DNB94bGH zt>m{0vkANeESmQw4IGU2S?R-%6zT(e*|D7Vy8}*Sy=lOM|Ja7~1!w-Q1oohi$h4NU zo`14f3YaJS>R|5R%)^@&Bf%6;Ytke-)KV6!d_@S=yie1+*oh)8hRln?k%x>5*IWSB ztdZvFSICqmmLM0d!g%O+eVaOv+tDA=^ejJ$dHx{d6{T1RV}V)Se3a7~mR8piUthJo zL2SQQtHODx093$U^*Q#-8WbXHaTLQOD8R0EJ`MPIK$2yeo7TElpJace0E~P1broc9%yUQ+ zP@Hn_{rp(+ag1hLrOmB&?ho=d{o_Vl{f8FR3v_a?HxPKksKX&oN#`NV2D1(FnX}4w z+{1V^E~VlinQoPR<9mz;JcX@2miP0xRo{F1O?yS{aZGe^xw%0Ri^?Mk2&st`z~*iA zABx%hb!_NB=zabZFNM&rr?9)dntKrL$<%IWpv0}N%^$^fr$ojJJaZ6)5Vqfsx)-8e zyb!=?1T-MXqr4p)mgoSq&e40`ce*PNV7jt|Y*%JlvKkZGz;r+ng)oep#`1`$@w6zlhl*Lvqz&H;yzHZ#^zb=lbn`_InC|DwS2|IvB?dL{pT zW8*y67bwX;w{`K>06Hr3;D7aAa+IKGK9+mNL=yZNsxd?StartAudioContext * , a library by Yotam Mann (MIT Licence, 2016).

- * @param {Element|Array} [element(s)] This argument can be an Element, + * @param {Element|Array} [elements] This argument can be an Element, * Selector String, NodeList, p5.Element, * jQuery Element, or an Array of any of those. * @param {Function} [callback] Callback to invoke when the AudioContext diff --git a/src/core/shape/vertex.js b/src/core/shape/vertex.js index 775889f3dc..a02c80b6ad 100644 --- a/src/core/shape/vertex.js +++ b/src/core/shape/vertex.js @@ -958,7 +958,7 @@ p5.prototype.quadraticVertex = function(...args) { * @method vertex * @param {Number} x * @param {Number} y - * @param {Number} z z-coordinate of the vertex. + * @param {Number} [z] z-coordinate of the vertex. * Defaults to 0 if not specified. * @chainable */ @@ -967,8 +967,8 @@ p5.prototype.quadraticVertex = function(...args) { * @param {Number} x * @param {Number} y * @param {Number} [z] - * @param {Number} u the vertex's texture u-coordinate - * @param {Number} v the vertex's texture v-coordinate + * @param {Number} [u] the vertex's texture u-coordinate + * @param {Number} [v] the vertex's texture v-coordinate * @chainable */ p5.prototype.vertex = function(x, y, moveTo, u, v) { diff --git a/src/core/transform.js b/src/core/transform.js index 1fe637e5d9..180acdaaf2 100644 --- a/src/core/transform.js +++ b/src/core/transform.js @@ -24,13 +24,41 @@ import p5 from './main'; * > The transformation matrix used when applyMatrix is called * + * The transformation matrix used when applyMatrix is called with 4x4 matrix + * + * @method applyMatrix + * @param {Array} arr an array of numbers - should be 6 or 16 length (2*3 or 4*4 matrix values) + * @chainable + */ +/** + * @method applyMatrix + * @param {Number} a numbers which define the 2×3 or 4x4 matrix to be multiplied + * @param {Number} b numbers which define the 2×3 or 4x4 matrix to be multiplied + * @param {Number} c numbers which define the 2×3 or 4x4 matrix to be multiplied + * @param {Number} d numbers which define the 2×3 or 4x4 matrix to be multiplied + * @param {Number} e numbers which define the 2×3 or 4x4 matrix to be multiplied + * @param {Number} f numbers which define the 2×3 or 4x4 matrix to be multiplied + * @chainable + */ +/** * @method applyMatrix - * @param {Number|Array} a numbers which define the 2×3 matrix to be multiplied, or an array of numbers - * @param {Number} b numbers which define the 2×3 matrix to be multiplied - * @param {Number} c numbers which define the 2×3 matrix to be multiplied - * @param {Number} d numbers which define the 2×3 matrix to be multiplied - * @param {Number} e numbers which define the 2×3 matrix to be multiplied - * @param {Number} f numbers which define the 2×3 matrix to be multiplied + * @param {Number} a + * @param {Number} b + * @param {Number} c + * @param {Number} d + * @param {Number} e + * @param {Number} f + * @param {Number} g numbers which define the 4x4 matrix to be multiplied + * @param {Number} h numbers which define the 4x4 matrix to be multiplied + * @param {Number} i numbers which define the 4x4 matrix to be multiplied + * @param {Number} j numbers which define the 4x4 matrix to be multiplied + * @param {Number} k numbers which define the 4x4 matrix to be multiplied + * @param {Number} l numbers which define the 4x4 matrix to be multiplied + * @param {Number} m numbers which define the 4x4 matrix to be multiplied + * @param {Number} n numbers which define the 4x4 matrix to be multiplied + * @param {Number} o numbers which define the 4x4 matrix to be multiplied + * @param {Number} p numbers which define the 4x4 matrix to be multiplied * @chainable * @example *
From 1c193bf3f0c668f07f1bc484d1bd775f722d1b93 Mon Sep 17 00:00:00 2001 From: Reeju Bhattacharya Date: Wed, 16 Feb 2022 22:21:48 +0530 Subject: [PATCH 024/131] initial commit --- src/dom/dom.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dom/dom.js b/src/dom/dom.js index a845db2203..cd8558c0ef 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -943,6 +943,7 @@ p5.prototype.createRadio = function() { }; self.selected = function(value) { + // console.log('Hello'); let result = null; if (value === undefined) { for (const option of self._getOptionsArray()) { @@ -952,6 +953,12 @@ p5.prototype.createRadio = function() { } } } else { + // forEach loop to uncheck all radio buttons before + // setting any one as checked. + self + ._getOptionsArray() + .forEach(option => option.removeAttribute('checked')); + for (const option of self._getOptionsArray()) { if (option.value === value) { option.setAttribute('checked', true); From ef166a57a87a40babb64a0bb398f378605cb4a2b Mon Sep 17 00:00:00 2001 From: Reeju Bhattacharya Date: Wed, 16 Feb 2022 23:03:28 +0530 Subject: [PATCH 025/131] remove comments --- src/dom/dom.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dom/dom.js b/src/dom/dom.js index cd8558c0ef..fd8de5a868 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -943,7 +943,6 @@ p5.prototype.createRadio = function() { }; self.selected = function(value) { - // console.log('Hello'); let result = null; if (value === undefined) { for (const option of self._getOptionsArray()) { From c029a7004147c5c03342759534a59a47a70611a7 Mon Sep 17 00:00:00 2001 From: Reeju Bhattacharya Date: Wed, 16 Feb 2022 23:04:32 +0530 Subject: [PATCH 026/131] Revert "fixes issue #5191 along with minor grammatical edits" This reverts commit b8c5da317372bf6ed3349c9b023b9b1203b26267. reverts commit from another pull request --- src/events/mouse.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/events/mouse.js b/src/events/mouse.js index 5380952720..ae449c3191 100644 --- a/src/events/mouse.js +++ b/src/events/mouse.js @@ -984,10 +984,7 @@ p5.prototype._onwheel = function(e) { * Note that not all browsers support this feature. * This enables you to create experiences that aren't limited by the mouse moving out of the screen * even if it is repeatedly moved into one direction. - * For example, a first person perspective experience. It is recommended to - * use requestPointerLock() as a result - * of any user interaction, like mouseClicked() - * or keyPressed() + * For example, a first person perspective experience. * * @method requestPointerLock * @example @@ -996,6 +993,7 @@ p5.prototype._onwheel = function(e) { * let cam; * function setup() { * createCanvas(100, 100, WEBGL); + * requestPointerLock(); * cam = createCamera(); * } * @@ -1005,10 +1003,6 @@ p5.prototype._onwheel = function(e) { * cam.tilt(movedY * 0.001); * sphere(25); * } - * - * function mouseClicked() { - * requestPointerLock(); - * } * *
* @@ -1030,8 +1024,8 @@ p5.prototype.requestPointerLock = function() { /** * The function exitPointerLock() - * exits a previously triggered pointer Lock. - * For example, it might be used to make UI elements usable once again. + * exits a previously triggered pointer Lock + * for example to make ui elements usable etc * * @method exitPointerLock * @example From 52c4969e4b8a2afc601122666e292c9906affeda Mon Sep 17 00:00:00 2001 From: Reeju Bhattacharya Date: Fri, 18 Feb 2022 02:46:33 +0530 Subject: [PATCH 027/131] made changes as suggested --- src/dom/dom.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dom/dom.js b/src/dom/dom.js index fd8de5a868..2adc1261ff 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -954,12 +954,14 @@ p5.prototype.createRadio = function() { } else { // forEach loop to uncheck all radio buttons before // setting any one as checked. - self - ._getOptionsArray() - .forEach(option => option.removeAttribute('checked')); + self._getOptionsArray().forEach(option => { + option.removeAttribute('checked'); + option.checked = false; + }); for (const option of self._getOptionsArray()) { if (option.value === value) { + option.checked = true; option.setAttribute('checked', true); result = option; } From 9499111266e35e29261f90e850dfbb1f372ec639 Mon Sep 17 00:00:00 2001 From: Reeju Bhattacharya Date: Fri, 18 Feb 2022 02:52:25 +0530 Subject: [PATCH 028/131] minor linting changes --- src/dom/dom.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dom/dom.js b/src/dom/dom.js index 2adc1261ff..9bd87a1b97 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -955,14 +955,14 @@ p5.prototype.createRadio = function() { // forEach loop to uncheck all radio buttons before // setting any one as checked. self._getOptionsArray().forEach(option => { - option.removeAttribute('checked'); option.checked = false; + option.removeAttribute('checked'); }); for (const option of self._getOptionsArray()) { if (option.value === value) { - option.checked = true; option.setAttribute('checked', true); + option.checked = true; result = option; } } From 031ff86c004e43499aec49923764328982c1d13c Mon Sep 17 00:00:00 2001 From: limzykenneth Date: Sat, 19 Feb 2022 16:25:59 +0000 Subject: [PATCH 029/131] Change the way marked is called --- docs/preprocessor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/preprocessor.js b/docs/preprocessor.js index bbf7c3f0c2..3d8cabcaec 100644 --- a/docs/preprocessor.js +++ b/docs/preprocessor.js @@ -271,7 +271,7 @@ function buildParamDocs(docs) { function renderItemDescriptionsAsMarkdown(item) { if (item.description) { const entities = new Entities(); - item.description = entities.decode(marked(item.description)); + item.description = entities.decode(marked.parse(item.description)); } if (item.params) { item.params.forEach(renderItemDescriptionsAsMarkdown); From e4bed9e678ddb562df28e717e61485c7d8c9ff08 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 19 Feb 2022 16:31:37 +0000 Subject: [PATCH 030/131] Bump simple-get from 3.1.0 to 3.1.1 Bumps [simple-get](https://github.com/feross/simple-get) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/feross/simple-get/releases) - [Commits](https://github.com/feross/simple-get/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: simple-get dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5549a03326..7b3c16289a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14028,9 +14028,9 @@ "dev": true }, "simple-get": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", - "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", "dev": true, "optional": true, "requires": { @@ -14050,9 +14050,9 @@ } }, "mimic-response": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.0.0.tgz", - "integrity": "sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", "dev": true, "optional": true } From 6d6aeda3313651ad07e67b44d7d790dd62537f4e Mon Sep 17 00:00:00 2001 From: Zearin Date: Sun, 20 Feb 2022 12:03:59 -0500 Subject: [PATCH 031/131] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Minor edits, mostly intended to make this easier to read for first-time contributors or beginners. Edits are as follows: * References to files or folders in this repo are prefixed with the 📄 and 📁 emoji, respectively * References to files or folders in this repo are enclosed in backticks (which was done before, but inconsistently) * The inline code examples of what _not_ to do are are enclosed in backticks * Other minor cosmetic tweaks --- contributor_docs/README.md | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/contributor_docs/README.md b/contributor_docs/README.md index 45d4cc3003..56f4de4984 100644 --- a/contributor_docs/README.md +++ b/contributor_docs/README.md @@ -14,10 +14,10 @@ We are prioritizing work that expands access (inclusion and accessibility) to p5 The overarching p5.js project includes some repositories other than this one: -- [p5.js](https://github.com/processing/p5.js): This repository contains the source code for the p5.js library. The [user-facing p5.js reference manual](https://p5js.org/reference/) is also generated from the [JSDoc](http://usejsdoc.org/) comments included in this source code. It is maintained by [Qianqian Q Ye](https://github.com/qianqianye) and [evelyn masso](https://github.com/outofambit). -- [p5.js-website](https://github.com/processing/p5.js-website) This repository contains most of the code for the [p5.js website](http://p5js.org), with the exception of the reference manual. It is maintained by [Kenneth Lim](https://github.com/limzykenneth), [Qianqian Q Ye](https://github.com/qianqianye) and [evelyn masso](https://github.com/outofambit). -- [p5.js-sound](https://github.com/processing/p5.js-sound) This repository contains the p5.sound.js library. It is maintained by [Jason Sigal](https://github.com/therewasaguy). -- [p5.js-web-editor](https://github.com/processing/p5.js-web-editor) This repository contains the source code for the [p5.js web editor](https://editor.p5js.org). It is maintained by [Cassie Tarakajian](https://github.com/catarak). Note that the older [p5.js editor](https://github.com/processing/p5.js-editor) is now deprecated. +- **[p5.js](https://github.com/processing/p5.js)**: This repository contains the source code for the p5.js library. The [user-facing p5.js reference manual](https://p5js.org/reference/) is also generated from the [JSDoc](http://usejsdoc.org/) comments included in this source code. It is maintained by [Qianqian Q Ye](https://github.com/qianqianye) and [evelyn masso](https://github.com/outofambit). +- **[p5.js-website](https://github.com/processing/p5.js-website)**: This repository contains most of the code for the [p5.js website](http://p5js.org), with the exception of the reference manual. It is maintained by [Kenneth Lim](https://github.com/limzykenneth), [Qianqian Q Ye](https://github.com/qianqianye) and [evelyn masso](https://github.com/outofambit). +- **[p5.js-sound](https://github.com/processing/p5.js-sound)**: This repository contains the p5.sound.js library. It is maintained by [Jason Sigal](https://github.com/therewasaguy). +- **[p5.js-web-editor](https://github.com/processing/p5.js-web-editor)**: This repository contains the source code for the [p5.js web editor](https://editor.p5js.org). It is maintained by [Cassie Tarakajian](https://github.com/catarak). Note that the older [p5.js editor](https://github.com/processing/p5.js-editor) is now deprecated. @@ -25,22 +25,22 @@ The overarching p5.js project includes some repositories other than this one: There are a lot of files here! Here's a brief overview. It can be confusing, but you don't need to understand every file in the repository to get started. We recommend beginning in one area (for example, fixing some inline documentation), and working your way outwards to exploring more. Luisa Pereira's [Looking Inside p5.js](https://www.luisapereira.net/teaching/materials/processing-foundation) also gives a video tour of the tools and files used in the p5.js workflow. -- `contributor_docs/` contains documents that explain practices and principles for contributors -- `docs/` does not actually contain docs! Rather, it contains the code used to *generate* the [online reference manual](https://p5js.org/reference/). -- `lib/` contains an empty example and the p5.sound add-on, which is periodically updated via pull request from the [p5.js-sound repository](https://github.com/processing/p5.js-sound). This is also where the built p5.js library gets placed after being compiled to a single file using [Grunt](https://gruntjs.com/). It does not need to be checked into the github repository when you make a pull request. -- `src/` contains all the source code for the library, which is topically organized into separated modules. This is what you'll work on if you are changing p5.js. Most folders have their own readme.md files inside to help you find your way around. -- `tasks/` contains scripts which perform automated tasks related to the build, deployment, and release of new versions of p5.js. -- `tests/` contains unit tests which ensure the library continues to function correctly as changes are made. -- `utils/` might contain additional files useful for the repository, but generally you can ignore this directory. +- 📁`contributor_docs/` contains documents that explain practices and principles for contributors +- 📁`docs/` does not actually contain docs! Rather, it contains the code used to *generate* the [online reference manual](https://p5js.org/reference/). +- 📁`lib/` contains an empty example and the p5.sound add-on, which is periodically updated via pull request from the [p5.js-sound repository](https://github.com/processing/p5.js-sound). This is also where the built p5.js library gets placed after being compiled to a single file using [Grunt](https://gruntjs.com/). It does not need to be checked into the github repository when you make a pull request. +- 📁`src/` contains all the source code for the library, which is topically organized into separated modules. This is what you'll work on if you are changing p5.js. Most folders have their own readme.md files inside to help you find your way around. +- 📁`tasks/` contains scripts which perform automated tasks related to the build, deployment, and release of new versions of p5.js. +- 📁`tests/` contains unit tests which ensure the library continues to function correctly as changes are made. +- 📁`utils/` might contain additional files useful for the repository, but generally you can ignore this directory. # Documentation -We realize the documentation is the most important part of this project. Poor documentation is one of the main barriers to access for new users and contributors, making the project less inclusive. The [contributing_documentation.md](./contributing_documentation.md) page gives an in-depth overview of getting started with documentation. The documentation for p5.js can be found in a few main places: +We realize the documentation is the most important part of this project. Poor documentation is one of the main barriers to access for new users and contributors, making the project less inclusive. The 📄[`contributing_documentation.md`](./contributing_documentation.md) page gives an in-depth overview of getting started with documentation. The documentation for p5.js can be found in a few main places: -- The [p5js.org/reference](https://p5js.org/reference/) is generated from [inline documentation](./inline_documentation.md) in the source code itself. This includes the text descriptions and parameters as well as the accompanying code snippet examples. We place all this inline to keep the code and documentation closely linked, and to reinforce the idea that contributing to documentation is as important (if not more) than contributing to the code. When the library gets built, it checks the inline documentation and examples to ensure they match up with the way the code behaves. To contribute, you can start by looking at the [inline_documentation.md](./inline_documentation.md) page. -- The [p5js.org/examples](http://p5js.org/examples) page contains longer examples that can be useful for learning p5.js. To contribute, you can start by looking at the [adding_examples.md](https://github.com/processing/p5.js-website/blob/main/contributor_docs/Adding_examples.md) page. +- The [p5js.org/reference](https://p5js.org/reference/) is generated from [inline documentation](./inline_documentation.md) in the source code itself. This includes the text descriptions and parameters as well as the accompanying code snippet examples. We place all this inline to keep the code and documentation closely linked, and to reinforce the idea that contributing to documentation is as important (if not more) than contributing to the code. When the library gets built, it checks the inline documentation and examples to ensure they match up with the way the code behaves. To contribute, you can start by looking at the 📄[`inline_documentation.md`](./inline_documentation.md) page. +- The [p5js.org/examples](http://p5js.org/examples) page contains longer examples that can be useful for learning p5.js. To contribute, you can start by looking at the 📄[`adding_examples.md`](https://github.com/processing/p5.js-website/blob/main/contributor_docs/Adding_examples.md) page. - The [p5js.org/learn](https://p5js.org/learn) page contains tutorials to help you learn concepts of p5.js and programming. To contribute, you can start by looking at the [p5.js guide to contributing to tutorials](https://p5js.org/learn/tutorial-guide.html). - You'll notice the p5.js website currently supports a few different languages. This is called internationalization (or i18n for short). You can read more about this documentation on the [i18n_contribution](https://github.com/processing/p5.js-website/blob/main/contributor_docs/i18n_contribution.md) page. @@ -52,13 +52,13 @@ We realize the documentation is the most important part of this project. Poor do * If you'd like to start working on an existing issue, comment on the issue that you plan to work on it so other contributors know it's being handled and can offer help. -* Once you have completed your work on this issue, [submit a pull request (PR)](./preparing_a_pull_request.md) against the p5.js main branch. In the description field of the PR, include "resolves #XXXX" tagging the issue you are fixing. If the PR addresses the issue but doesn't completely resolve it (ie the issue should remain open after your PR is merged), write "addresses #XXXX". +* Once you have completed your work on this issue, [submit a pull request (“PR”)](./preparing_a_pull_request.md) against the p5.js main branch. In the description field of the PR, include "resolves #XXXX" tagging the issue you are fixing. If the PR addresses the issue but doesn't completely resolve it (ie the issue should remain open after your PR is merged), write "addresses #XXXX". * If you discover a bug or have an idea for a new feature you'd like to add, begin by submitting an issue. Please do not simply submit a pull request containing the fix or new feature without making an issue first, we will probably not be able to accept it. Once you have gotten some feedback on the issue and a go ahead to address it, you can follow the process above to contribute the fix or feature. * You can triage issues which may include reproducing bug reports or asking for vital information, such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to p5.js on CodeTriage](https://www.codetriage.com/processing/p5.js). [![Open Source Helpers](https://www.codetriage.com/processing/p5.js/badges/users.svg)](https://www.codetriage.com/processing/p5.js) -* The [organization.md](https://github.com/processing/p5.js/blob/main/contributor_docs/organization.md) file gives a high-level overview of how issues can be organized and the decision making processes around them. Please feel welcome to get involved with this if you are interested. +* The 📄[`organization.md`](https://github.com/processing/p5.js/blob/main/contributor_docs/organization.md) file gives a high-level overview of how issues can be organized and the decision making processes around them. Please feel welcome to get involved with this if you are interested. @@ -136,7 +136,7 @@ $ npm run lint:fix Sticking with the established project style is usually preferable, but [occasionally](https://github.com/processing/p5.js/search?utf8=%E2%9C%93&q=prettier-ignore&type=) using an alternate syntax might make your code easier to understand. For these cases, Prettier [offers an escape hatch](https://prettier.io/docs/en/ignore.html), the `// prettier-ignore` comment, which you can use to make granular exceptions. Try to avoid using this if you can, because there are good reasons for most of the style preferences enforced by the linting. -Here is a quick summary of code style rules. Please note that this list may be incomplete, and it's best to refer to the [.prettierrc](https://github.com/processing/p5.js/blob/main/.prettierrc) and [.eslintrc](https://github.com/processing/p5.js/blob/main/.eslintrc) files for the full list. +Here is a quick summary of code style rules. Please note that this list may be incomplete, and it's best to refer to the 📄[`.prettierrc`](https://github.com/processing/p5.js/blob/main/.prettierrc) and 📄[`.eslintrc`](https://github.com/processing/p5.js/blob/main/.eslintrc) files for the full list. * ES6 code syntax is used * Use single quotes (rather than double quotes) @@ -145,7 +145,7 @@ Here is a quick summary of code style rules. Please note that this list may be i * All variables defined in the code should be used at least once, or removed completely -* Do not compare x == true or x == false. Use (x) or (!x) instead. x == true, is certainly different from if (x)! Compare objects to null, numbers to 0 or strings to "", if there is chance for confusion. +* Do not compare `x == true` or `x == false`. Use `(x)` or `(!x)` instead. `x == true` is certainly different from `if (x)`! Compare objects to `null`, numbers to `0`, or strings to `""`, if there is chance for confusion. * Comment your code whenever there is ambiguity or complexity in the function you are writing @@ -155,7 +155,7 @@ Here is a quick summary of code style rules. Please note that this list may be i ## Unit Tests -Unit tests are small pieces of code which are created as complements to the primary logic and perform validation. The [unit_testing.md](./unit_testing.md) page gives more information about working with unit tests. If you are developing a major new feature for p5.js, you should probably include tests. Do not submit pull requests in which the tests do not pass, because that means something is broken. +Unit tests are small pieces of code which are created as complements to the primary logic and perform validation. The 📄[`unit_testing.md`](./unit_testing.md) page gives more information about working with unit tests. If you are developing a major new feature for p5.js, you should probably include tests. Do not submit pull requests in which the tests do not pass, because that means something is broken. In order to run unit tests, you'll need to make sure you have installed the project's dependencies. @@ -182,15 +182,15 @@ $ npm run dev With the server running, you should be able to open `test/test.html` in a browser. -A complete guide to unit testing is beyond the scope of the p5.js documentation, but the short version is that any major changes or new features implemented in the source code contained in the `src/` directory should also be accompanied by test files in the `test/` directory that can be executed by Mocha to verify consistent behavior in all future versions of the library. When writing unit tests, use the [Chai.js reference](http://www.chaijs.com/api/assert/) as a guide for phrasing your assertion messages so that any errors caught by your tests in the future will be consistent and consequently easier for other developers to understand. +A complete guide to unit testing is beyond the scope of the p5.js documentation, but the short version is that any major changes or new features implemented in the source code contained in the 📁`src/` directory should also be accompanied by test files in the 📁`test/` directory that can be executed by Mocha to verify consistent behavior in all future versions of the library. When writing unit tests, use the [Chai.js reference](http://www.chaijs.com/api/assert/) as a guide for phrasing your assertion messages so that any errors caught by your tests in the future will be consistent and consequently easier for other developers to understand. # Miscellaneous -- There are other files in the [contributor_docs/](https://github.com/processing/p5.js/tree/main/contributor_docs) folder that you might explore. They pertain to contributing to specific areas of this project, both technical and non-technical. +- There are other files in the 📁[`contributor_docs/`](https://github.com/processing/p5.js/tree/main/contributor_docs) folder that you might explore. They pertain to contributing to specific areas of this project, both technical and non-technical. - [Looking Inside p5.js](https://www.luisapereira.net/teaching/materials/processing-foundation) is a video tour of the tools and files used in the p5.js development workflow. - [This video from The Coding Train](https://youtu.be/Rr3vLyP1Ods) :train::rainbow: gives an overview of getting started with technical contribution to p5.js. - The p5.js [Docker image](https://github.com/toolness/p5.js-docker) can be mounted in [Docker](https://www.docker.com/) and used to develop p5.js without requiring manual installation of requirements like [Node](https://nodejs.org/) or otherwise affecting the host operating system in any way, aside from the installation of Docker. -- The build process for the p5.js library generates a [json data file](https://p5js.org/reference/data.json) which contains the public API of p5.js and can be used in automated tooling, such as for autocompleting p5.js methods in an editor. This file is hosted on the p5.js website, but it is not included as part of the repository. +- The build process for the p5.js library generates a [JSON data file](https://p5js.org/reference/data.json) which contains the public API of p5.js and can be used in automated tooling, such as for autocompleting p5.js methods in an editor. This file is hosted on the p5.js website, but it is not included as part of the repository. - p5.js has recently migrated to [ES6](https://en.wikipedia.org/wiki/ECMAScript#6th_Edition_-_ECMAScript_2015). To see how this transition could effect your contribution please visit [ES6 adoption](./es6-adoption.md). From 2c5e54fb9c14e6ecf32dbc15224211292f9948b5 Mon Sep 17 00:00:00 2001 From: Zearin Date: Sun, 20 Feb 2022 13:02:21 -0500 Subject: [PATCH 032/131] docs(src/events): Fix `describe()` in wrong example --- src/events/acceleration.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/events/acceleration.js b/src/events/acceleration.js index 7ca8f371aa..6629133335 100644 --- a/src/events/acceleration.js +++ b/src/events/acceleration.js @@ -548,6 +548,8 @@ p5.prototype.setShakeThreshold = function(val) { * function draw() { * fill(value); * rect(25, 25, 50, 50); + * describe(`50×50 black rect in center of canvas. + * turns white on mobile when device turns`); * } * function deviceTurned() { * if (value === 0) { @@ -569,8 +571,6 @@ p5.prototype.setShakeThreshold = function(val) { * fill(value); * rect(25, 25, 50, 50); * describe(`50×50 black rect in center of canvas. - * turns white on mobile when device turns`); - * describe(`50×50 black rect in center of canvas. * turns white on mobile when x-axis turns`); * } * function deviceTurned() { From 346a9ee9ee6ab048c75f0bb25d0870928e056726 Mon Sep 17 00:00:00 2001 From: JetStarBlues Date: Sun, 20 Feb 2022 21:49:21 -0700 Subject: [PATCH 033/131] minor comment cleanup --- src/webgl/light.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/webgl/light.js b/src/webgl/light.js index 3baa0a47a3..37e22138b2 100644 --- a/src/webgl/light.js +++ b/src/webgl/light.js @@ -352,16 +352,16 @@ p5.prototype.directionalLight = function(v1, v2, v3, x, y, z) { * } * function draw() { * background(0); - * //move your mouse to change light position + * // move your mouse to change light position * let locX = mouseX - width / 2; * let locY = mouseY - height / 2; * // to set the light position, * // think of the world's coordinate as: - * // -width/2,-height/2 -------- width/2,-height/2 - * // | | - * // | 0,0 | - * // | | - * // -width/2,height/2--------width/2,height/2 + * // -width/2,-height/2 ----------- width/2,-height/2 + * // | | + * // | 0,0 | + * // | | + * // -width/2,height/2 ----------- width/2,height/2 * pointLight(250, 250, 250, locX, locY, 50); * noStroke(); * sphere(40); @@ -632,16 +632,16 @@ p5.prototype.lightFalloff = function( * } * function draw() { * background(0); - * //move your mouse to change light position + * // move your mouse to change light position * let locX = mouseX - width / 2; * let locY = mouseY - height / 2; * // to set the light position, * // think of the world's coordinate as: - * // -width/2,-height/2 -------- width/2,-height/2 - * // | | - * // | 0,0 | - * // | | - * // -width/2,height/2--------width/2,height/2 + * // -width/2,-height/2 ----------- width/2,-height/2 + * // | | + * // | 0,0 | + * // | | + * // -width/2,height/2 ----------- width/2,height/2 * ambientLight(50); * spotLight(0, 250, 0, locX, locY, 100, 0, 0, -1, Math.PI / 16); * noStroke(); From 590a5e2be37c663b484fecc80eb89a28771fb3d1 Mon Sep 17 00:00:00 2001 From: JetStarBlues Date: Sun, 20 Feb 2022 22:29:38 -0700 Subject: [PATCH 034/131] make ambientLight examples nearly identical to emphasize single difference --- src/webgl/light.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/webgl/light.js b/src/webgl/light.js index 37e22138b2..5eef59a3c8 100644 --- a/src/webgl/light.js +++ b/src/webgl/light.js @@ -34,10 +34,16 @@ import * as constants from '../core/constants'; * @example *
* - * createCanvas(100, 100, WEBGL); - * ambientLight(0); // black light (no light) - * ambientMaterial(255, 127, 80); // coral material - * sphere(40); + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * } + * function draw() { + * background(100); + * ambientLight(0); // black light (no light) + * ambientMaterial(255, 127, 80); // coral material + * sphere(40); + * } * *
* @alt @@ -48,12 +54,13 @@ import * as constants from '../core/constants'; * * function setup() { * createCanvas(100, 100, WEBGL); + * noStroke(); * } * function draw() { - * background(51); + * background(100); * ambientLight(255); // white light * ambientMaterial(255, 127, 80); // coral material - * box(30); + * sphere(40); * } * * From a1d0d60dbeb23e6824b76dc4ac7667e786fcfb4a Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 22 Feb 2022 15:30:35 +0000 Subject: [PATCH 035/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a80944a7aa..ce55e2b5a8 100644 --- a/README.md +++ b/README.md @@ -542,6 +542,7 @@ We recognize all types of contributions. This project follows the [all-contribut
Beau Muylle

📖 +
Ivy Feraco

🐛 From 9bceb5d4ee31b76c854b4b3d7c7a354deb835d68 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 22 Feb 2022 15:30:35 +0000 Subject: [PATCH 036/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 7176429ed8..dcbefda2ae 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2913,6 +2913,15 @@ "contributions": [ "doc" ] + }, + { + "login": "unjust", + "name": "Ivy Feraco", + "avatar_url": "https://avatars.githubusercontent.com/u/92090?v=4", + "profile": "https://github.com/unjust", + "contributions": [ + "bug" + ] } ], "repoType": "github", From 05332ea6c6eef2bd6aaa7b3c3410a3a9919d4bc5 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 22 Feb 2022 15:39:04 +0000 Subject: [PATCH 037/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ce55e2b5a8..b523e29fad 100644 --- a/README.md +++ b/README.md @@ -543,6 +543,7 @@ We recognize all types of contributions. This project follows the [all-contribut
Beau Muylle

📖
Ivy Feraco

🐛 +
Gareth Williams

💻 From 90a6a2b5737b5c7c6937c2b05fa839464e6cf63f Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 22 Feb 2022 15:39:05 +0000 Subject: [PATCH 038/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index dcbefda2ae..85d2103f8a 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2922,6 +2922,15 @@ "contributions": [ "bug" ] + }, + { + "login": "Gaweph", + "name": "Gareth Williams", + "avatar_url": "https://avatars.githubusercontent.com/u/6419944?v=4", + "profile": "http://RandomSyntax.Net", + "contributions": [ + "code" + ] } ], "repoType": "github", From 7fde440f5622ac8cb4a451ad9085d365a69443ce Mon Sep 17 00:00:00 2001 From: Ikko Ashimine Date: Wed, 23 Feb 2022 21:14:21 +0900 Subject: [PATCH 039/131] Fix typo in vertex.js postive -> positive --- src/core/shape/vertex.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/shape/vertex.js b/src/core/shape/vertex.js index d6d6a1ea5d..b6abe9aec6 100644 --- a/src/core/shape/vertex.js +++ b/src/core/shape/vertex.js @@ -781,7 +781,7 @@ p5.prototype.endShape = function(mode) { * * * @alt - * backwards s-shaped black line with the same s-shaped line in postive z-axis. + * backwards s-shaped black line with the same s-shaped line in positive z-axis. */ p5.prototype.quadraticVertex = function(...args) { p5._validateParameters('quadraticVertex', args); From 5279bb0e027aeb6f98e570ee12e3c0eb325e6f86 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 23 Feb 2022 13:59:45 +0000 Subject: [PATCH 040/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b523e29fad..67786fe7b8 100644 --- a/README.md +++ b/README.md @@ -544,6 +544,7 @@ We recognize all types of contributions. This project follows the [all-contribut
Beau Muylle

📖
Ivy Feraco

🐛
Gareth Williams

💻 +
Ikko Ashimine

📖 From f84f5d879aa8e83f30eea84b0d6283d29067e2b5 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 23 Feb 2022 13:59:45 +0000 Subject: [PATCH 041/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 85d2103f8a..90ef2eebbc 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2931,6 +2931,15 @@ "contributions": [ "code" ] + }, + { + "login": "eltociear", + "name": "Ikko Ashimine", + "avatar_url": "https://avatars.githubusercontent.com/u/22633385?v=4", + "profile": "https://bandism.net/", + "contributions": [ + "doc" + ] } ], "repoType": "github", From 5b27da243118e9b3fdb6e919f7902933e60fbce9 Mon Sep 17 00:00:00 2001 From: Zearin Date: Sat, 26 Feb 2022 10:45:11 -0500 Subject: [PATCH 042/131] =?UTF-8?q?docs(src/events):=20Replace=20=E2=80=9C?= =?UTF-8?q?=C3=97=E2=80=9D=20for=20screen=20readers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/events/acceleration.js | 16 ++++++++-------- src/events/keyboard.js | 6 +++--- src/events/mouse.js | 24 ++++++++++++------------ src/events/touch.js | 6 +++--- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/events/acceleration.js b/src/events/acceleration.js index 6629133335..ecc7e6463d 100644 --- a/src/events/acceleration.js +++ b/src/events/acceleration.js @@ -392,9 +392,9 @@ p5.prototype._updatePRotations = function() { * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`50×50 black rect in center of canvas. + * describe(`50-by-50 black rect in center of canvas. * turns white on mobile when device turns`); - * describe(`50×50 black rect in center of canvas. + * describe(`50-by-50 black rect in center of canvas. * turns white on mobile when x-axis turns`); * } * function deviceTurned() { @@ -435,7 +435,7 @@ let shake_threshold = 30; * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`50×50 black rect in center of canvas. + * describe(`50-by-50 black rect in center of canvas. * turns white on mobile when device moves`); * } * function deviceMoved() { @@ -477,7 +477,7 @@ p5.prototype.setMoveThreshold = function(val) { * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`50×50 black rect in center of canvas. + * describe(`50-by-50 black rect in center of canvas. * turns white on mobile when device is being shaked`); * } * function deviceMoved() { @@ -515,7 +515,7 @@ p5.prototype.setShakeThreshold = function(val) { * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`50×50 black rect in center of canvas. + * describe(`50-by-50 black rect in center of canvas. * turns white on mobile when device moves`); * } * function deviceMoved() { @@ -548,7 +548,7 @@ p5.prototype.setShakeThreshold = function(val) { * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`50×50 black rect in center of canvas. + * describe(`50-by-50 black rect in center of canvas. * turns white on mobile when device turns`); * } * function deviceTurned() { @@ -570,7 +570,7 @@ p5.prototype.setShakeThreshold = function(val) { * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`50×50 black rect in center of canvas. + * describe(`50-by-50 black rect in center of canvas. * turns white on mobile when x-axis turns`); * } * function deviceTurned() { @@ -603,7 +603,7 @@ p5.prototype.setShakeThreshold = function(val) { * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`50×50 black rect in center of canvas. + * describe(`50-by-50 black rect in center of canvas. * turns white on mobile when device shakes`); * } * function deviceShaken() { diff --git a/src/events/keyboard.js b/src/events/keyboard.js index 228567e0e1..e49c750d76 100644 --- a/src/events/keyboard.js +++ b/src/events/keyboard.js @@ -23,7 +23,7 @@ import p5 from '../core/main'; * fill(255); * } * rect(25, 25, 50, 50); - * describe('50×50 white rect that turns black on keypress.'); + * describe('50-by-50 white rect that turns black on keypress.'); * } * * @@ -338,7 +338,7 @@ p5.prototype._onblur = function(e) { * * clear(); * ellipse(x, y, 50, 50); - * describe(`50×50 red ellipse moves left, right, up, and + * describe(`50-by-50 red ellipse moves left, right, up, and * down with arrow presses.`); * } * @@ -364,7 +364,7 @@ p5.prototype._onblur = function(e) { * clear(); * fill(255, 0, 0); * ellipse(50, 50, diameter, diameter); - * describe(`50×50 red ellipse gets bigger or smaller when + * describe(`50-by-50 red ellipse gets bigger or smaller when * + or - are pressed.`); * } * diff --git a/src/events/mouse.js b/src/events/mouse.js index a8e3df0878..91a4c5c7c0 100644 --- a/src/events/mouse.js +++ b/src/events/mouse.js @@ -178,7 +178,7 @@ p5.prototype.pmouseX = 0; * } * * print(pmouseY + ' -> ' + mouseY); - * describe(`60×60 black rect center, fuchsia background. + * describe(`60-by-60 black rect center, fuchsia background. * rect flickers on mouse movement`); * } * @@ -215,7 +215,7 @@ p5.prototype.pmouseY = 0; * * //the y of the square is relative to the canvas * rect(20, mouseY, 60, 60); - * describe(`60×60 black rect y moves with mouse y and fuchsia + * describe(`60-by-60 black rect y moves with mouse y and fuchsia * canvas moves with mouse x`); * } * @@ -252,7 +252,7 @@ p5.prototype.winMouseX = 0; * * //the x of the square is relative to the canvas * rect(mouseX, 20, 60, 60); - * describe(`60×60 black rect x moves with mouse x and + * describe(`60-by-60 black rect x moves with mouse x and * fuchsia canvas y moves with mouse y`); * } * @@ -367,7 +367,7 @@ p5.prototype.pwinMouseY = 0; * } * * print(mouseButton); - * describe(`50×50 black ellipse appears on center of fuchsia + * describe(`50-by-50 black ellipse appears on center of fuchsia * canvas on mouse click/press.`); * } * @@ -396,7 +396,7 @@ p5.prototype.mouseButton = 0; * } * * print(mouseIsPressed); - * describe(`black 50×50 rect becomes ellipse with mouse click/press. + * describe(`black 50-by-50 rect becomes ellipse with mouse click/press. * fuchsia background.`); * } * @@ -485,7 +485,7 @@ p5.prototype._setMouseButton = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`black 50×50 rect becomes lighter with mouse movements until + * describe(`black 50-by-50 rect becomes lighter with mouse movements until * white then resets no image displayed`); * } * function mouseMoved() { @@ -538,7 +538,7 @@ p5.prototype._setMouseButton = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`black 50×50 rect turns lighter with mouse click and + * describe(`black 50-by-50 rect turns lighter with mouse click and * drag until white, resets`); * } * function mouseDragged() { @@ -618,7 +618,7 @@ p5.prototype._onmousemove = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`black 50×50 rect turns white with mouse click/press.`); + * describe(`black 50-by-50 rect turns white with mouse click/press.`); * } * function mousePressed() { * if (value === 0) { @@ -695,7 +695,7 @@ p5.prototype._onmousedown = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`black 50×50 rect turns white with mouse click/press.`); + * describe(`black 50-by-50 rect turns white with mouse click/press.`); * } * function mouseReleased() { * if (value === 0) { @@ -770,7 +770,7 @@ p5.prototype._ondragover = p5.prototype._onmousemove; * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`black 50×50 rect turns white with mouse click/press.`); + * describe(`black 50-by-50 rect turns white with mouse click/press.`); * } * * function mouseClicked() { @@ -835,7 +835,7 @@ p5.prototype._onclick = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`black 50×50 rect turns white with mouse doubleClick/press.`); + * describe(`black 50-by-50 rect turns white with mouse doubleClick/press.`); * } * * function doubleClicked() { @@ -921,7 +921,7 @@ p5.prototype._pmouseWheelDeltaY = 0; * background(237, 34, 93); * fill(0); * rect(25, pos, 50, 50); - * describe(`black 50×50 rect moves up and down with vertical scroll. + * describe(`black 50-by-50 rect moves up and down with vertical scroll. * fuchsia background`); * } * diff --git a/src/events/touch.js b/src/events/touch.js index bfda5e3a06..81c75062ee 100644 --- a/src/events/touch.js +++ b/src/events/touch.js @@ -87,7 +87,7 @@ function getTouchInfo(canvas, w, h, e, i = 0) { * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`50×50 black rect turns white with touch event.`); + * describe(`50-by-50 black rect turns white with touch event.`); * } * function touchStarted() { * if (value === 0) { @@ -166,7 +166,7 @@ p5.prototype._ontouchstart = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`50×50 black rect turns lighter with touch until white. resets`); + * describe(`50-by-50 black rect turns lighter with touch until white. resets`); * } * function touchMoved() { * value = value + 5; @@ -237,7 +237,7 @@ p5.prototype._ontouchmove = function(e) { * function draw() { * fill(value); * rect(25, 25, 50, 50); - * describe(`50×50 black rect turns white with touch.`); + * describe(`50-by-50 black rect turns white with touch.`); * } * function touchEnded() { * if (value === 0) { From ed589d5b11be8fa4e46cf4aedaf37e050d839fa7 Mon Sep 17 00:00:00 2001 From: Gareth Williams <6419944+Gaweph@users.noreply.github.com> Date: Sun, 27 Feb 2022 17:07:36 +0000 Subject: [PATCH 043/131] updated isLooping return type --- src/core/structure.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/structure.js b/src/core/structure.js index d64afaeb92..85f66004dc 100644 --- a/src/core/structure.js +++ b/src/core/structure.js @@ -138,6 +138,7 @@ p5.prototype.loop = function() { * isLooping() returns the current state for use within custom event handlers. * * @method isLooping + * @returns {boolean} * @example *
* From f287b4026f7724972ebb8accd8a214c05175cf1e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:06:06 +0000 Subject: [PATCH 044/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 67786fe7b8..75763dd00a 100644 --- a/README.md +++ b/README.md @@ -545,6 +545,7 @@ We recognize all types of contributions. This project follows the [all-contribut
Ivy Feraco

🐛
Gareth Williams

💻
Ikko Ashimine

📖 +
Jonas Rinke

🐛 From 7bb76c9f40a4c45e59a4a811a93b1b1c7a2ca5a6 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:06:07 +0000 Subject: [PATCH 045/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 90ef2eebbc..389749a0b7 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2940,6 +2940,15 @@ "contributions": [ "doc" ] + }, + { + "login": "0xJonas", + "name": "Jonas Rinke", + "avatar_url": "https://avatars.githubusercontent.com/u/24874041?v=4", + "profile": "https://github.com/0xJonas", + "contributions": [ + "bug" + ] } ], "repoType": "github", From a540b622effef99540581977096fc82b02f9508d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:12:33 +0000 Subject: [PATCH 046/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 75763dd00a..297c444722 100644 --- a/README.md +++ b/README.md @@ -546,6 +546,7 @@ We recognize all types of contributions. This project follows the [all-contribut
Gareth Williams

💻
Ikko Ashimine

📖
Jonas Rinke

🐛 +
MATSUDA, Kouichi

🐛 From 3c7c73eb2478ce10327958b9836712b2e3148021 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:12:34 +0000 Subject: [PATCH 047/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 389749a0b7..a4da2ef2bf 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2949,6 +2949,15 @@ "contributions": [ "bug" ] + }, + { + "login": "KouichiMatsuda", + "name": "MATSUDA, Kouichi", + "avatar_url": "https://avatars.githubusercontent.com/u/14014568?v=4", + "profile": "http://www.gakuin.otsuma.ac.jp/english/", + "contributions": [ + "bug" + ] } ], "repoType": "github", From e06c1e71aed9cad7e830061f65c4b4a4c8b58ef2 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:21:37 +0000 Subject: [PATCH 048/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 297c444722..25d9278c81 100644 --- a/README.md +++ b/README.md @@ -547,6 +547,7 @@ We recognize all types of contributions. This project follows the [all-contribut
Ikko Ashimine

📖
Jonas Rinke

🐛
MATSUDA, Kouichi

🐛 +
stampyzfanz

📖 From f702caa1212996e8ac90e3724f35a6566031c8b9 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:21:38 +0000 Subject: [PATCH 049/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index a4da2ef2bf..f30451b670 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2958,6 +2958,15 @@ "contributions": [ "bug" ] + }, + { + "login": "stampyzfanz", + "name": "stampyzfanz", + "avatar_url": "https://avatars.githubusercontent.com/u/34364128?v=4", + "profile": "https://github.com/stampyzfanz", + "contributions": [ + "doc" + ] } ], "repoType": "github", From c07d5f95bae2aa2b4b6752da49a71fa5228cf744 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:32:04 +0000 Subject: [PATCH 050/131] docs: update README.md [skip ci] --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 25d9278c81..084dc4d6e3 100644 --- a/README.md +++ b/README.md @@ -549,6 +549,9 @@ We recognize all types of contributions. This project follows the [all-contribut
MATSUDA, Kouichi

🐛
stampyzfanz

📖 + +
tae

🐛 + From adbed9829cb9a9ed8fea4a8d18d0720a41bad9d4 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:32:05 +0000 Subject: [PATCH 051/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index f30451b670..d4adda920d 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2967,6 +2967,15 @@ "contributions": [ "doc" ] + }, + { + "login": "taejs", + "name": "tae", + "avatar_url": "https://avatars.githubusercontent.com/u/41318449?v=4", + "profile": "https://github.com/taejs", + "contributions": [ + "bug" + ] } ], "repoType": "github", From 4719489bf6bf1b5d0089861dd06f6ac31ea3cd9c Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:33:30 +0000 Subject: [PATCH 052/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 084dc4d6e3..7ea8222281 100644 --- a/README.md +++ b/README.md @@ -551,6 +551,7 @@ We recognize all types of contributions. This project follows the [all-contribut
tae

🐛 +
Divyansh013

🌍 From 5015b1043d79d153f2b6e779efbb854ff0f32df2 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:33:31 +0000 Subject: [PATCH 053/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index d4adda920d..ee0f8e0a40 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2976,6 +2976,15 @@ "contributions": [ "bug" ] + }, + { + "login": "Divyansh013", + "name": "Divyansh013", + "avatar_url": "https://avatars.githubusercontent.com/u/85135469?v=4", + "profile": "https://github.com/Divyansh013", + "contributions": [ + "translation" + ] } ], "repoType": "github", From eb8a4a3028164aa37e715fb45350d3f055aef6ef Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:35:35 +0000 Subject: [PATCH 054/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7ea8222281..fd6cb1367f 100644 --- a/README.md +++ b/README.md @@ -552,6 +552,7 @@ We recognize all types of contributions. This project follows the [all-contribut
tae

🐛
Divyansh013

🌍 +
rinkydevi

🌍 From 7144ff3ec5f72f2d1ccf7216cc26ca20d34b9801 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:35:36 +0000 Subject: [PATCH 055/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index ee0f8e0a40..d9b7e2f920 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2985,6 +2985,15 @@ "contributions": [ "translation" ] + }, + { + "login": "rinkydevi", + "name": "rinkydevi", + "avatar_url": "https://avatars.githubusercontent.com/u/82359874?v=4", + "profile": "https://github.com/rinkydevi", + "contributions": [ + "translation" + ] } ], "repoType": "github", From dafa9ec927eaece4bc920ef9c9dd905caa1ef8c2 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:38:13 +0000 Subject: [PATCH 056/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fd6cb1367f..45c9303b23 100644 --- a/README.md +++ b/README.md @@ -553,6 +553,7 @@ We recognize all types of contributions. This project follows the [all-contribut
tae

🐛
Divyansh013

🌍
rinkydevi

🌍 +
Coding for the Arts

🐛 From 9b6a6e0f3f0c87abeab8236abded66887e9d37a5 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:38:14 +0000 Subject: [PATCH 057/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index d9b7e2f920..b05cbf15da 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2994,6 +2994,15 @@ "contributions": [ "translation" ] + }, + { + "login": "cas-c4ta", + "name": "Coding for the Arts", + "avatar_url": "https://avatars.githubusercontent.com/u/88927553?v=4", + "profile": "https://www.zhdk.ch/weiterbildung/weiterbildung-design/cas-coding-for-the-arts", + "contributions": [ + "bug" + ] } ], "repoType": "github", From c3614c0db39227a10e7a2caef327e18912565c7f Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:39:22 +0000 Subject: [PATCH 058/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 45c9303b23..8681a3bd85 100644 --- a/README.md +++ b/README.md @@ -554,6 +554,7 @@ We recognize all types of contributions. This project follows the [all-contribut
Divyansh013

🌍
rinkydevi

🌍
Coding for the Arts

🐛 +
Dan

🐛 From e36887db6db6a749edf4a28586c2cca29fa482e2 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:39:23 +0000 Subject: [PATCH 059/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index b05cbf15da..26fa94c740 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3003,6 +3003,15 @@ "contributions": [ "bug" ] + }, + { + "login": "danieljamesross", + "name": "Dan", + "avatar_url": "https://avatars.githubusercontent.com/u/28922296?v=4", + "profile": "http://danieljamesross.github.io", + "contributions": [ + "bug" + ] } ], "repoType": "github", From e944375b8fefbecfbc14bb13612902b4456155db Mon Sep 17 00:00:00 2001 From: Dave Pagurek Date: Thu, 3 Mar 2022 15:26:29 -0500 Subject: [PATCH 060/131] Replace Catmull-Rom with Curve, linking to docs --- src/core/shape/curves.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/shape/curves.js b/src/core/shape/curves.js index 0be0ab688c..8a1c97ac0d 100644 --- a/src/core/shape/curves.js +++ b/src/core/shape/curves.js @@ -454,7 +454,7 @@ p5.prototype.curveTightness = function(t) { * @param {Number} c coordinate of second point * @param {Number} d coordinate of second control point * @param {Number} t value between 0 and 1 - * @return {Number} Catmull-Rom value at position t + * @return {Number} Curve() value at position t * @example *
* From 77aeb3e147a614bb69240d12f15093ddd83c2555 Mon Sep 17 00:00:00 2001 From: Dave Pagurek Date: Thu, 3 Mar 2022 15:27:09 -0500 Subject: [PATCH 061/131] Remove extra brackets --- src/core/shape/curves.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/shape/curves.js b/src/core/shape/curves.js index 8a1c97ac0d..7821b40b35 100644 --- a/src/core/shape/curves.js +++ b/src/core/shape/curves.js @@ -454,7 +454,7 @@ p5.prototype.curveTightness = function(t) { * @param {Number} c coordinate of second point * @param {Number} d coordinate of second control point * @param {Number} t value between 0 and 1 - * @return {Number} Curve() value at position t + * @return {Number} Curve value at position t * @example *
* From 6baaee6f52f9e751c4dc7971675962d769a7bd80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Mar 2022 22:15:03 +0000 Subject: [PATCH 062/131] build(deps-dev): bump simple-git from 1.132.0 to 3.3.0 Bumps [simple-git](https://github.com/steveukx/git-js/tree/HEAD/simple-git) from 1.132.0 to 3.3.0. - [Release notes](https://github.com/steveukx/git-js/releases) - [Changelog](https://github.com/steveukx/git-js/blob/main/simple-git/CHANGELOG.md) - [Commits](https://github.com/steveukx/git-js/commits/simple-git@3.3.0/simple-git) --- updated-dependencies: - dependency-name: simple-git dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- package-lock.json | 50 +++++++++++++++++++++++++++++++++++++++-------- package.json | 2 +- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b3c16289a..c6ce817502 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2431,6 +2431,38 @@ "to-fast-properties": "^2.0.0" } }, + "@kwsites/file-exists": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", + "integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==", + "dev": true, + "requires": { + "debug": "^4.1.1" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@kwsites/promise-deferred": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz", + "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==", + "dev": true + }, "@samverschueren/stream-to-observable": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz", @@ -14059,21 +14091,23 @@ } }, "simple-git": { - "version": "1.132.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.132.0.tgz", - "integrity": "sha512-xauHm1YqCTom1sC9eOjfq3/9RKiUA9iPnxBbrY2DdL8l4ADMu0jjM5l5lphQP5YWNqAL2aXC/OeuQ76vHtW5fg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.3.0.tgz", + "integrity": "sha512-K9qcbbZwPHhk7MLi0k0ekvSFXJIrRoXgHhqMXAFM75qS68vdHTcuzmul1ilKI02F/4lXshVgBoDll2t++JK0PQ==", "dev": true, "requires": { - "debug": "^4.0.1" + "@kwsites/file-exists": "^1.1.1", + "@kwsites/promise-deferred": "^1.1.1", + "debug": "^4.3.3" }, "dependencies": { "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" } }, "ms": { diff --git a/package.json b/package.json index bd5ab68679..76acf7cb9b 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "puppeteer": "^10.2.0", "regenerator-runtime": "^0.13.3", "request": "^2.88.0", - "simple-git": "^1.132.0", + "simple-git": "^3.3.0", "whatwg-fetch": "^2.0.4" }, "license": "LGPL-2.1", From c02e933ac0d1c659eca8f9fd71f594ddcab512dc Mon Sep 17 00:00:00 2001 From: stampyzfanz <34364128+stampyzfanz@users.noreply.github.com> Date: Sat, 19 Mar 2022 11:38:03 +1100 Subject: [PATCH 063/131] Reword first issue welcome comment to mention issue forms. Fixes #5637 --- .github/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/config.yml b/.github/config.yml index 706ea19698..1d0f4cae3d 100644 --- a/.github/config.yml +++ b/.github/config.yml @@ -4,7 +4,7 @@ # Comment to be posted to on first time issues newIssueWelcomeComment: > - Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already. + Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to be sure to fill out the issue form template inputs accurately if you haven't already. # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome From ff1fde429414bdf44a1b7c374c635e78b760a2b7 Mon Sep 17 00:00:00 2001 From: Ikko Ashimine Date: Thu, 24 Mar 2022 16:13:42 +0900 Subject: [PATCH 064/131] Fix typo in fes_reference_dev_notes.md occured -> occurred --- contributor_docs/fes_reference_dev_notes.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contributor_docs/fes_reference_dev_notes.md b/contributor_docs/fes_reference_dev_notes.md index 725d2792f6..9eb625db4c 100644 --- a/contributor_docs/fes_reference_dev_notes.md +++ b/contributor_docs/fes_reference_dev_notes.md @@ -272,7 +272,7 @@ function preload() { } ```` FES will generate the following message in the console: -> 🌸 p5.js says: An error with message "Cannot read property 'background' of undefined" occured inside the p5js library when "background" was called (on line 4 in sketch.js [http://localhost:8000/lib/empty-example/sketch.js:4:3]). +> 🌸 p5.js says: An error with message "Cannot read property 'background' of undefined" occurred inside the p5js library when "background" was called (on line 4 in sketch.js [http://localhost:8000/lib/empty-example/sketch.js:4:3]). //If not stated otherwise, it might be due to "background" being called from preload. Nothing besides load calls (loadImage, loadJSON, loadFont, loadStrings, etc.) should be inside the preload function. (http://p5js.org/reference/#/p5/preload) Internal Error Example 2 @@ -283,7 +283,7 @@ function setup() { } ```` FES will generate the following message in the console: -> 🌸 p5.js says: An error with message "Cannot read property 'bind' of undefined" occured inside the p5js library when mouseClicked was called (on line 3 in sketch.js [http://localhost:8000/lib/empty-example/sketch.js:3:7]) If not stated otherwise, it might be an issue with the arguments passed to mouseClicked. (http://p5js.org/reference/#/p5/mouseClicked) +> 🌸 p5.js says: An error with message "Cannot read property 'bind' of undefined" occurred inside the p5js library when mouseClicked was called (on line 3 in sketch.js [http://localhost:8000/lib/empty-example/sketch.js:3:7]) If not stated otherwise, it might be an issue with the arguments passed to mouseClicked. (http://p5js.org/reference/#/p5/mouseClicked) Example of an Error in User's Sketch (Scope) ````JavaScript @@ -483,4 +483,4 @@ const original_functions = { ``` * Generate the FES reference from the inline doc. This generated reference can be a separate system from our main [p5.js reference], to keep functions for sketch and console separate to reduce possible confusion. -[p5.js reference]: https://p5js.org/reference/ \ No newline at end of file +[p5.js reference]: https://p5js.org/reference/ From 194c0dc472e6eeea1f3460d850b5680772eb7123 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Thu, 24 Mar 2022 10:50:35 +0100 Subject: [PATCH 065/131] refactor: replace deprecated String.prototype.substr() .substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher --- docs/preprocessor.js | 2 +- src/core/friendly_errors/sketch_reader.js | 4 ++-- src/core/friendly_errors/validate_params.js | 10 +++++----- src/typography/loading_displaying.js | 4 ++-- test/js/sinon.js | 16 ++++++++-------- test/unit/color/p5.Color.js | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/preprocessor.js b/docs/preprocessor.js index 3d8cabcaec..08938280f0 100644 --- a/docs/preprocessor.js +++ b/docs/preprocessor.js @@ -10,7 +10,7 @@ function smokeTestMethods(data) { if ( classitem.access !== 'private' && - classitem.file.substr(0, 3) === 'src' && + classitem.file.slice(0, 3) === 'src' && classitem.name && !classitem.example ) { diff --git a/src/core/friendly_errors/sketch_reader.js b/src/core/friendly_errors/sketch_reader.js index 009a728d7c..edace305fc 100644 --- a/src/core/friendly_errors/sketch_reader.js +++ b/src/core/friendly_errors/sketch_reader.js @@ -235,8 +235,8 @@ if (typeof IS_MINIFIED !== 'undefined') { //create a new string which don't have multiline comments while (start !== -1 && end !== -1) { if (start === 0) { - code = code.substr(end + 2); - } else code = code.substr(0, start) + code.substr(end + 2); + code = code.slice(end + 2); + } else code = code.slice(0, start) + code.slice(end + 2); start = code.indexOf('/*'); end = code.indexOf('*/'); diff --git a/src/core/friendly_errors/validate_params.js b/src/core/friendly_errors/validate_params.js index 18e4a348f8..9e153fb47a 100644 --- a/src/core/friendly_errors/validate_params.js +++ b/src/core/friendly_errors/validate_params.js @@ -204,8 +204,8 @@ if (typeof IS_MINIFIED !== 'undefined') { // look for the docs in the `data.json` datastructure const ichDot = func.lastIndexOf('.'); - const funcName = func.substr(ichDot + 1); - const funcClass = func.substr(0, ichDot) || 'p5'; + const funcName = func.slice(ichDot + 1); + const funcClass = func.slice(0, ichDot !== -1 ? ichDot : 0) || 'p5'; const classitems = arrDoc; let queryResult = classitems[funcClass][funcName]; @@ -247,10 +247,10 @@ if (typeof IS_MINIFIED !== 'undefined') { // split this parameter's types format.types = format.type.split('|').map(function ct(type) { // array - if (type.substr(type.length - 2, 2) === '[]') { + if (type.slice(-2) === '[]') { return { name: type, - array: ct(type.substr(0, type.length - 2)) + array: ct(type.slice(0, -2)) }; } @@ -298,7 +298,7 @@ if (typeof IS_MINIFIED !== 'undefined') { } // function - if (lowerType.substr(0, 'function'.length) === 'function') { + if (lowerType.slice(0, 'function'.length) === 'function') { lowerType = 'function'; } // builtin diff --git a/src/typography/loading_displaying.js b/src/typography/loading_displaying.js index a83f3470b5..5c046adf72 100644 --- a/src/typography/loading_displaying.js +++ b/src/typography/loading_displaying.js @@ -119,11 +119,11 @@ p5.prototype.loadFont = function(path, onSuccess, onError) { const lastDotIdx = fileNoPath.lastIndexOf('.'); let fontFamily; let newStyle; - const fileExt = lastDotIdx < 1 ? null : fileNoPath.substr(lastDotIdx + 1); + const fileExt = lastDotIdx < 1 ? null : fileNoPath.slice(lastDotIdx + 1); // if so, add it to the DOM (name-only) for use with DOM module if (validFontTypes.includes(fileExt)) { - fontFamily = fileNoPath.substr(0, lastDotIdx); + fontFamily = fileNoPath.slice(0, lastDotIdx !== -1 ? lastDotIdx : 0); newStyle = document.createElement('style'); newStyle.appendChild( document.createTextNode( diff --git a/test/js/sinon.js b/test/js/sinon.js index c84a8597c4..f0a9e842e8 100644 --- a/test/js/sinon.js +++ b/test/js/sinon.js @@ -5,13 +5,13 @@ * @author Contributors: https://github.com/cjohansen/Sinon.JS/blob/master/AUTHORS * * (The BSD License) - * + * * Copyright (c) 2010-2014, Christian Johansen, christian@cjohansen.no * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: - * + * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, @@ -20,7 +20,7 @@ * * Neither the name of Christian Johansen nor the names of his contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -463,7 +463,7 @@ module.exports = m(require("samsam")); }) || function (m) { this.formatio = m(this.samsam); } )(function (samsam) { - + var formatio = { excludeConstructors: ["Object", /^.$/], quoteStrings: true, @@ -566,7 +566,7 @@ processed.push(array); var pieces = []; var i, l; - l = (this.limitChildrenCount > 0) ? + l = (this.limitChildrenCount > 0) ? Math.min(this.limitChildrenCount, array.length) : array.length; for (i = 0; i < l; ++i) { @@ -586,7 +586,7 @@ var pieces = [], properties = samsam.keys(object).sort(); var length = 3; var prop, str, obj, i, k, l; - l = (this.limitChildrenCount > 0) ? + l = (this.limitChildrenCount > 0) ? Math.min(this.limitChildrenCount, properties.length) : properties.length; for (i = 0; i < l; ++i) { @@ -636,7 +636,7 @@ var content = element.innerHTML; if (content.length > 20) { - content = content.substr(0, 20) + "[...]"; + content = content.slice(0, 20) + "[...]"; } var res = formatted + pairs.join(" ") + ">" + content + diff --git a/test/unit/color/p5.Color.js b/test/unit/color/p5.Color.js index a4b274c4fc..43ffaa4f02 100644 --- a/test/unit/color/p5.Color.js +++ b/test/unit/color/p5.Color.js @@ -986,7 +986,7 @@ suite('p5.Color', function() { test('should generate (r,g,b,a) color string with 0-1 normalized alpha', function() { // Will not exactly equal 0.5 due to math: test "0.5" substr of // 'rgba(128,0,128,0.5...' instead of checking the entire string - assert.equal(colorStr.substr(15, 3), '0.5'); + assert.equal(colorStr.slice(15, 18), '0.5'); }); test('should consistently generate the same output', function() { From 64312f8d25c0f9a737a40cd269adb70faca609e3 Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Fri, 25 Mar 2022 19:55:29 -0700 Subject: [PATCH 066/131] Reorganize & add PF projects --- contributor_docs/project_wrapups/README.md | 60 ++++++++++++++++------ 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/contributor_docs/project_wrapups/README.md b/contributor_docs/project_wrapups/README.md index 57d35cbe3d..bc72124ce8 100644 --- a/contributor_docs/project_wrapups/README.md +++ b/contributor_docs/project_wrapups/README.md @@ -1,8 +1,10 @@ -This folder contains wrapup reports for projects from p5.js related [Google Summer of Code](https://summerofcode.withgoogle.com/organizations/4915113891463168/) projects, [Processing Fellowships](https://processingfoundation.org/fellowships), and others. +This folder contains wrap-up reports from p5.js related [Google Summer of Code](https://summerofcode.withgoogle.com/organizations/4915113891463168/) and [Processing Fellowships](https://processingfoundation.org/fellowships) projects. *Note for contributors: Embedded images and media are welcome. Please host these files externally rather than placing in this repo to avoid adding growing the repository filesize too much.* +## Google Summer of Code + ### Google Summer of Code 2021 * [Adding Alt Text to the p5.js Website](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/katiejliu_gsoc_2021.md) by Katie Liu, 2021 * [Adding to p5.js Friendly Error System](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/shantanuKaushik_gsoc_2021.md) by Shantanu Kaushik, 2021 @@ -21,7 +23,6 @@ This folder contains wrapup reports for projects from p5.js related [Google Summ * [p5 for 50+ teaching](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/inhwayeom_gsoc_2020.md) by Inhwa Yeom, 2020 * [i18n improvements and Italian translation](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/yukienomiya_gsoc_2020.md) by Yukie Nomiya, 2020 - ### Google Summer of Code 2019 * [Search Bar for Sketches in the p5.js Web Editor](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/rachellim_gsoc_2019.md) by Rachel Lim, 2019 * [Improving WebGL functionality of p5.js](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/sanket_gsoc_2019.md) by [Sanket Singh](https://github.com/sanketsingh24), 2019 @@ -33,14 +34,7 @@ This folder contains wrapup reports for projects from p5.js related [Google Summ * [Curating Community Creativity for p5.js 1.0](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/ashleykang_gsoc2019.md) by Ashley Kang, 2019 * [Math in Motion](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/acheng_ogarcia_gsoc_2019.md) by Alexandra Cheng and Oskar Garcia, 2019 -### Processing Foundation Fellowships 2018 -* [A p5.js Dissection Manual](https://medium.com/processing-foundation/a-p5-js-dissection-manual-38959ff8522e) by Vijith Assar, 2018 -* [Chinese Translation for p5.js and preparing a future of more translations](https://medium.com/processing-foundation/chinese-translation-for-p5-js-and-preparing-a-future-of-more-translations-b56843ea096e), [p5.js 的中文翻译 — 为支持更多种语言翻译做准备](https://medium.com/processing-foundation/p5-js-%E7%9A%84%E4%B8%AD%E6%96%87%E7%BF%BB%E8%AF%91-%E4%B8%BA%E6%94%AF%E6%8C%81%E6%9B%B4%E5%A4%9A%E7%A7%8D%E8%AF%AD%E8%A8%80%E7%BF%BB%E8%AF%91%E5%81%9A%E5%87%86%E5%A4%87-a0fa94da770f) by Kenneth Lim, 2018 -* [Making p5.js Accessible](https://medium.com/processing-foundation/making-p5-js-accessible-e2ce366e05a0) by Luis Morales-Navarro and Mathura Govindarajan, 2018 -* [Introducing the 2018 Processing Foundation Fellows](https://medium.com/processing-foundation/introducing-the-2018-processing-foundation-fellows-a16ae4e87f80) - ### Google Summer of Code 2018 - * [A Platform for Algorithmic Composition on p5.js-sound](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/junshern_gsoc_2018.md) by Chan Jun Shern, 2018 * [New JavaScript console in p5.js web editor](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/liang_gsoc_2018.md) by Liang Tang, 2018 * [Updates to WebGL Mode](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/aidannelson_gsoc_2018.md) by Aidan Nelson, 2018 @@ -50,6 +44,48 @@ https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/j * [Updating hello.p5js.org](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/elginmclaren_gsoc_2018.md) by Elgin-Skye McLaren, 2018 * [Improvements to existing I/O Methods of p5.js](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/tanvi_gsoc_2018.md) by Tanvi Kumar, 2018 +### Google Summer of Code 2017 ([archive](https://summerofcode.withgoogle.com/archive/2017/organizations/5256745899261952/)) +* [Processing Foundation: GSOC Grand Wrap-Up Post](https://medium.com/processing-foundation/2017-google-summer-of-code-grand-wrap-up-post-16680b1438db) +* [Improving Developer Operations](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/sakshamsaxena_gsoc_2017.md) by Saksham Saxena, 2017 +* [Maps, Maps, Maps!](https://medium.com/processing-foundation/maps-maps-maps-f0914218c87b) by Cristobal Valenzuela, 2017 +* [Friendly Error System for p5.js](https://medium.com/processing-foundation/2017-marks-the-processing-foundations-sixth-year-participating-in-google-summer-of-code-d365f62fc463) by A. Mira Chung, 2017 +* [Processing Foundation: Our Summer of Code Has Begun!](https://medium.com/processing-foundation/our-summer-of-code-has-begun-dffc1bbddb7c) + + +## Processing Foundation Fellowships + +### Processing Foundation Fellowships 2021 +* [Three-Layer CS Cake - How to Make Sure Every Kid Gets Some Cake](https://medium.com/processing-foundation/three-layer-cs-cake-how-to-make-sure-every-kid-gets-some-cake-f7ee52e147f1) by Angi Chau, 2021 Teaching Fellow +* [Easy but Awesome: Free and Open-Source Creative Tools for Middle-School Students](https://medium.com/processing-foundation/easy-but-awesome-free-and-open-source-creative-tools-for-middle-school-students-89260eb3824d) by Shawn Patrick Higgins, 2021 Teaching Fellow +* [P5LIVE: Walking Through a Collaborative p5.js Environment for Live Coding](https://medium.com/processing-foundation/p5live-walking-through-a-collaborative-p5-js-environment-for-live-coding-bc39d95908c6) by Ted Davis, 2021 Teaching Fellow +* [Translating p5.js into Portuguese for the Brazilian Community](https://medium.com/processing-foundation/translating-p5-js-into-portuguese-for-the-brazilian-community-14b969e77ab1) by Felipe Santos Gomes, Julia Brasil, Katherine Finn Zander, and Marcela Mancinos, 2021 +* [Computational Mama on Creating Space for Womxn Creators through Coding with Friends](https://medium.com/processing-foundation/ambika-joshi-on-creating-space-for-womxn-creators-through-coding-with-friends-805c00301e39) by Computational Mama, 2021 +* [Teaching Humans and Machines to Listen to Arrernte, an Indigenous Language of Central Australia](https://medium.com/processing-foundation/teaching-humans-and-machines-to-listen-to-arrernte-an-indigenous-language-of-central-australia-90d86957132e) by Indigemoji, 2021 +* [Meet Our 2021 Fellows!](https://medium.com/processing-foundation/meet-our-2021-fellows-c22084da8019) + + +### Processing Foundation Fellowships 2020 +* [Open Computer Vision for p5.js and Processing](https://medium.com/processing-foundation/open-computer-vision-for-p5-js-and-processing-fb4490441705) by George Profenza, 2020 +* [Zoom-Teaching p5.js to Children Grades 3–6](https://medium.com/processing-foundation/zoom-teaching-p5-js-to-children-grades-3-6-54a0955c0ba5) by Michael O’Connell, 2020 +* [Visualizing the Americans with Disabilities Act Using p5.js](https://medium.com/processing-foundation/visualizing-the-americans-with-disabilities-act-using-p5-js-7853b9180b56) by Kalila Shapiro, 2020 +* [p5.js for Ages 50+ in Korea](https://medium.com/processing-foundation/p5-js-for-ages-50-in-korea-50d47b5927fb) by Inhwa Yeom & Seonghyeon Kim, 2020 +* [Chill and Cozy p5.js & Processing Tutorials on Twitch](https://medium.com/processing-foundation/chill-and-cozy-p5-js-processing-tutorials-on-twitch-c10f068d0a7f) by Aren Davey, 2020 +* [Meet Our 2020 Fellows!](https://medium.com/processing-foundation/meet-our-2020-fellows-7a51034f6845) + +### Processing Foundation Fellowships 2019 +* [Interview with Stalgia Grigg, 2019 p5.js Fellow](https://medium.com/processing-foundation/interview-with-stalgia-grigg-2019-p5-js-fellow-6fc40252e0) by Stalgia Grigg, 2019 p5.js Fellow +* [Interview with Evelyn Masso, 2019 p5.js Fellow](https://medium.com/processing-foundation/interview-with-evelyn-masso-2019-p5-js-fellow-7ac6769704df) by Evelyn Masso, 2019 p5.js Fellow +* [Coding with Sound and Art for Middle-School Students](https://medium.com/processing-foundation/interview-with-2019-teaching-fellow-layla-quinones-3039f10ae761) by Layla Quinones, 2019 Teaching Fellow +* [p5.js Tutorials for Womxn in China](https://medium.com/processing-foundation/interview-with-2019-fellow-qianqian-ye-799c0115c295) by Qianqian Ye, 2019 +* [Teaching p5.js in Hindi](https://medium.com/processing-foundation/interview-with-2019-fellows-manaswini-das-nancy-chauhan-and-shaharyar-shamshi-172127c2e277) by Manaswini Das, Nancy Chauhan, and Shaharyar Shamshi, 2019 +* [Meet Our 2019 Fellows!](https://medium.com/processing-foundation/meet-our-2019-fellows-9f13d4e4a68a) + +### Processing Foundation Fellowships 2018 +* [A p5.js Dissection Manual](https://medium.com/processing-foundation/a-p5-js-dissection-manual-38959ff8522e) by Vijith Assar, 2018 +* [Chinese Translation for p5.js and preparing a future of more translations](https://medium.com/processing-foundation/chinese-translation-for-p5-js-and-preparing-a-future-of-more-translations-b56843ea096e), [p5.js 的中文翻译 — 为支持更多种语言翻译做准备](https://medium.com/processing-foundation/p5-js-%E7%9A%84%E4%B8%AD%E6%96%87%E7%BF%BB%E8%AF%91-%E4%B8%BA%E6%94%AF%E6%8C%81%E6%9B%B4%E5%A4%9A%E7%A7%8D%E8%AF%AD%E8%A8%80%E7%BF%BB%E8%AF%91%E5%81%9A%E5%87%86%E5%A4%87-a0fa94da770f) by Kenneth Lim, 2018 +* [Making p5.js Accessible](https://medium.com/processing-foundation/making-p5-js-accessible-e2ce366e05a0) by Luis Morales-Navarro and Mathura Govindarajan, 2018 +* [Introducing the 2018 Processing Foundation Fellows](https://medium.com/processing-foundation/introducing-the-2018-processing-foundation-fellows-a16ae4e87f80) + ### Processing Foundation Fellowships 2017 * [p5 Accessibility](https://medium.com/processing-foundation/p5-accessibility-115d84535fa8) by Claire Kearney-Volpe, 2017 * [A p5.js Web Editor for All](https://medium.com/processing-foundation/a-p5-js-web-editor-for-all-64aaa3f9d767) by Cassie Tarakajian, 2017 @@ -60,10 +96,4 @@ https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/j * [Creative Coding with p5.js for Prisons in Washington State](https://medium.com/processing-foundation/creative-coding-with-p5-js-for-prisons-in-washington-state-3bd1d342d769) by Susan Evans, 2017 * [Announcing our 2017 Processing Foundation Fellows](https://medium.com/processing-foundation/announcing-our-2017-processing-foundation-fellows-8b9e7c8bd2f) -### Google Summer of Code 2017 ([archive](https://summerofcode.withgoogle.com/archive/2017/organizations/5256745899261952/)) -* [Processing Foundation: GSOC Grand Wrap-Up Post](https://medium.com/processing-foundation/2017-google-summer-of-code-grand-wrap-up-post-16680b1438db) -* [Improving Developer Operations](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/sakshamsaxena_gsoc_2017.md) by Saksham Saxena, 2017 -* [Maps, Maps, Maps!](https://medium.com/processing-foundation/maps-maps-maps-f0914218c87b) by Cristobal Valenzuela, 2017 -* [Friendly Error System for p5.js](https://medium.com/processing-foundation/2017-marks-the-processing-foundations-sixth-year-participating-in-google-summer-of-code-d365f62fc463) by A. Mira Chung, 2017 -* [Processing Foundation: Our Summer of Code Has Begun!](https://medium.com/processing-foundation/our-summer-of-code-has-begun-dffc1bbddb7c) From b81193b78d63d46160a3c455f23d5e80d83a80b6 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 27 Mar 2022 13:31:33 +0000 Subject: [PATCH 067/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8681a3bd85..75e8697af0 100644 --- a/README.md +++ b/README.md @@ -555,6 +555,7 @@ We recognize all types of contributions. This project follows the [all-contribut
rinkydevi

🌍
Coding for the Arts

🐛
Dan

🐛 +
Liz Peng

🎨 💻 🔧 From d550ab05252f4076f01815b77156fa11877e11ce Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 27 Mar 2022 13:31:34 +0000 Subject: [PATCH 068/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 26fa94c740..050680f2f5 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3012,6 +3012,17 @@ "contributions": [ "bug" ] + }, + { + "login": "liz-peng", + "name": "Liz Peng", + "avatar_url": "https://avatars.githubusercontent.com/u/8376256?v=4", + "profile": "https://github.com/liz-peng", + "contributions": [ + "design", + "code", + "tool" + ] } ], "repoType": "github", From 93f28b0802948d3953cfe789c0a5d1f1cecc1287 Mon Sep 17 00:00:00 2001 From: smilee Date: Mon, 28 Mar 2022 08:04:42 +0900 Subject: [PATCH 069/131] Fix typo --- src/image/p5.Image.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/image/p5.Image.js b/src/image/p5.Image.js index c21e758f1d..0deb230d62 100644 --- a/src/image/p5.Image.js +++ b/src/image/p5.Image.js @@ -305,7 +305,7 @@ p5.Image.prototype.loadPixels = function() { * underlying canvas * @param {Integer} y y-offset of the target update area for the * underlying canvas - * @param {Integer} w height of the target update area for the + * @param {Integer} w width of the target update area for the * underlying canvas * @param {Integer} h height of the target update area for the * underlying canvas From 3ea4bb1f032830c0465471b86651f0b8eef6e0f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 22:31:09 +0000 Subject: [PATCH 070/131] build(deps): bump minimist from 1.2.5 to 1.2.6 Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c6ce817502..28f43801e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9874,9 +9874,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "minimist-options": { From 148ac09193255cee863fdc1179d57d73dbde93f2 Mon Sep 17 00:00:00 2001 From: koolaidkrusade <95722198+koolaidkrusade@users.noreply.github.com> Date: Mon, 4 Apr 2022 16:51:56 -0400 Subject: [PATCH 071/131] Fixed typo on atan2() page changed "due the the" to "due to the" --- src/math/trigonometry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math/trigonometry.js b/src/math/trigonometry.js index e38f1d4f88..dfbbfc1cb0 100644 --- a/src/math/trigonometry.js +++ b/src/math/trigonometry.js @@ -129,7 +129,7 @@ p5.prototype.atan = function(ratio) { * to the position of the cursor. * * Note: The y-coordinate of the point is the first parameter, and the - * x-coordinate is the second parameter, due the the structure of calculating + * x-coordinate is the second parameter, due to the structure of calculating * the tangent. * * @method atan2 From 4b668951bb991dc990d63bb77275837ce3af73b1 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 5 Apr 2022 02:25:18 +0000 Subject: [PATCH 072/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 75e8697af0..70adf949aa 100644 --- a/README.md +++ b/README.md @@ -556,6 +556,7 @@ We recognize all types of contributions. This project follows the [all-contribut
Coding for the Arts

🐛
Dan

🐛
Liz Peng

🎨 💻 🔧 +
koolaidkrusade

📖 From fd4dcbd00641cf2f1697bde17577b6676ec20896 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 5 Apr 2022 02:25:18 +0000 Subject: [PATCH 073/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 050680f2f5..74090a9d9b 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3023,6 +3023,15 @@ "code", "tool" ] + }, + { + "login": "koolaidkrusade", + "name": "koolaidkrusade", + "avatar_url": "https://avatars.githubusercontent.com/u/95722198?v=4", + "profile": "https://github.com/koolaidkrusade", + "contributions": [ + "doc" + ] } ], "repoType": "github", From f13388cd2d7635bd9f2931ab697a373aa2d29cfb Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 5 Apr 2022 14:50:18 +0000 Subject: [PATCH 074/131] docs: update README.md [skip ci] --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 70adf949aa..ba0cf8e927 100644 --- a/README.md +++ b/README.md @@ -558,6 +558,9 @@ We recognize all types of contributions. This project follows the [all-contribut
Liz Peng

🎨 💻 🔧
koolaidkrusade

📖 + +
smilee

💻 + From 295f7aea0fe2352560447948d6c895d05940da78 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 5 Apr 2022 14:50:20 +0000 Subject: [PATCH 075/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 74090a9d9b..7a4c85038a 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3032,6 +3032,15 @@ "contributions": [ "doc" ] + }, + { + "login": "smilee", + "name": "smilee", + "avatar_url": "https://avatars.githubusercontent.com/u/5793796?v=4", + "profile": "https://github.com/smilee", + "contributions": [ + "code" + ] } ], "repoType": "github", From 31d7cea1de379b7a43df05dad9d5d62275678d68 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 7 Apr 2022 03:33:34 +0000 Subject: [PATCH 076/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ba0cf8e927..26ad2f9c59 100644 --- a/README.md +++ b/README.md @@ -560,6 +560,7 @@ We recognize all types of contributions. This project follows the [all-contribut
smilee

💻 +
CommanderRoot

💻 From 695f27de98189b837c97ac2fc6587766c76af321 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 7 Apr 2022 03:33:35 +0000 Subject: [PATCH 077/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 7a4c85038a..d46fb34cbb 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3041,6 +3041,15 @@ "contributions": [ "code" ] + }, + { + "login": "CommanderRoot", + "name": "CommanderRoot", + "avatar_url": "https://avatars.githubusercontent.com/u/4395417?v=4", + "profile": "https://github.com/CommanderRoot", + "contributions": [ + "code" + ] } ], "repoType": "github", From d6c85dc9e0bef2e560a6efb030cd3be3feb12449 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Apr 2022 22:43:32 +0000 Subject: [PATCH 078/131] build(deps-dev): bump simple-git from 3.3.0 to 3.5.0 Bumps [simple-git](https://github.com/steveukx/git-js/tree/HEAD/simple-git) from 3.3.0 to 3.5.0. - [Release notes](https://github.com/steveukx/git-js/releases) - [Changelog](https://github.com/steveukx/git-js/blob/main/simple-git/CHANGELOG.md) - [Commits](https://github.com/steveukx/git-js/commits/simple-git@3.5.0/simple-git) --- updated-dependencies: - dependency-name: simple-git dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c6ce817502..a37fbc89fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14091,9 +14091,9 @@ } }, "simple-git": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.3.0.tgz", - "integrity": "sha512-K9qcbbZwPHhk7MLi0k0ekvSFXJIrRoXgHhqMXAFM75qS68vdHTcuzmul1ilKI02F/4lXshVgBoDll2t++JK0PQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.5.0.tgz", + "integrity": "sha512-fZsaq5nzdxQRhMNs6ESGLpMUHoL5GRP+boWPhq9pMYMKwOGZV2jHOxi8AbFFA2Y/6u4kR99HoULizSbpzaODkA==", "dev": true, "requires": { "@kwsites/file-exists": "^1.1.1", From 595b47cec1393c1302a960462b643c0da4ca7d8b Mon Sep 17 00:00:00 2001 From: Jens B Date: Sun, 17 Apr 2022 13:29:11 +0200 Subject: [PATCH 079/131] Update p5.Element.js https://github.com/processing/p5.js/issues/5663 --- src/core/p5.Element.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/p5.Element.js b/src/core/p5.Element.js index a6cf66975d..f01ee58b8b 100644 --- a/src/core/p5.Element.js +++ b/src/core/p5.Element.js @@ -236,7 +236,7 @@ p5.Element.prototype.mousePressed = function(fxn) { this._pInst._setProperty('mouseIsPressed', true); this._pInst._setMouseButton(event); // Pass along the return-value of the callback: - return fxn.call(this); + return fxn.call(this, event); }; // Pass along the event-prepended form of the callback. p5.Element._adjustListener('mousedown', eventPrependedFxn, this); From 5494dcf0c7068712d6ebea7e06e212a296e7cc28 Mon Sep 17 00:00:00 2001 From: Ido Dana Date: Sun, 8 May 2022 17:07:35 +0300 Subject: [PATCH 080/131] Fix typo --- src/core/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/main.js b/src/core/main.js index 739566bd8f..ef9fed4e4c 100644 --- a/src/core/main.js +++ b/src/core/main.js @@ -696,7 +696,7 @@ p5.instance = null; * * Note that this will disable the parts of the FES that cause performance * slowdown (like argument checking). Friendly errors that have no performance - * cost (like giving an descriptive error if a file load fails, or warning you + * cost (like giving a descriptive error if a file load fails, or warning you * if you try to override p5.js functions in the global space), * will remain in place. * From fdf1199805894988ebbd9840c07b09ba0137df8a Mon Sep 17 00:00:00 2001 From: Ikko Ashimine Date: Sun, 15 May 2022 00:21:13 +0900 Subject: [PATCH 081/131] Fix typo in p5.RendererGL.Immediate.js arugments -> arguments --- src/webgl/p5.RendererGL.Immediate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webgl/p5.RendererGL.Immediate.js b/src/webgl/p5.RendererGL.Immediate.js index 410237643b..3c23b0c56e 100644 --- a/src/webgl/p5.RendererGL.Immediate.js +++ b/src/webgl/p5.RendererGL.Immediate.js @@ -49,7 +49,7 @@ p5.RendererGL.prototype.beginShape = function(mode) { p5.RendererGL.prototype.vertex = function(x, y) { let z, u, v; - // default to (x, y) mode: all other arugments assumed to be 0. + // default to (x, y) mode: all other arguments assumed to be 0. z = u = v = 0; if (arguments.length === 3) { From 2245901214c1a594620d7c18804a2f2bc99fc1bf Mon Sep 17 00:00:00 2001 From: Philip Bell Date: Wed, 18 May 2022 10:50:17 -0500 Subject: [PATCH 082/131] p5.image docs typo fix (#5671) * once to once * contributors * Update .all-contributorsrc --- src/image/p5.Image.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/image/p5.Image.js b/src/image/p5.Image.js index 0deb230d62..97253ec1ad 100644 --- a/src/image/p5.Image.js +++ b/src/image/p5.Image.js @@ -603,7 +603,7 @@ p5.Image.prototype.copy = function(...args) { /** * Masks part of an image from displaying by loading another * image and using its alpha channel as an alpha channel for - * this image. Masks are cumulative, one applied to an image + * this image. Masks are cumulative, once applied to an image * object, they cannot be removed. * * @method mask From 48b1213133891bc9f3cd7efe3fefef5c9cf49d0e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 18 May 2022 15:50:34 +0000 Subject: [PATCH 083/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 26ad2f9c59..a2b4ce7670 100644 --- a/README.md +++ b/README.md @@ -561,6 +561,7 @@ We recognize all types of contributions. This project follows the [all-contribut
smilee

💻
CommanderRoot

💻 +
Philip Bell

📖 From 7cc0695828a1d0c3c5e249d8062ccfd498b8d859 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 18 May 2022 15:50:35 +0000 Subject: [PATCH 084/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index d46fb34cbb..514d88aace 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3050,6 +3050,15 @@ "contributions": [ "code" ] + }, + { + "login": "processprocess", + "name": "Philip Bell", + "avatar_url": "https://avatars.githubusercontent.com/u/3860311?v=4", + "profile": "http://philipbell.org", + "contributions": [ + "doc" + ] } ], "repoType": "github", From 3d5bb2cac8bee77781862fee8d28109e9c2434b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 May 2022 23:10:51 +0000 Subject: [PATCH 085/131] build(deps-dev): bump grunt from 1.3.0 to 1.5.3 Bumps [grunt](https://github.com/gruntjs/grunt) from 1.3.0 to 1.5.3. - [Release notes](https://github.com/gruntjs/grunt/releases) - [Changelog](https://github.com/gruntjs/grunt/blob/main/CHANGELOG) - [Commits](https://github.com/gruntjs/grunt/compare/v1.3.0...v1.5.3) --- updated-dependencies: - dependency-name: grunt dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- package-lock.json | 229 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 190 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index 28f43801e4..b71a76b2f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6584,9 +6584,9 @@ "dev": true }, "getobject": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.0.tgz", - "integrity": "sha512-tbUz6AKKKr2YiMB+fLWIgq5ZeBOobop9YMMAU9dC54/ot2ksMXt3DOFyBuhZw6ptcVszEykgByK20j7W9jHFag==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.2.tgz", + "integrity": "sha512-2zblDBaFcb3rB4rF77XVnuINOE2h2k/OnqXAiy0IrTxUfV1iFp3la33oAQVY9pCpWU268WFYVt2t71hlMuLsOg==", "dev": true }, "getpass": { @@ -6732,9 +6732,9 @@ "dev": true }, "grunt": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.3.0.tgz", - "integrity": "sha512-6ILlMXv11/4cxuhSMfSU+SfvbxrPuqZrAtLN64+tZpQ3DAKfSQPQHRbTjSbdtxfyQhGZPtN0bDZJ/LdCM5WXXA==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.5.3.tgz", + "integrity": "sha512-mKwmo4X2d8/4c/BmcOETHek675uOqw0RuA/zy12jaspWqvTp4+ZeQF1W+OTpcbncnaBsfbQJ6l0l4j+Sn/GmaQ==", "dev": true, "requires": { "dateformat": "~3.0.3", @@ -6742,10 +6742,10 @@ "exit": "~0.1.2", "findup-sync": "~0.3.0", "glob": "~7.1.6", - "grunt-cli": "~1.3.2", - "grunt-known-options": "~1.1.0", + "grunt-cli": "~1.4.3", + "grunt-known-options": "~2.0.0", "grunt-legacy-log": "~3.0.0", - "grunt-legacy-util": "~2.0.0", + "grunt-legacy-util": "~2.0.1", "iconv-lite": "~0.4.13", "js-yaml": "~3.14.0", "minimatch": "~3.0.4", @@ -6754,6 +6754,37 @@ "rimraf": "~3.0.2" }, "dependencies": { + "grunt-cli": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.4.3.tgz", + "integrity": "sha512-9Dtx/AhVeB4LYzsViCjUQkd0Kw0McN2gYpdmGYKtE2a5Yt7v1Q+HYZVWhqXc/kGnxlMtqKDxSwotiGeFmkrCoQ==", + "dev": true, + "requires": { + "grunt-known-options": "~2.0.0", + "interpret": "~1.1.0", + "liftup": "~3.0.1", + "nopt": "~4.0.1", + "v8flags": "~3.2.0" + }, + "dependencies": { + "nopt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "dev": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + } + } + }, + "grunt-known-options": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz", + "integrity": "sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==", + "dev": true + }, "js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", @@ -6778,6 +6809,15 @@ "requires": { "glob": "^7.1.3" } + }, + "v8flags": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } } } }, @@ -7190,14 +7230,6 @@ "grunt-legacy-log-utils": "~2.1.0", "hooker": "~0.2.3", "lodash": "~4.17.19" - }, - "dependencies": { - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - } } }, "grunt-legacy-log-utils": { @@ -7220,9 +7252,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -7244,12 +7276,6 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -7277,15 +7303,9 @@ }, "dependencies": { "async": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", - "dev": true - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", "dev": true }, "which": { @@ -8180,6 +8200,15 @@ "ci-info": "^2.0.0" } }, + "is-core-module": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", @@ -8994,6 +9023,108 @@ } } }, + "liftup": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/liftup/-/liftup-3.0.1.tgz", + "integrity": "sha512-yRHaiQDizWSzoXk3APcA71eOI/UuhEkNN9DiW2Tt44mhYzX4joFoCZlxsSOF7RyeLlfqzFLQI1ngFq3ggMPhOw==", + "dev": true, + "requires": { + "extend": "^3.0.2", + "findup-sync": "^4.0.0", + "fined": "^1.2.0", + "flagged-respawn": "^1.0.1", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.1", + "rechoir": "^0.7.0", + "resolve": "^1.19.0" + }, + "dependencies": { + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "findup-sync": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-4.0.0.tgz", + "integrity": "sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^4.0.2", + "resolve-dir": "^1.0.1" + } + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "rechoir": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", + "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", + "dev": true, + "requires": { + "resolve": "^1.9.0" + } + }, + "resolve": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "dev": true, + "requires": { + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, "lines-and-columns": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", @@ -12865,6 +12996,12 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", @@ -14655,6 +14792,12 @@ } } }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, "symbol-observable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", @@ -15232,13 +15375,21 @@ } }, "underscore.string": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.5.tgz", - "integrity": "sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.6.tgz", + "integrity": "sha512-VoC83HWXmCrF6rgkyxS9GHv8W9Q5nhMKho+OadDJGzL2oDYbYEppBaCMH6pFlwLeqj2QS+hhkw2kpXkSdD1JxQ==", "dev": true, "requires": { - "sprintf-js": "^1.0.3", + "sprintf-js": "^1.1.1", "util-deprecate": "^1.0.2" + }, + "dependencies": { + "sprintf-js": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", + "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", + "dev": true + } } }, "unicode-canonical-property-names-ecmascript": { From e89a292c7144ee856fe364a10d5a65e892961c07 Mon Sep 17 00:00:00 2001 From: KevinGrajeda Date: Fri, 27 May 2022 18:16:36 -0500 Subject: [PATCH 086/131] add parameter validation and return to angleMode --- src/math/trigonometry.js | 13 +++++++++++-- test/unit/math/trigonometry.js | 10 ++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/math/trigonometry.js b/src/math/trigonometry.js index dfbbfc1cb0..979189d9f3 100644 --- a/src/math/trigonometry.js +++ b/src/math/trigonometry.js @@ -281,9 +281,10 @@ p5.prototype.radians = angle => angle * constants.DEG_TO_RAD; /** * Sets the current mode of p5 to the given mode. Default mode is RADIANS. * + * Calling angleMode() with no arguments returns current anglemode. * @method angleMode * @param {Constant} mode either RADIANS or DEGREES - * + * @chainable * @example *
* @@ -306,10 +307,18 @@ p5.prototype.radians = angle => angle * constants.DEG_TO_RAD; *
* */ +/** + * @method angleMode + * @return {Constant} mode either RADIANS or DEGREES + */ p5.prototype.angleMode = function(mode) { - if (mode === constants.DEGREES || mode === constants.RADIANS) { + p5._validateParameters('angleMode', arguments); + if (typeof mode === 'undefined') { + return this._angleMode; + } else if (mode === constants.DEGREES || mode === constants.RADIANS) { this._angleMode = mode; } + return this; }; /** diff --git a/test/unit/math/trigonometry.js b/test/unit/math/trigonometry.js index 437945f471..47d619fb15 100644 --- a/test/unit/math/trigonometry.js +++ b/test/unit/math/trigonometry.js @@ -60,6 +60,16 @@ suite('Trigonometry', function() { myp5.angleMode('wtflolzkk'); assert.equal(myp5._angleMode, 'radians'); }); + + test('should return radians', function() { + myp5.angleMode(RADIANS); + assert.equal(myp5.angleMode(), 'radians'); + }); + + test('should return degrees', function() { + myp5.angleMode(DEGREES); + assert.equal(myp5.angleMode(), 'degrees'); + }); }); suite('p5.prototype.degrees', function() { From 976a3e12c893dabdcf25627006b3f8b8711fab74 Mon Sep 17 00:00:00 2001 From: Yash Lamba Date: Sat, 28 May 2022 12:05:56 +0530 Subject: [PATCH 087/131] Fixed background transparency with Images Co-authored-by: TwoTicks --- src/core/p5.Renderer2D.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/p5.Renderer2D.js b/src/core/p5.Renderer2D.js index 345e7d9cbe..e9a45fc5c0 100644 --- a/src/core/p5.Renderer2D.js +++ b/src/core/p5.Renderer2D.js @@ -47,7 +47,14 @@ p5.Renderer2D.prototype.background = function(...args) { this.resetMatrix(); if (args[0] instanceof p5.Image) { - this._pInst.image(args[0], 0, 0, this.width, this.height); + if (args[1] >= 0) { + // set transparency of background + const img = args[0]; + this.drawingContext.globalAlpha = args[1] / 255; + this._pInst.image(img, 0, 0, this.width, this.height); + } else { + this._pInst.image(args[0], 0, 0, this.width, this.height); + } } else { const curFill = this._getFill(); // create background rect From aa4de60c1ac340d95063043bf7f1d1161cf6fdb3 Mon Sep 17 00:00:00 2001 From: KevinGrajeda Date: Wed, 8 Jun 2022 19:16:59 -0500 Subject: [PATCH 088/131] added new test and fixed test --- test/unit/math/trigonometry.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/test/unit/math/trigonometry.js b/test/unit/math/trigonometry.js index 47d619fb15..3445baa4c3 100644 --- a/test/unit/math/trigonometry.js +++ b/test/unit/math/trigonometry.js @@ -48,17 +48,18 @@ suite('Trigonometry', function() { suite('p5.prototype.angleMode', function() { test('should set constant to DEGREES', function() { myp5.angleMode(DEGREES); - assert.equal(myp5._angleMode, 'degrees'); + assert.equal(myp5.angleMode(), 'degrees'); }); test('should set constant to RADIANS', function() { myp5.angleMode(RADIANS); - assert.equal(myp5._angleMode, 'radians'); + assert.equal(myp5.angleMode(), 'radians'); }); - test('should always be RADIANS or DEGREES', function() { - myp5.angleMode('wtflolzkk'); - assert.equal(myp5._angleMode, 'radians'); + test('wrong param type', function() { + assert.validationError(function() { + myp5.angleMode('wtflolzkk'); + }); }); test('should return radians', function() { @@ -70,6 +71,11 @@ suite('Trigonometry', function() { myp5.angleMode(DEGREES); assert.equal(myp5.angleMode(), 'degrees'); }); + + test('should always be RADIANS or DEGREES', function() { + myp5.angleMode('wtflolzkk'); + assert.equal(myp5.angleMode(), 'radians'); + }); }); suite('p5.prototype.degrees', function() { From aa519c19d076dc292d4853e95400f74b1fea013f Mon Sep 17 00:00:00 2001 From: A M Chung Date: Fri, 10 Jun 2022 10:12:14 -0700 Subject: [PATCH 089/131] added FES survey results; addedi18n book links --- contributor_docs/friendly_error_system.md | 17 +++++++++++++---- translations/ko/README.md | 18 +++++++++++++++--- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/contributor_docs/friendly_error_system.md b/contributor_docs/friendly_error_system.md index 28652be7b9..f74cbeefda 100644 --- a/contributor_docs/friendly_error_system.md +++ b/contributor_docs/friendly_error_system.md @@ -6,15 +6,24 @@ The Friendly Error System (FES, 🌸) aims to help new programmers by providing The FES prints messages in the console window, as seen in the [p5.js Web Editor] and your browser JavaScript console. The single minified file of p5 (p5.min.js) omits the FES. - *We have an ongoing survey!* Please take a moment to fill out this 5-minute survey to help us improve the FES: [🌸 SURVEY 🌸] - [p5.js Web Editor]: https://editor.p5js.org/ -[🌸 SURVEY 🌸]: https://bit.ly/p5fesSurvey +## Lowering the Barriers to Debugging +The design of a tool should match the need of the people who will use it. As a tool that aims to lower the barriers to debugging, the design of FES is no exception. + +The best way to evaluate our existing design is to hear directly from people using p5.js. We ran a community survey in 2021 to gather feedback and future wishes for Friendly Errors. + +We believe the insights from our community members will be helpful for our contributors. You can see the results through the summary comic or the full report: +* [21-22 FES Survey Report Comic] +* [21-22 FES Survey Full Report] + + +[21-22 FES Survey Report Comic]: https://almchung.github.io/p5jsFESsurvey/ +[21-22 FES Survey Full Report]: https://observablehq.com/@almchung/p5-fes-21-survey ## Writing Friendly Error Messages -In this section, we will describe how you can contribute to the p5.js library by writing and translating error messages. +How to contribute to the p5.js library by writing and translating error messages? The FES is a part of the p5.js' [internationalization] effort. We generate all FES messages' content through [i18next]-based `translator()` function. This dynamic error message generation happens for all languages, including English - the default language of the p5.js. diff --git a/translations/ko/README.md b/translations/ko/README.md index 4603f10aa9..d23fe10d4d 100644 --- a/translations/ko/README.md +++ b/translations/ko/README.md @@ -1,15 +1,27 @@ # Welcome to the FES Korean branch! 안녕하세요, FES 한국어 브랜치에 어서오세요! -## 한국어 Translation Credits +## 한국어 공동 번역 기여자 Korean Translation Credits 2021년 가을부터 공동작업으로 진행되어 2022년 1월에 마무리된 FES 에러메시지 공동 번역 작업은 아래 분들이 함께하셨습니다. * [염인화](https://yinhwa.art/) (Inhwa Yeom): artist/XR researcher based in South Korea. (Take a look at her works on [p5 for 50+](https://p5for50.plus/) ([Processing Foundation Fellows 2020](https://medium.com/processing-foundation/p5-js-for-ages-50-in-korea-50d47b5927fb)) and p5js website Korean translation) * 전유진 (Youjin Jeon): artist/organizer based in Seoul, South Korea. [여성을 위한 열린 기술랩(Woman Open Tech Lab.kr)](http://womanopentechlab.kr/) and [Seoul Express](http://seoulexpress.kr/) * [정앎](https://www.almichu.com/) (Alm Chung, organizer): Korean-American artist/researcher based in Seattle, WA. * 이지현 (Jihyun Lee): Korean publishing editor based in South Korea -## 한국어 Translation Resources -* 추후 추가될 예정입니다! +## 영한 번역 리소스 (Korean-English Translation Resources) +* 영한 [번역에 도움이 되는 툴과 유의점들]입니다. +* 또한 영한 [번역 작업 중 마주치는 딜레마들]속에서 저희가 채택한 방식을 모아 적어봤습니다. +* 외래 [기술 용어 다루기]에 대한 논의입니다. +* p5js.org/ko 기술 색인 입니다. +* 현존하는 검색툴/번역툴들과 연계가능한 "[사이를 맴도는]" 번역문에 대해 생각해보는 글입니다. +이 외에도 FES의 세계화 작업 과정, 그리고 과정 중 논의된 이슈들을 [Friendly Errors i18n Book ✎ 친절한 오류 메시지 세계화 가이드북]에서 읽어보실수 있습니다. + + +[번역에 도움이 되는 툴과 유의점들]: https://almchung.github.io/p5-fes-i18n-book/ch4/#tools +[번역 작업 중 마주치는 딜레마들]: https://almchung.github.io/p5-fes-i18n-book/ch4/#dilemmas +[기술 용어 다루기]: https://almchung.github.io/p5-fes-i18n-book/ch3/ +[사이를 맴도는]: https://almchung.github.io/p5-fes-i18n-book/ch5/ +[Friendly Errors i18n Book ✎ 친절한 오류 메시지 세계화 가이드북]:https://almchung.github.io/p5-fes-i18n-book/ 질문이나 건의 사항은 @almchung 에게 문의주시길 바랍니다. \ No newline at end of file From ee29d396694b81d85e52307cac2fab30d9488000 Mon Sep 17 00:00:00 2001 From: A M Chung Date: Tue, 14 Jun 2022 10:40:57 -0700 Subject: [PATCH 090/131] fes i18n book & writing best practices info updated --- contributor_docs/friendly_error_system.md | 17 ++++++++++------- translations/ko/README.md | 13 ++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/contributor_docs/friendly_error_system.md b/contributor_docs/friendly_error_system.md index f74cbeefda..7cc3ecb2ed 100644 --- a/contributor_docs/friendly_error_system.md +++ b/contributor_docs/friendly_error_system.md @@ -35,21 +35,24 @@ We welcome contributions from all around the world! 🌐 #### Writing Best Practices -FES message writers should prioritize lowering the barrier of understanding error messages and debugging. +FES message writers should prioritize lowering the barrier of understanding error messages and increasing the accessibility of debugging process. -Here are some highlights from our upcoming best-practice doc: +[Friendly Errors i18n Book] discusses challenges and best practices for writing friendly error messages within the cross-cultural i18n context. Here are some points from the book: -* Use simple sentences. Consider breaking your sentence into smaller blocks for best utilizing i18next's [interpolation] feature. -* Keep the language friendly and inclusive. Look for possible bias and harm in your language. Adhere to [p5.js Code of Conduct]. -* Avoid using figures of speech. Prioritize cross-cultural communication. -* Try to spot possible "[expert blind spots]" in an error message and its related docs. -* Introduce one technical concept or term at a time—link one external resource written in a beginner-friendly language with plenty of short, practical examples. +* Understand your audience: do not make assumptions about the audience of our error messages. Try to learn who is using our library and how they use it. +* Keep language inclusive. We strive to make error messages "friendly," what does it mean for you? Look for possible bias and harm in your language. Adhere to [p5.js Code of Conduct]. +* Use simple sentences whenever possible. Consider breaking your sentence into smaller blocks for best utilizing i18next's [interpolation] feature. +* Prioritize cross-cultural communication and provide a great experience across languages. Avoid using figures of speech. +* Introduce one technical concept or technical term at a time. Keep consistency in technical writing. Try to link one external resource written in a beginner-friendly language with plenty of short, practical examples. +[Friendly Errors i18n Book]: https://almchung.github.io/p5-fes-i18n-book/ [interpolation]: https://www.i18next.com/translation-function/interpolation [p5.js Code of Conduct]: https://github.com/processing/p5.js/blob/main/CODE_OF_CONDUCT.md#p5js-code-of-conduct [expert blind spots]: https://tilt.colostate.edu/TipsAndGuides/Tip/181 +[Friendly Errors i18n Book] is a public project, and you can contribute to the book through this separate [repo]. +[repo]: https://github.com/almchung/p5-fes-i18n-book #### Location of Translation Files `translator()` is based on i18next and imported from `src/core/internationalization.js`. It generates messages by looking up text data from a JSON translation file: diff --git a/translations/ko/README.md b/translations/ko/README.md index d23fe10d4d..c15844116f 100644 --- a/translations/ko/README.md +++ b/translations/ko/README.md @@ -10,18 +10,17 @@ ## 영한 번역 리소스 (Korean-English Translation Resources) * 영한 [번역에 도움이 되는 툴과 유의점들]입니다. -* 또한 영한 [번역 작업 중 마주치는 딜레마들]속에서 저희가 채택한 방식을 모아 적어봤습니다. +* 또한 영한 [번역 작업 중 마주치는 딜레마들] 속에서 저희가 채택한 방식을 모아 적어봤습니다. * 외래 [기술 용어 다루기]에 대한 논의입니다. -* p5js.org/ko 기술 색인 입니다. -* 현존하는 검색툴/번역툴들과 연계가능한 "[사이를 맴도는]" 번역문에 대해 생각해보는 글입니다. +* p5js 웹사이트와 기술 문서에서 사용하는 기술 용어들을 통일하기위해 사용하고 있 [p5js.org/ko 기술 용어 색인] 입니다. +* 현존하는 검색툴/번역 툴들과 연계 가능한 "[사이를 맴도는]" 번역문에 대해 생각해보는 글입니다. -이 외에도 FES의 세계화 작업 과정, 그리고 과정 중 논의된 이슈들을 [Friendly Errors i18n Book ✎ 친절한 오류 메시지 세계화 가이드북]에서 읽어보실수 있습니다. +이 외에도 FES의 세계화 작업 과정, 그리고 과정 중 논의된 이슈들을 [Friendly Errors i18n Book ✎ 친절한 오류 메시지 세계화 가이드북]에서 읽어보실 수 있습니다. "친절한 오류 메시지 세계화 가이드북"은 오픈 소스 프로젝트이며, 이 [독립된 레파지토리 (repository)]를 통해 기여 가능합니다. [번역에 도움이 되는 툴과 유의점들]: https://almchung.github.io/p5-fes-i18n-book/ch4/#tools [번역 작업 중 마주치는 딜레마들]: https://almchung.github.io/p5-fes-i18n-book/ch4/#dilemmas [기술 용어 다루기]: https://almchung.github.io/p5-fes-i18n-book/ch3/ [사이를 맴도는]: https://almchung.github.io/p5-fes-i18n-book/ch5/ -[Friendly Errors i18n Book ✎ 친절한 오류 메시지 세계화 가이드북]:https://almchung.github.io/p5-fes-i18n-book/ - -질문이나 건의 사항은 @almchung 에게 문의주시길 바랍니다. \ No newline at end of file +[Friendly Errors i18n Book ✎ 친절한 오류 메시지 세계화 가이드북]: https://almchung.github.io/p5-fes-i18n-book/ +[독립된 레파지토리 (repository)]: https://github.com/almchung/p5-fes-i18n-book \ No newline at end of file From 21f5e3db573cad9ef4a00821a5468b31549656a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Enrique=20Rasc=C3=B3n?= Date: Sun, 19 Jun 2022 11:43:05 +0200 Subject: [PATCH 091/131] update documentation --- src/image/image.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/image/image.js b/src/image/image.js index 8260776c13..c38a645c8f 100644 --- a/src/image/image.js +++ b/src/image/image.js @@ -420,15 +420,20 @@ p5.prototype.saveGif = function(pImg, filename) { * as an argument to the callback function as an array of objects, with the * size of array equal to the total number of frames. * - * Note that saveFrames() will only save the first 15 frames of an animation. + * Note that saveFrames() will only save the first 15 seconds of an animation. + * The arguments `duration` and `framerate` are constrained to be less or equal 15 and 22, respectively, which means you + * can only download a maximum of 15 seconds worth of frames at 22 frames per second, adding up to 330 frames. + * This is done in order to avoid memory problems since a large enough canvas can fill up the memory in your computer + * very easily and crash your program or even your browser. + * * To export longer animations, you might look into a library like * ccapture.js. * * @method saveFrames * @param {String} filename * @param {String} extension 'jpg' or 'png' - * @param {Number} duration Duration in seconds to save the frames for. - * @param {Number} framerate Framerate to save the frames in. + * @param {Number} duration Duration in seconds to save the frames for. This parameter will be constrained to be less or equal to 15. + * @param {Number} framerate Framerate to save the frames in. This parameter will be constrained to be less or equal to 22. * @param {function(Array)} [callback] A callback function that will be executed to handle the image data. This function should accept an array as argument. The From a0a151a6b51a0bdd7ddd4599659a602b24e8e9c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Enrique=20Rasc=C3=B3n?= Date: Sun, 19 Jun 2022 11:43:30 +0200 Subject: [PATCH 092/131] fix linter error --- src/image/image.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/image/image.js b/src/image/image.js index c38a645c8f..0b329f01cb 100644 --- a/src/image/image.js +++ b/src/image/image.js @@ -69,7 +69,7 @@ import omggif from 'omggif'; * let img = createImage(66, 66); * img.loadPixels(); * let d = pixelDensity(); - * let halfImage = 4 * (img.width * d) * (img.height / 2 * d); + * let halfImage = 4 * (img.width * d) * ((img.height / 2) * d); * for (let i = 0; i < halfImage; i += 4) { * img.pixels[i] = red(pink); * img.pixels[i + 1] = green(pink); From 8081481ddbd26f5967293ee9d1244da0b587deba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 01:18:02 +0000 Subject: [PATCH 093/131] build(deps): bump shell-quote from 1.7.2 to 1.7.3 Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.7.2 to 1.7.3. - [Release notes](https://github.com/substack/node-shell-quote/releases) - [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md) - [Commits](https://github.com/substack/node-shell-quote/compare/v1.7.2...1.7.3) --- updated-dependencies: - dependency-name: shell-quote dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fbf0059a65..ffff484561 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14105,9 +14105,9 @@ "dev": true }, "shell-quote": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz", - "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz", + "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==", "dev": true }, "signal-exit": { From 16904a8c3f121461478e71bb540914d17c8a8d6d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 14:10:07 +0000 Subject: [PATCH 094/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a2b4ce7670..e0c6489ed1 100644 --- a/README.md +++ b/README.md @@ -562,6 +562,7 @@ We recognize all types of contributions. This project follows the [all-contribut
smilee

💻
CommanderRoot

💻
Philip Bell

📖 +
tapioca24

🔌 From a72eec29803db7f10fbbfad667f2dd347ddca462 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 14:10:08 +0000 Subject: [PATCH 095/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 514d88aace..9456faf3b9 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3059,6 +3059,15 @@ "contributions": [ "doc" ] + }, + { + "login": "tapioca24", + "name": "tapioca24", + "avatar_url": "https://avatars.githubusercontent.com/u/12683107?v=4", + "profile": "https://github.com/tapioca24", + "contributions": [ + "plugin" + ] } ], "repoType": "github", From 1a9ae6b874e43023183cc8539046055cc062b64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Enrique=20Rasc=C3=B3n?= Date: Fri, 1 Jul 2022 19:07:11 +0200 Subject: [PATCH 096/131] fix linter error --- src/image/image.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/image/image.js b/src/image/image.js index 0b329f01cb..c38a645c8f 100644 --- a/src/image/image.js +++ b/src/image/image.js @@ -69,7 +69,7 @@ import omggif from 'omggif'; * let img = createImage(66, 66); * img.loadPixels(); * let d = pixelDensity(); - * let halfImage = 4 * (img.width * d) * ((img.height / 2) * d); + * let halfImage = 4 * (img.width * d) * (img.height / 2 * d); * for (let i = 0; i < halfImage; i += 4) { * img.pixels[i] = red(pink); * img.pixels[i + 1] = green(pink); From 980811887a4b8bc0536f795d6966a1d37854e755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Enrique=20Rasc=C3=B3n?= Date: Fri, 1 Jul 2022 22:41:11 +0200 Subject: [PATCH 097/131] remove redundant information and fix typo --- src/image/image.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/image/image.js b/src/image/image.js index c38a645c8f..8ac3a24bba 100644 --- a/src/image/image.js +++ b/src/image/image.js @@ -420,8 +420,7 @@ p5.prototype.saveGif = function(pImg, filename) { * as an argument to the callback function as an array of objects, with the * size of array equal to the total number of frames. * - * Note that saveFrames() will only save the first 15 seconds of an animation. - * The arguments `duration` and `framerate` are constrained to be less or equal 15 and 22, respectively, which means you + * The arguments `duration` and `framerate` are constrained to be less or equal to 15 and 22, respectively, which means you * can only download a maximum of 15 seconds worth of frames at 22 frames per second, adding up to 330 frames. * This is done in order to avoid memory problems since a large enough canvas can fill up the memory in your computer * very easily and crash your program or even your browser. From d86e4ac062b59a04ccf4b1d6575f2e7d8432b9a0 Mon Sep 17 00:00:00 2001 From: Austin Slominski Date: Fri, 1 Jul 2022 16:07:10 -0600 Subject: [PATCH 098/131] added describe() to all 3d reference examples, resolving issue #5705 --- src/webgl/3d_primitives.js | 54 ++++++++++++++++++++++++++++++++++++++ src/webgl/interaction.js | 20 ++++++++++++++ src/webgl/light.js | 22 ++++++++++++++++ src/webgl/loading.js | 6 +++++ src/webgl/material.js | 35 ++++++++++++++++++++++++ src/webgl/p5.Camera.js | 42 +++++++++++++++++++++++++++++ src/webgl/p5.Shader.js | 4 +++ 7 files changed, 183 insertions(+) diff --git a/src/webgl/3d_primitives.js b/src/webgl/3d_primitives.js index 090a89479e..779af9491c 100644 --- a/src/webgl/3d_primitives.js +++ b/src/webgl/3d_primitives.js @@ -33,6 +33,8 @@ import * as constants from '../core/constants'; * background(200); * plane(50, 50); * } + * + * describe('a white plane with black wireframe lines'); *
*
* @@ -120,6 +122,8 @@ p5.prototype.plane = function(width, height, detailX, detailY) { * rotateY(frameCount * 0.01); * box(50); * } + * + * describe('a white box rotating in 3D space'); * *
*/ @@ -237,6 +241,8 @@ p5.prototype.box = function(width, height, depth, detailX, detailY) { * background(205, 102, 94); * sphere(40); * } + * + * describe('a white sphere with black wireframe lines'); * *
* @@ -257,6 +263,10 @@ p5.prototype.box = function(width, height, depth, detailX, detailY) { * rotateY(millis() / 1000); * sphere(40, detailX.value(), 16); * } + * + * describe( + * 'a white sphere with low detail on the x-axis, including a slider to adjust detailX' + * ); * * * @@ -277,6 +287,10 @@ p5.prototype.box = function(width, height, depth, detailX, detailY) { * rotateY(millis() / 1000); * sphere(40, 16, detailY.value()); * } + * + * describe( + * 'a white sphere with low detail on the y-axis, including a slider to adjust detailY' + * ); * * */ @@ -449,6 +463,8 @@ const _truncatedCone = function( * rotateZ(frameCount * 0.01); * cylinder(20, 50); * } + * + * describe('a rotating white cylinder'); * * * @@ -469,6 +485,10 @@ const _truncatedCone = function( * rotateY(millis() / 1000); * cylinder(20, 75, detailX.value(), 1); * } + * + * describe( + * 'a rotating white cylinder with limited X detail, with a slider that adjusts detailX' + * ); * * * @@ -489,6 +509,10 @@ const _truncatedCone = function( * rotateY(millis() / 1000); * cylinder(20, 75, 16, detailY.value()); * } + * + * describe( + * 'a rotating white cylinder with limited Y detail, with a slider that adjusts detailY' + * ); * * */ @@ -584,6 +608,8 @@ p5.prototype.cylinder = function( * rotateZ(frameCount * 0.01); * cone(40, 70); * } + * + * describe('a rotating white cone'); * * * @@ -604,6 +630,10 @@ p5.prototype.cylinder = function( * rotateY(millis() / 1000); * cone(30, 65, detailX.value(), 16); * } + * + * describe( + * 'a rotating white cone with limited X detail, with a slider that adjusts detailX' + * ); * * * @@ -624,6 +654,10 @@ p5.prototype.cylinder = function( * rotateY(millis() / 1000); * cone(30, 65, 16, detailY.value()); * } + * + * describe( + * 'a rotating white cone with limited Y detail, with a slider that adjusts detailY' + * ); * * */ @@ -698,6 +732,8 @@ p5.prototype.cone = function(radius, height, detailX, detailY, cap) { * background(205, 105, 94); * ellipsoid(30, 40, 40); * } + * + * describe('a white 3d ellipsoid'); * * * @@ -718,6 +754,10 @@ p5.prototype.cone = function(radius, height, detailX, detailY, cap) { * rotateY(millis() / 1000); * ellipsoid(30, 40, 40, detailX.value(), 8); * } + * + * describe( + * 'a rotating white ellipsoid with limited X detail, with a slider that adjusts detailX' + * ); * * * @@ -738,6 +778,10 @@ p5.prototype.cone = function(radius, height, detailX, detailY, cap) { * rotateY(millis() / 1000); * ellipsoid(30, 40, 40, 12, detailY.value()); * } + * + * describe( + * 'a rotating white ellipsoid with limited Y detail, with a slider that adjusts detailY' + * ); * * */ @@ -834,6 +878,8 @@ p5.prototype.ellipsoid = function(radiusX, radiusY, radiusZ, detailX, detailY) { * rotateY(frameCount * 0.01); * torus(30, 15); * } + * + * describe('a rotating white torus'); * * * @@ -854,6 +900,10 @@ p5.prototype.ellipsoid = function(radiusX, radiusY, radiusZ, detailX, detailY) { * rotateY(millis() / 1000); * torus(30, 15, detailX.value(), 12); * } + * + * describe( + * 'a rotating white torus with limited X detail, with a slider that adjusts detailX' + * ); * * * @@ -874,6 +924,10 @@ p5.prototype.ellipsoid = function(radiusX, radiusY, radiusZ, detailX, detailY) { * rotateY(millis() / 1000); * torus(30, 15, 16, detailY.value()); * } + * + * describe( + * 'a rotating white torus with limited Y detail, with a slider that adjusts detailY' + * ); * * */ diff --git a/src/webgl/interaction.js b/src/webgl/interaction.js index 87680921df..26d8a32493 100644 --- a/src/webgl/interaction.js +++ b/src/webgl/interaction.js @@ -37,6 +37,7 @@ import * as constants from '../core/constants'; * rotateY(0.5); * box(30, 50); * } + * describe('Camera orbits around a box when mouse is hold-clicked & then moved.'); * * * @@ -178,6 +179,9 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * noDebugMode(); * } * } + * describe( + * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z. the grid and icon disappear when the spacebar is pressed.' + * ); * * * @alt @@ -201,6 +205,8 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * orbitControl(); * box(15, 30); * } + * + * describe('a 3D box is centered on a grid in a 3D sketch.'); * * * @alt @@ -221,6 +227,10 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * orbitControl(); * box(15, 30); * } + * + * describe( + * 'a 3D box is centered in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z.' + * ); * * * @alt @@ -243,6 +253,8 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * orbitControl(); * box(15, 30); * } + * + * describe('a 3D box is centered on a grid in a 3D sketch'); * * * @alt @@ -267,6 +279,10 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * stroke(255, 0, 150); * strokeWeight(0.8); * } + * + * describe( + * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z.' + * ); * * * @alt @@ -372,6 +388,10 @@ p5.prototype.debugMode = function(...args) { * noDebugMode(); * } * } + * + * describe( + * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z. the grid and icon disappear when the spacebar is pressed.' + * ); * * * @alt diff --git a/src/webgl/light.js b/src/webgl/light.js index 559f3a468e..010df053e5 100644 --- a/src/webgl/light.js +++ b/src/webgl/light.js @@ -44,6 +44,7 @@ import * as constants from '../core/constants'; * ambientMaterial(255, 127, 80); // coral material * sphere(40); * } + * describe('sphere with coral color under black light'); * * * @alt @@ -62,6 +63,7 @@ import * as constants from '../core/constants'; * ambientMaterial(255, 127, 80); // coral material * sphere(40); * } + * describe('sphere with coral color under white light'); * * * @alt @@ -172,6 +174,10 @@ p5.prototype.ambientLight = function(v1, v2, v3, a) { * function mouseClicked() { * setRedSpecularColor = !setRedSpecularColor; * } + * + * describe( + * 'Sphere with specular highlight. Clicking the mouse toggles the specular highlight color between red and the default white.' + * ); * * * @@ -266,6 +272,9 @@ p5.prototype.specularColor = function(v1, v2, v3) { * noStroke(); * sphere(40); * } + * describe( + * 'scene with sphere and directional light. The direction of the light is controlled with the mouse position.' + * ); * * * @@ -391,6 +400,9 @@ p5.prototype.directionalLight = function(v1, v2, v3, x, y, z) { * noStroke(); * sphere(40); * } + * describe( + * 'scene with sphere and point light. The position of the light is controlled with the mouse position.' + * ); * * * @@ -490,6 +502,7 @@ p5.prototype.pointLight = function(v1, v2, v3, x, y, z) { * rotateZ(millis() / 1000); * box(); * } + * describe('the light is partially ambient and partially directional'); * * * @@ -557,6 +570,9 @@ p5.prototype.lights = function() { * sphere(20); * pop(); * } + * describe( + * 'Two spheres with different falloff values show different intensity of light' + * ); * * * @@ -672,6 +688,9 @@ p5.prototype.lightFalloff = function( * noStroke(); * sphere(40); * } + * describe( + * 'scene with sphere and spot light. The position of the light is controlled with the mouse position.' + * ); * * * @@ -1005,6 +1024,9 @@ p5.prototype.spotLight = function( * ambientMaterial(255); * sphere(13); * } + * describe( + * 'Three white spheres. Each appears as a different color due to lighting.' + * ); * * * diff --git a/src/webgl/loading.js b/src/webgl/loading.js index 78e19145c2..39ed1d9b0e 100755 --- a/src/webgl/loading.js +++ b/src/webgl/loading.js @@ -58,6 +58,8 @@ import './p5.Geometry'; * rotateY(frameCount * 0.01); * model(octahedron); * } + * + * describe('Vertically rotating 3-d octahedron.'); * * * @@ -87,6 +89,8 @@ import './p5.Geometry'; * normalMaterial(); // For effect * model(teapot); * } + * + * describe('Vertically rotating 3-d teapot with red, green and blue gradient.'); * * * @@ -610,6 +614,8 @@ function parseASCIISTL(model, lines) { * rotateY(frameCount * 0.01); * model(octahedron); * } + * + * describe('Vertically rotating 3-d octahedron.'); * * * diff --git a/src/webgl/material.js b/src/webgl/material.js index 075d081674..89078ea821 100644 --- a/src/webgl/material.js +++ b/src/webgl/material.js @@ -51,6 +51,8 @@ import './p5.Texture'; * mandel.setUniform('r', 1.5 * exp(-6.5 * (1 + sin(millis() / 2000)))); * quad(-1, -1, 1, -1, 1, 1, -1, 1); * } + * + * describe('zooming Mandelbrot set. a colorful, infinitely detailed fractal.'); * * * @@ -169,6 +171,8 @@ p5.prototype.loadShader = function( * mandel.setUniform('r', 1.5 * exp(-6.5 * (1 + sin(millis() / 2000)))); * quad(-1, -1, 1, -1, 1, 1, -1, 1); * } + * + * describe('zooming Mandelbrot set. a colorful, infinitely detailed fractal.'); * * * @@ -253,6 +257,10 @@ p5.prototype.createShader = function(vertSrc, fragSrc) { * function mouseClicked() { * showRedGreen = !showRedGreen; * } + * + * describe( + * 'canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed.' + * ); * * * @@ -354,6 +362,10 @@ p5.prototype.shader = function(s) { * box(width / 4); * pop(); * } + * + * describe( + * 'Two rotating cubes. The left one is painted using a custom (user-defined) shader, while the right one is painted using the default fill shader.' + * ); * * * @alt @@ -403,6 +415,8 @@ p5.prototype.resetShader = function() { * texture(img); * box(width / 2); * } + * + * describe('spinning cube with a texture from an image'); * * * @alt @@ -429,6 +443,8 @@ p5.prototype.resetShader = function() { * noStroke(); * plane(50); * } + * + * describe('plane with a texture from an image created by createGraphics()'); * * * @alt @@ -456,6 +472,8 @@ p5.prototype.resetShader = function() { * function mousePressed() { * vid.loop(); * } + * + * describe('rectangle with video as texture'); * * * @@ -486,6 +504,8 @@ p5.prototype.resetShader = function() { * vertex(-40, 40, 0, 1); * endShape(); * } + * + * describe('quad with a texture, mapped using normalized coordinates'); * * * @alt @@ -541,6 +561,8 @@ p5.prototype.texture = function(tex) { * vertex(-50, 50, 0, 1); * endShape(); * } + * + * describe('quad with a texture, mapped using normalized coordinates'); * * * @alt @@ -569,6 +591,8 @@ p5.prototype.texture = function(tex) { * vertex(-50, 50, 0, img.height); * endShape(); * } + * + * describe('quad with a texture, mapped using image coordinates'); * * * @alt @@ -640,6 +664,8 @@ p5.prototype.textureMode = function(mode) { * vertex(-1, -1, 0, 0, 0); * endShape(); * } + * + * describe('an image of the rocky mountains repeated in mirrored tiles'); * * * @@ -682,6 +708,8 @@ p5.prototype.textureWrap = function(wrapX, wrapY = wrapX) { * normalMaterial(); * sphere(40); * } + * + * describe('Sphere with normal material'); * * * @alt @@ -739,6 +767,7 @@ p5.prototype.normalMaterial = function(...args) { * ambientMaterial(70, 130, 230); * sphere(40); * } + * describe('sphere reflecting red, blue, and green light'); * * * @alt @@ -758,6 +787,7 @@ p5.prototype.normalMaterial = function(...args) { * ambientMaterial(255); // white material * box(30); * } + * describe('box reflecting only red and blue light'); * * * @alt @@ -777,6 +807,7 @@ p5.prototype.normalMaterial = function(...args) { * ambientMaterial(255, 0, 255); // magenta material * box(30); * } + * describe('box reflecting no light'); * * * @alt @@ -849,6 +880,7 @@ p5.prototype.ambientMaterial = function(v1, v2, v3) { * emissiveMaterial(130, 230, 0); * sphere(40); * } + * describe('sphere with green emissive material'); * * * @@ -932,6 +964,8 @@ p5.prototype.emissiveMaterial = function(v1, v2, v3, a) { * shininess(50); * torus(30, 10, 64, 64); * } + * + * describe('torus with specular material'); * * * @alt @@ -1002,6 +1036,7 @@ p5.prototype.specularMaterial = function(v1, v2, v3, alpha) { * shininess(20); * sphere(20); * } + * describe('two spheres, one more shiny than the other'); * * * @alt diff --git a/src/webgl/p5.Camera.js b/src/webgl/p5.Camera.js index f09dee3923..03c3b0e91b 100644 --- a/src/webgl/p5.Camera.js +++ b/src/webgl/p5.Camera.js @@ -52,6 +52,7 @@ import p5 from '../core/main'; * camera(0, 0, 20 + sin(frameCount * 0.01) * 10, 0, 0, 0, 0, 1, 0); * plane(10, 10); * } + * describe('a square moving closer and then away from the camera.'); * * * @@ -98,6 +99,10 @@ import p5 from '../core/main'; * fill(255, 102, 94); * box(85); * } + * + * describe( + * 'White square repeatedly grows to fill canvas and then shrinks. An interactive example of a red cube with 3 sliders for moving it across x, y, z axis and 3 sliders for shifting its center.' + * ); * * * @alt @@ -160,6 +165,9 @@ p5.prototype.camera = function(...args) { * box(30); * pop(); * } + * describe( + * 'two colored 3D boxes move back and forth, rotating as mouse is dragged.' + * ); * * * @@ -220,6 +228,9 @@ p5.prototype.perspective = function(...args) { * box(30); * pop(); * } + * describe( + * 'two 3D boxes move back and forth along same plane, rotating as mouse is dragged.' + * ); * * * @@ -283,6 +294,9 @@ p5.prototype.ortho = function(...args) { * box(30); * pop(); * } + * describe( + * 'two 3D boxes move back and forth along same plane, rotating as mouse is dragged.' + * ); * * * @@ -335,6 +349,8 @@ p5.prototype.frustum = function(...args) { * camera.setPosition(sin(frameCount / 60) * 200, 0, 100); * box(20); * } + * + * describe('An example that creates a camera and moves it around the box.'); * * * @alt @@ -427,6 +443,10 @@ p5.prototype.createCamera = function() { * translate(35, 0, 0); * box(20); * } + * + * describe( + * 'camera view pans left and right across a series of rotating 3D boxes.' + * ); * * * @@ -462,6 +482,8 @@ p5.Camera = function(renderer) { * box(10); * div.html('eyeX = ' + cam.eyeX); * } + * + * describe('An example showing the use of camera object properties'); * * * @alt @@ -489,6 +511,8 @@ p5.Camera = function(renderer) { * box(10); * div.html('eyeY = ' + cam.eyeY); * } + * + * describe('An example showing the use of camera object properties'); * * * @alt @@ -516,6 +540,8 @@ p5.Camera = function(renderer) { * box(10); * div.html('eyeZ = ' + cam.eyeZ); * } + * + * describe('An example showing the use of camera object properties'); * * * @alt @@ -544,6 +570,8 @@ p5.Camera = function(renderer) { * orbitControl(); * box(10); * } + * + * describe('An example showing the use of camera object properties'); * * * @alt @@ -572,6 +600,8 @@ p5.Camera = function(renderer) { * orbitControl(); * box(10); * } + * + * describe('An example showing the use of camera object properties'); * * * @alt @@ -600,6 +630,8 @@ p5.Camera = function(renderer) { * orbitControl(); * box(10); * } + * + * describe('An example showing the use of camera object properties'); * * * @alt @@ -623,6 +655,8 @@ p5.Camera = function(renderer) { * div.style('color', 'blue'); * div.style('font-size', '18px'); * } + * + * describe('An example showing the use of camera object properties'); * * * @alt @@ -646,6 +680,8 @@ p5.Camera = function(renderer) { * div.style('color', 'blue'); * div.style('font-size', '18px'); * } + * + * describe('An example showing the use of camera object properties'); * * * @alt @@ -669,6 +705,8 @@ p5.Camera = function(renderer) { * div.style('color', 'blue'); * div.style('font-size', '18px'); * } + * + * describe('An example showing the use of camera object properties'); * * * @alt @@ -1784,6 +1822,10 @@ p5.Camera.prototype._isActive = function() { * translate(35, 0, 0); * box(20); * } + * + * describe( + * 'Canvas switches between two camera views, each showing a series of spinning 3D boxes.' + * ); * * * diff --git a/src/webgl/p5.Shader.js b/src/webgl/p5.Shader.js index 740e95978e..a4014b31af 100644 --- a/src/webgl/p5.Shader.js +++ b/src/webgl/p5.Shader.js @@ -363,6 +363,10 @@ p5.Shader.prototype.useProgram = function() { * function mouseClicked() { * showRedGreen = !showRedGreen; * } + * + * describe( + * 'canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed.' + * ); * * * From dd194ad190b6061ba667cd66db8a7aac177dfc3f Mon Sep 17 00:00:00 2001 From: evelyn masso Date: Fri, 1 Jul 2022 16:11:32 -0700 Subject: [PATCH 099/131] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e0c6489ed1..16f75510d5 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,8 @@ Stewards are contributors that are particularly involved, familiar, or responsiv Anyone interested can volunteer to be a steward! There are no specific requirements for expertise, just an interest in actively learning and participating. If you’re familiar with one or more parts of this project, open an issue to volunteer as a steward! -* [@outofambit](https://github.com/outofambit) - project co-lead * [@qianqianye](https://github.com/qianqianye) - project co-lead +* [@outofambit](https://github.com/outofambit) * [@lmccart](https://github.com/lmccart) * [@limzykenneth](https://github.com/limzykenneth) * [@stalgiag](https://github.com/stalgiag) From e005d801993e04f7cf7cbf37046bfb11c7daae38 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 3 Jul 2022 04:52:27 +0000 Subject: [PATCH 100/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e0c6489ed1..ae83abd20d 100644 --- a/README.md +++ b/README.md @@ -563,6 +563,7 @@ We recognize all types of contributions. This project follows the [all-contribut
CommanderRoot

💻
Philip Bell

📖
tapioca24

🔌 +
Qianqian Ye

💻 🎨 📖 📋 👀 🌍 From a474626c219de6f93dafc148e47a6b3ef08b4270 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 3 Jul 2022 04:52:28 +0000 Subject: [PATCH 101/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 9456faf3b9..7efcd834f1 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3068,6 +3068,20 @@ "contributions": [ "plugin" ] + }, + { + "login": "Qianqianye", + "name": "Qianqian Ye", + "avatar_url": "https://avatars.githubusercontent.com/u/18587130?v=4", + "profile": "http://qianqian-ye.com", + "contributions": [ + "code", + "design", + "doc", + "eventOrganizing", + "review", + "translation" + ] } ], "repoType": "github", From cce628bf417edfe6bc425fac34cef1a581bb13cb Mon Sep 17 00:00:00 2001 From: Austin Slominski Date: Tue, 5 Jul 2022 11:31:13 -0600 Subject: [PATCH 102/131] moved describe() into setup(), fixing failed tests --- src/webgl/3d_primitives.js | 91 ++++++++++++++++---------------------- src/webgl/interaction.js | 37 +++++++--------- src/webgl/light.js | 43 +++++++++--------- src/webgl/loading.js | 9 ++-- src/webgl/material.js | 59 ++++++++++-------------- src/webgl/p5.Camera.js | 72 +++++++++++++----------------- src/webgl/p5.Shader.js | 8 ++-- 7 files changed, 136 insertions(+), 183 deletions(-) diff --git a/src/webgl/3d_primitives.js b/src/webgl/3d_primitives.js index 779af9491c..ef6a973cb0 100644 --- a/src/webgl/3d_primitives.js +++ b/src/webgl/3d_primitives.js @@ -27,14 +27,13 @@ import * as constants from '../core/constants'; * // with width 50 and height 50 * function setup() { * createCanvas(100, 100, WEBGL); + * describe('a white plane with black wireframe lines'); * } * * function draw() { * background(200); * plane(50, 50); * } - * - * describe('a white plane with black wireframe lines'); * * * @@ -114,6 +113,7 @@ p5.prototype.plane = function(width, height, detailX, detailY) { * // with width, height and depth of 50 * function setup() { * createCanvas(100, 100, WEBGL); + * describe('a white box rotating in 3D space'); * } * * function draw() { @@ -122,8 +122,6 @@ p5.prototype.plane = function(width, height, detailX, detailY) { * rotateY(frameCount * 0.01); * box(50); * } - * - * describe('a white box rotating in 3D space'); * * */ @@ -235,14 +233,13 @@ p5.prototype.box = function(width, height, depth, detailX, detailY) { * // draw a sphere with radius 40 * function setup() { * createCanvas(100, 100, WEBGL); + * describe('a white sphere with black wireframe lines'); * } * * function draw() { * background(205, 102, 94); * sphere(40); * } - * - * describe('a white sphere with black wireframe lines'); * * * @@ -256,6 +253,9 @@ p5.prototype.box = function(width, height, depth, detailX, detailY) { * detailX = createSlider(3, 24, 3); * detailX.position(10, height + 5); * detailX.style('width', '80px'); + * describe( + * 'a white sphere with low detail on the x-axis, including a slider to adjust detailX' + * ); * } * * function draw() { @@ -263,10 +263,6 @@ p5.prototype.box = function(width, height, depth, detailX, detailY) { * rotateY(millis() / 1000); * sphere(40, detailX.value(), 16); * } - * - * describe( - * 'a white sphere with low detail on the x-axis, including a slider to adjust detailX' - * ); * * * @@ -280,6 +276,9 @@ p5.prototype.box = function(width, height, depth, detailX, detailY) { * detailY = createSlider(3, 16, 3); * detailY.position(10, height + 5); * detailY.style('width', '80px'); + * describe( + * 'a white sphere with low detail on the y-axis, including a slider to adjust detailY' + * ); * } * * function draw() { @@ -287,10 +286,6 @@ p5.prototype.box = function(width, height, depth, detailX, detailY) { * rotateY(millis() / 1000); * sphere(40, 16, detailY.value()); * } - * - * describe( - * 'a white sphere with low detail on the y-axis, including a slider to adjust detailY' - * ); * * */ @@ -455,6 +450,7 @@ const _truncatedCone = function( * // with radius 20 and height 50 * function setup() { * createCanvas(100, 100, WEBGL); + * describe('a rotating white cylinder'); * } * * function draw() { @@ -463,8 +459,6 @@ const _truncatedCone = function( * rotateZ(frameCount * 0.01); * cylinder(20, 50); * } - * - * describe('a rotating white cylinder'); * * * @@ -478,6 +472,9 @@ const _truncatedCone = function( * detailX = createSlider(3, 24, 3); * detailX.position(10, height + 5); * detailX.style('width', '80px'); + * describe( + * 'a rotating white cylinder with limited X detail, with a slider that adjusts detailX' + * ); * } * * function draw() { @@ -485,10 +482,6 @@ const _truncatedCone = function( * rotateY(millis() / 1000); * cylinder(20, 75, detailX.value(), 1); * } - * - * describe( - * 'a rotating white cylinder with limited X detail, with a slider that adjusts detailX' - * ); * * * @@ -502,6 +495,9 @@ const _truncatedCone = function( * detailY = createSlider(1, 16, 1); * detailY.position(10, height + 5); * detailY.style('width', '80px'); + * describe( + * 'a rotating white cylinder with limited Y detail, with a slider that adjusts detailY' + * ); * } * * function draw() { @@ -509,10 +505,6 @@ const _truncatedCone = function( * rotateY(millis() / 1000); * cylinder(20, 75, 16, detailY.value()); * } - * - * describe( - * 'a rotating white cylinder with limited Y detail, with a slider that adjusts detailY' - * ); * * */ @@ -600,6 +592,7 @@ p5.prototype.cylinder = function( * // with radius 40 and height 70 * function setup() { * createCanvas(100, 100, WEBGL); + * describe('a rotating white cone'); * } * * function draw() { @@ -608,8 +601,6 @@ p5.prototype.cylinder = function( * rotateZ(frameCount * 0.01); * cone(40, 70); * } - * - * describe('a rotating white cone'); * * * @@ -623,6 +614,9 @@ p5.prototype.cylinder = function( * detailX = createSlider(3, 16, 3); * detailX.position(10, height + 5); * detailX.style('width', '80px'); + * describe( + * 'a rotating white cone with limited X detail, with a slider that adjusts detailX' + * ); * } * * function draw() { @@ -630,10 +624,6 @@ p5.prototype.cylinder = function( * rotateY(millis() / 1000); * cone(30, 65, detailX.value(), 16); * } - * - * describe( - * 'a rotating white cone with limited X detail, with a slider that adjusts detailX' - * ); * * * @@ -647,6 +637,9 @@ p5.prototype.cylinder = function( * detailY = createSlider(3, 16, 3); * detailY.position(10, height + 5); * detailY.style('width', '80px'); + * describe( + * 'a rotating white cone with limited Y detail, with a slider that adjusts detailY' + * ); * } * * function draw() { @@ -654,10 +647,6 @@ p5.prototype.cylinder = function( * rotateY(millis() / 1000); * cone(30, 65, 16, detailY.value()); * } - * - * describe( - * 'a rotating white cone with limited Y detail, with a slider that adjusts detailY' - * ); * * */ @@ -726,14 +715,13 @@ p5.prototype.cone = function(radius, height, detailX, detailY, cap) { * // with radius 30, 40 and 40. * function setup() { * createCanvas(100, 100, WEBGL); + * describe('a white 3d ellipsoid'); * } * * function draw() { * background(205, 105, 94); * ellipsoid(30, 40, 40); * } - * - * describe('a white 3d ellipsoid'); * * * @@ -747,6 +735,9 @@ p5.prototype.cone = function(radius, height, detailX, detailY, cap) { * detailX = createSlider(2, 24, 12); * detailX.position(10, height + 5); * detailX.style('width', '80px'); + * describe( + * 'a rotating white ellipsoid with limited X detail, with a slider that adjusts detailX' + * ); * } * * function draw() { @@ -754,10 +745,6 @@ p5.prototype.cone = function(radius, height, detailX, detailY, cap) { * rotateY(millis() / 1000); * ellipsoid(30, 40, 40, detailX.value(), 8); * } - * - * describe( - * 'a rotating white ellipsoid with limited X detail, with a slider that adjusts detailX' - * ); * * * @@ -771,6 +758,9 @@ p5.prototype.cone = function(radius, height, detailX, detailY, cap) { * detailY = createSlider(2, 24, 6); * detailY.position(10, height + 5); * detailY.style('width', '80px'); + * describe( + * 'a rotating white ellipsoid with limited Y detail, with a slider that adjusts detailY' + * ); * } * * function draw() { @@ -778,10 +768,6 @@ p5.prototype.cone = function(radius, height, detailX, detailY, cap) { * rotateY(millis() / 1000); * ellipsoid(30, 40, 40, 12, detailY.value()); * } - * - * describe( - * 'a rotating white ellipsoid with limited Y detail, with a slider that adjusts detailY' - * ); * * */ @@ -870,6 +856,7 @@ p5.prototype.ellipsoid = function(radiusX, radiusY, radiusZ, detailX, detailY) { * // with ring radius 30 and tube radius 15 * function setup() { * createCanvas(100, 100, WEBGL); + * describe('a rotating white torus'); * } * * function draw() { @@ -878,8 +865,6 @@ p5.prototype.ellipsoid = function(radiusX, radiusY, radiusZ, detailX, detailY) { * rotateY(frameCount * 0.01); * torus(30, 15); * } - * - * describe('a rotating white torus'); * * * @@ -893,6 +878,9 @@ p5.prototype.ellipsoid = function(radiusX, radiusY, radiusZ, detailX, detailY) { * detailX = createSlider(3, 24, 3); * detailX.position(10, height + 5); * detailX.style('width', '80px'); + * describe( + * 'a rotating white torus with limited X detail, with a slider that adjusts detailX' + * ); * } * * function draw() { @@ -900,10 +888,6 @@ p5.prototype.ellipsoid = function(radiusX, radiusY, radiusZ, detailX, detailY) { * rotateY(millis() / 1000); * torus(30, 15, detailX.value(), 12); * } - * - * describe( - * 'a rotating white torus with limited X detail, with a slider that adjusts detailX' - * ); * * * @@ -917,6 +901,9 @@ p5.prototype.ellipsoid = function(radiusX, radiusY, radiusZ, detailX, detailY) { * detailY = createSlider(3, 16, 3); * detailY.position(10, height + 5); * detailY.style('width', '80px'); + * describe( + * 'a rotating white torus with limited Y detail, with a slider that adjusts detailY' + * ); * } * * function draw() { @@ -924,10 +911,6 @@ p5.prototype.ellipsoid = function(radiusX, radiusY, radiusZ, detailX, detailY) { * rotateY(millis() / 1000); * torus(30, 15, 16, detailY.value()); * } - * - * describe( - * 'a rotating white torus with limited Y detail, with a slider that adjusts detailY' - * ); * * */ diff --git a/src/webgl/interaction.js b/src/webgl/interaction.js index 26d8a32493..d13a9acd3e 100644 --- a/src/webgl/interaction.js +++ b/src/webgl/interaction.js @@ -30,6 +30,9 @@ import * as constants from '../core/constants'; * function setup() { * createCanvas(100, 100, WEBGL); * normalMaterial(); + * describe( + * 'Camera orbits around a box when mouse is hold-clicked & then moved.' + * ); * } * function draw() { * background(200); @@ -37,7 +40,6 @@ import * as constants from '../core/constants'; * rotateY(0.5); * box(30, 50); * } - * describe('Camera orbits around a box when mouse is hold-clicked & then moved.'); * * * @@ -168,6 +170,9 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); * normalMaterial(); * debugMode(); + * describe( + * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z. the grid and icon disappear when the spacebar is pressed.' + * ); * } * * function draw() { @@ -179,9 +184,6 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * noDebugMode(); * } * } - * describe( - * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z. the grid and icon disappear when the spacebar is pressed.' - * ); * * * @alt @@ -198,6 +200,7 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); * normalMaterial(); * debugMode(GRID); + * describe('a 3D box is centered on a grid in a 3D sketch.'); * } * * function draw() { @@ -205,8 +208,6 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * orbitControl(); * box(15, 30); * } - * - * describe('a 3D box is centered on a grid in a 3D sketch.'); * * * @alt @@ -220,6 +221,9 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); * normalMaterial(); * debugMode(AXES); + * describe( + * 'a 3D box is centered in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z.' + * ); * } * * function draw() { @@ -227,10 +231,6 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * orbitControl(); * box(15, 30); * } - * - * describe( - * 'a 3D box is centered in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z.' - * ); * * * @alt @@ -246,6 +246,7 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); * normalMaterial(); * debugMode(GRID, 100, 10, 0, 0, 0); + * describe('a 3D box is centered on a grid in a 3D sketch'); * } * * function draw() { @@ -253,8 +254,6 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * orbitControl(); * box(15, 30); * } - * - * describe('a 3D box is centered on a grid in a 3D sketch'); * * * @alt @@ -268,6 +267,9 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); * normalMaterial(); * debugMode(100, 10, 0, 0, 0, 20, 0, -40, 0); + * describe( + * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z.' + * ); * } * * function draw() { @@ -279,10 +281,6 @@ p5.prototype.orbitControl = function(sensitivityX, sensitivityY, sensitivityZ) { * stroke(255, 0, 150); * strokeWeight(0.8); * } - * - * describe( - * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z.' - * ); * * * @alt @@ -377,6 +375,9 @@ p5.prototype.debugMode = function(...args) { * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); * normalMaterial(); * debugMode(); + * describe( + * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z. the grid and icon disappear when the spacebar is pressed.' + * ); * } * * function draw() { @@ -388,10 +389,6 @@ p5.prototype.debugMode = function(...args) { * noDebugMode(); * } * } - * - * describe( - * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z. the grid and icon disappear when the spacebar is pressed.' - * ); * * * @alt diff --git a/src/webgl/light.js b/src/webgl/light.js index 010df053e5..c5df0add0a 100644 --- a/src/webgl/light.js +++ b/src/webgl/light.js @@ -37,6 +37,7 @@ import * as constants from '../core/constants'; * function setup() { * createCanvas(100, 100, WEBGL); * noStroke(); + * describe('sphere with coral color under black light'); * } * function draw() { * background(100); @@ -44,7 +45,6 @@ import * as constants from '../core/constants'; * ambientMaterial(255, 127, 80); // coral material * sphere(40); * } - * describe('sphere with coral color under black light'); * * * @alt @@ -56,6 +56,7 @@ import * as constants from '../core/constants'; * function setup() { * createCanvas(100, 100, WEBGL); * noStroke(); + * describe('sphere with coral color under white light'); * } * function draw() { * background(100); @@ -63,7 +64,6 @@ import * as constants from '../core/constants'; * ambientMaterial(255, 127, 80); // coral material * sphere(40); * } - * describe('sphere with coral color under white light'); * * * @alt @@ -146,6 +146,9 @@ p5.prototype.ambientLight = function(v1, v2, v3, a) { * function setup() { * createCanvas(100, 100, WEBGL); * noStroke(); + * describe( + * 'Sphere with specular highlight. Clicking the mouse toggles the specular highlight color between red and the default white.' + * ); * } * * function draw() { @@ -174,10 +177,6 @@ p5.prototype.ambientLight = function(v1, v2, v3, a) { * function mouseClicked() { * setRedSpecularColor = !setRedSpecularColor; * } - * - * describe( - * 'Sphere with specular highlight. Clicking the mouse toggles the specular highlight color between red and the default white.' - * ); * * * @@ -262,6 +261,9 @@ p5.prototype.specularColor = function(v1, v2, v3) { * * function setup() { * createCanvas(100, 100, WEBGL); + * describe( + * 'scene with sphere and directional light. The direction of the light is controlled with the mouse position.' + * ); * } * function draw() { * background(0); @@ -272,9 +274,6 @@ p5.prototype.specularColor = function(v1, v2, v3) { * noStroke(); * sphere(40); * } - * describe( - * 'scene with sphere and directional light. The direction of the light is controlled with the mouse position.' - * ); * * * @@ -383,6 +382,9 @@ p5.prototype.directionalLight = function(v1, v2, v3, x, y, z) { * * function setup() { * createCanvas(100, 100, WEBGL); + * describe( + * 'scene with sphere and point light. The position of the light is controlled with the mouse position.' + * ); * } * function draw() { * background(0); @@ -400,9 +402,6 @@ p5.prototype.directionalLight = function(v1, v2, v3, x, y, z) { * noStroke(); * sphere(40); * } - * describe( - * 'scene with sphere and point light. The position of the light is controlled with the mouse position.' - * ); * * * @@ -493,6 +492,7 @@ p5.prototype.pointLight = function(v1, v2, v3, x, y, z) { * * function setup() { * createCanvas(100, 100, WEBGL); + * describe('the light is partially ambient and partially directional'); * } * function draw() { * background(0); @@ -502,7 +502,6 @@ p5.prototype.pointLight = function(v1, v2, v3, x, y, z) { * rotateZ(millis() / 1000); * box(); * } - * describe('the light is partially ambient and partially directional'); * * * @@ -547,6 +546,9 @@ p5.prototype.lights = function() { * function setup() { * createCanvas(100, 100, WEBGL); * noStroke(); + * describe( + * 'Two spheres with different falloff values show different intensity of light' + * ); * } * function draw() { * ortho(); @@ -570,9 +572,6 @@ p5.prototype.lights = function() { * sphere(20); * pop(); * } - * describe( - * 'Two spheres with different falloff values show different intensity of light' - * ); * * * @@ -670,6 +669,9 @@ p5.prototype.lightFalloff = function( * * function setup() { * createCanvas(100, 100, WEBGL); + * describe( + * 'scene with sphere and spot light. The position of the light is controlled with the mouse position.' + * ); * } * function draw() { * background(0); @@ -688,9 +690,6 @@ p5.prototype.lightFalloff = function( * noStroke(); * sphere(40); * } - * describe( - * 'scene with sphere and spot light. The position of the light is controlled with the mouse position.' - * ); * * * @@ -1004,6 +1003,9 @@ p5.prototype.spotLight = function( * * function setup() { * createCanvas(100, 100, WEBGL); + * describe( + * 'Three white spheres. Each appears as a different color due to lighting.' + * ); * } * function draw() { * background(200); @@ -1024,9 +1026,6 @@ p5.prototype.spotLight = function( * ambientMaterial(255); * sphere(13); * } - * describe( - * 'Three white spheres. Each appears as a different color due to lighting.' - * ); * * * diff --git a/src/webgl/loading.js b/src/webgl/loading.js index 39ed1d9b0e..039eba7fea 100755 --- a/src/webgl/loading.js +++ b/src/webgl/loading.js @@ -50,6 +50,7 @@ import './p5.Geometry'; * * function setup() { * createCanvas(100, 100, WEBGL); + * describe('Vertically rotating 3-d octahedron.'); * } * * function draw() { @@ -58,8 +59,6 @@ import './p5.Geometry'; * rotateY(frameCount * 0.01); * model(octahedron); * } - * - * describe('Vertically rotating 3-d octahedron.'); * * * @@ -79,6 +78,7 @@ import './p5.Geometry'; * * function setup() { * createCanvas(100, 100, WEBGL); + * describe('Vertically rotating 3-d teapot with red, green and blue gradient.'); * } * * function draw() { @@ -89,8 +89,6 @@ import './p5.Geometry'; * normalMaterial(); // For effect * model(teapot); * } - * - * describe('Vertically rotating 3-d teapot with red, green and blue gradient.'); * * * @@ -606,6 +604,7 @@ function parseASCIISTL(model, lines) { * * function setup() { * createCanvas(100, 100, WEBGL); + * describe('Vertically rotating 3-d octahedron.'); * } * * function draw() { @@ -614,8 +613,6 @@ function parseASCIISTL(model, lines) { * rotateY(frameCount * 0.01); * model(octahedron); * } - * - * describe('Vertically rotating 3-d octahedron.'); * * * diff --git a/src/webgl/material.js b/src/webgl/material.js index 89078ea821..6694427a3b 100644 --- a/src/webgl/material.js +++ b/src/webgl/material.js @@ -45,14 +45,13 @@ import './p5.Texture'; * shader(mandel); * noStroke(); * mandel.setUniform('p', [-0.74364388703, 0.13182590421]); + * describe('zooming Mandelbrot set. a colorful, infinitely detailed fractal.'); * } * * function draw() { * mandel.setUniform('r', 1.5 * exp(-6.5 * (1 + sin(millis() / 2000)))); * quad(-1, -1, 1, -1, 1, 1, -1, 1); * } - * - * describe('zooming Mandelbrot set. a colorful, infinitely detailed fractal.'); * * * @@ -164,6 +163,7 @@ p5.prototype.loadShader = function( * * // 'p' is the center point of the Mandelbrot image * mandel.setUniform('p', [-0.74364388703, 0.13182590421]); + * describe('zooming Mandelbrot set. a colorful, infinitely detailed fractal.'); * } * * function draw() { @@ -171,8 +171,6 @@ p5.prototype.loadShader = function( * mandel.setUniform('r', 1.5 * exp(-6.5 * (1 + sin(millis() / 2000)))); * quad(-1, -1, 1, -1, 1, 1, -1, 1); * } - * - * describe('zooming Mandelbrot set. a colorful, infinitely detailed fractal.'); * * * @@ -237,6 +235,10 @@ p5.prototype.createShader = function(vertSrc, fragSrc) { * orangeBlue.setUniform('colorBackground', [0.226, 0.0, 0.615]); * * noStroke(); + * + * describe( + * 'canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed.' + * ); * } * * function draw() { @@ -257,10 +259,6 @@ p5.prototype.createShader = function(vertSrc, fragSrc) { * function mouseClicked() { * showRedGreen = !showRedGreen; * } - * - * describe( - * 'canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed.' - * ); * * * @@ -334,6 +332,10 @@ p5.prototype.shader = function(s) { * * // Create our shader * shaderProgram = createShader(vertSrc, fragSrc); + * + * describe( + * 'Two rotating cubes. The left one is painted using a custom (user-defined) shader, while the right one is painted using the default fill shader.' + * ); * } * * // prettier-ignore @@ -362,10 +364,6 @@ p5.prototype.shader = function(s) { * box(width / 4); * pop(); * } - * - * describe( - * 'Two rotating cubes. The left one is painted using a custom (user-defined) shader, while the right one is painted using the default fill shader.' - * ); * * * @alt @@ -404,6 +402,7 @@ p5.prototype.resetShader = function() { * * function setup() { * createCanvas(100, 100, WEBGL); + * describe('spinning cube with a texture from an image'); * } * * function draw() { @@ -415,8 +414,6 @@ p5.prototype.resetShader = function() { * texture(img); * box(width / 2); * } - * - * describe('spinning cube with a texture from an image'); * * * @alt @@ -431,6 +428,7 @@ p5.prototype.resetShader = function() { * createCanvas(100, 100, WEBGL); * pg = createGraphics(200, 200); * pg.textSize(75); + * describe('plane with a texture from an image created by createGraphics()'); * } * * function draw() { @@ -443,8 +441,6 @@ p5.prototype.resetShader = function() { * noStroke(); * plane(50); * } - * - * describe('plane with a texture from an image created by createGraphics()'); * * * @alt @@ -460,6 +456,7 @@ p5.prototype.resetShader = function() { * } * function setup() { * createCanvas(100, 100, WEBGL); + * describe('rectangle with video as texture'); * } * * function draw() { @@ -472,8 +469,6 @@ p5.prototype.resetShader = function() { * function mousePressed() { * vid.loop(); * } - * - * describe('rectangle with video as texture'); * * * @@ -491,6 +486,7 @@ p5.prototype.resetShader = function() { * * function setup() { * createCanvas(100, 100, WEBGL); + * describe('quad with a texture, mapped using normalized coordinates'); * } * * function draw() { @@ -504,8 +500,6 @@ p5.prototype.resetShader = function() { * vertex(-40, 40, 0, 1); * endShape(); * } - * - * describe('quad with a texture, mapped using normalized coordinates'); * * * @alt @@ -549,6 +543,7 @@ p5.prototype.texture = function(tex) { * * function setup() { * createCanvas(100, 100, WEBGL); + * describe('quad with a texture, mapped using normalized coordinates'); * } * * function draw() { @@ -561,8 +556,6 @@ p5.prototype.texture = function(tex) { * vertex(-50, 50, 0, 1); * endShape(); * } - * - * describe('quad with a texture, mapped using normalized coordinates'); * * * @alt @@ -579,6 +572,7 @@ p5.prototype.texture = function(tex) { * * function setup() { * createCanvas(100, 100, WEBGL); + * describe('quad with a texture, mapped using image coordinates'); * } * * function draw() { @@ -591,8 +585,6 @@ p5.prototype.texture = function(tex) { * vertex(-50, 50, 0, img.height); * endShape(); * } - * - * describe('quad with a texture, mapped using image coordinates'); * * * @alt @@ -639,6 +631,7 @@ p5.prototype.textureMode = function(mode) { * function setup() { * createCanvas(100, 100, WEBGL); * textureWrap(MIRROR); + * describe('an image of the rocky mountains repeated in mirrored tiles'); * } * * function draw() { @@ -664,8 +657,6 @@ p5.prototype.textureMode = function(mode) { * vertex(-1, -1, 0, 0, 0); * endShape(); * } - * - * describe('an image of the rocky mountains repeated in mirrored tiles'); * * * @@ -701,6 +692,7 @@ p5.prototype.textureWrap = function(wrapX, wrapY = wrapX) { * * function setup() { * createCanvas(100, 100, WEBGL); + * describe('Sphere with normal material'); * } * * function draw() { @@ -708,8 +700,6 @@ p5.prototype.textureWrap = function(wrapX, wrapY = wrapX) { * normalMaterial(); * sphere(40); * } - * - * describe('Sphere with normal material'); * * * @alt @@ -759,6 +749,7 @@ p5.prototype.normalMaterial = function(...args) { * * function setup() { * createCanvas(100, 100, WEBGL); + * describe('sphere reflecting red, blue, and green light'); * } * function draw() { * background(0); @@ -767,7 +758,6 @@ p5.prototype.normalMaterial = function(...args) { * ambientMaterial(70, 130, 230); * sphere(40); * } - * describe('sphere reflecting red, blue, and green light'); * * * @alt @@ -780,6 +770,7 @@ p5.prototype.normalMaterial = function(...args) { * // so object only reflects it's red and blue components * function setup() { * createCanvas(100, 100, WEBGL); + * describe('box reflecting only red and blue light'); * } * function draw() { * background(70); @@ -787,7 +778,6 @@ p5.prototype.normalMaterial = function(...args) { * ambientMaterial(255); // white material * box(30); * } - * describe('box reflecting only red and blue light'); * * * @alt @@ -800,6 +790,7 @@ p5.prototype.normalMaterial = function(...args) { * // green, it does not reflect any light * function setup() { * createCanvas(100, 100, WEBGL); + * describe('box reflecting no light'); * } * function draw() { * background(70); @@ -807,7 +798,6 @@ p5.prototype.normalMaterial = function(...args) { * ambientMaterial(255, 0, 255); // magenta material * box(30); * } - * describe('box reflecting no light'); * * * @alt @@ -872,6 +862,7 @@ p5.prototype.ambientMaterial = function(v1, v2, v3) { * * function setup() { * createCanvas(100, 100, WEBGL); + * describe('sphere with green emissive material'); * } * function draw() { * background(0); @@ -880,7 +871,6 @@ p5.prototype.ambientMaterial = function(v1, v2, v3) { * emissiveMaterial(130, 230, 0); * sphere(40); * } - * describe('sphere with green emissive material'); * * * @@ -948,6 +938,7 @@ p5.prototype.emissiveMaterial = function(v1, v2, v3, a) { * function setup() { * createCanvas(100, 100, WEBGL); * noStroke(); + * describe('torus with specular material'); * } * * function draw() { @@ -964,8 +955,6 @@ p5.prototype.emissiveMaterial = function(v1, v2, v3, a) { * shininess(50); * torus(30, 10, 64, 64); * } - * - * describe('torus with specular material'); * * * @alt @@ -1020,6 +1009,7 @@ p5.prototype.specularMaterial = function(v1, v2, v3, alpha) { * * function setup() { * createCanvas(100, 100, WEBGL); + * describe('two spheres, one more shiny than the other'); * } * function draw() { * background(0); @@ -1036,7 +1026,6 @@ p5.prototype.specularMaterial = function(v1, v2, v3, alpha) { * shininess(20); * sphere(20); * } - * describe('two spheres, one more shiny than the other'); * * * @alt diff --git a/src/webgl/p5.Camera.js b/src/webgl/p5.Camera.js index 03c3b0e91b..637ada8e69 100644 --- a/src/webgl/p5.Camera.js +++ b/src/webgl/p5.Camera.js @@ -45,6 +45,7 @@ import p5 from '../core/main'; * * function setup() { * createCanvas(100, 100, WEBGL); + * describe('a square moving closer and then away from the camera.'); * } * function draw() { * background(204); @@ -52,7 +53,6 @@ import p5 from '../core/main'; * camera(0, 0, 20 + sin(frameCount * 0.01) * 10, 0, 0, 0, 0, 1, 0); * plane(10, 10); * } - * describe('a square moving closer and then away from the camera.'); * * * @@ -83,6 +83,9 @@ import p5 from '../core/main'; * sliderGroup[i].position(10, height + h); * sliderGroup[i].style('width', '80px'); * } + * describe( + * 'White square repeatedly grows to fill canvas and then shrinks. An interactive example of a red cube with 3 sliders for moving it across x, y, z axis and 3 sliders for shifting its center.' + * ); * } * * function draw() { @@ -99,10 +102,6 @@ import p5 from '../core/main'; * fill(255, 102, 94); * box(85); * } - * - * describe( - * 'White square repeatedly grows to fill canvas and then shrinks. An interactive example of a red cube with 3 sliders for moving it across x, y, z axis and 3 sliders for shifting its center.' - * ); * * * @alt @@ -146,6 +145,9 @@ p5.prototype.camera = function(...args) { * function setup() { * createCanvas(100, 100, WEBGL); * perspective(PI / 3.0, width / height, 0.1, 500); + * describe( + * 'two colored 3D boxes move back and forth, rotating as mouse is dragged.' + * ); * } * function draw() { * background(200); @@ -165,9 +167,6 @@ p5.prototype.camera = function(...args) { * box(30); * pop(); * } - * describe( - * 'two colored 3D boxes move back and forth, rotating as mouse is dragged.' - * ); * * * @@ -211,6 +210,9 @@ p5.prototype.perspective = function(...args) { * function setup() { * createCanvas(100, 100, WEBGL); * ortho(-width / 2, width / 2, height / 2, -height / 2, 0, 500); + * describe( + * 'two 3D boxes move back and forth along same plane, rotating as mouse is dragged.' + * ); * } * function draw() { * background(200); @@ -228,9 +230,6 @@ p5.prototype.perspective = function(...args) { * box(30); * pop(); * } - * describe( - * 'two 3D boxes move back and forth along same plane, rotating as mouse is dragged.' - * ); * * * @@ -277,6 +276,9 @@ p5.prototype.ortho = function(...args) { * createCanvas(100, 100, WEBGL); * setAttributes('antialias', true); * frustum(-0.1, 0.1, -0.1, 0.1, 0.1, 200); + * describe( + * 'two 3D boxes move back and forth along same plane, rotating as mouse is dragged.' + * ); * } * function draw() { * background(200); @@ -294,9 +296,6 @@ p5.prototype.ortho = function(...args) { * box(30); * pop(); * } - * describe( - * 'two 3D boxes move back and forth along same plane, rotating as mouse is dragged.' - * ); * * * @@ -342,6 +341,7 @@ p5.prototype.frustum = function(...args) { * createCanvas(100, 100, WEBGL); * background(0); * camera = createCamera(); + * describe('An example that creates a camera and moves it around the box.'); * } * * function draw() { @@ -349,8 +349,6 @@ p5.prototype.frustum = function(...args) { * camera.setPosition(sin(frameCount / 60) * 200, 0, 100); * box(20); * } - * - * describe('An example that creates a camera and moves it around the box.'); * * * @alt @@ -414,6 +412,9 @@ p5.prototype.createCamera = function() { * cam = createCamera(); * // set initial pan angle * cam.pan(-0.8); + * describe( + * 'camera view pans left and right across a series of rotating 3D boxes.' + * ); * } * * function draw() { @@ -443,10 +444,6 @@ p5.prototype.createCamera = function() { * translate(35, 0, 0); * box(20); * } - * - * describe( - * 'camera view pans left and right across a series of rotating 3D boxes.' - * ); * * * @@ -475,6 +472,7 @@ p5.Camera = function(renderer) { * cam = createCamera(); * div = createDiv(); * div.position(0, 0); + * describe('An example showing the use of camera object properties'); * } * * function draw() { @@ -482,8 +480,6 @@ p5.Camera = function(renderer) { * box(10); * div.html('eyeX = ' + cam.eyeX); * } - * - * describe('An example showing the use of camera object properties'); * * * @alt @@ -504,6 +500,7 @@ p5.Camera = function(renderer) { * cam = createCamera(); * div = createDiv(); * div.position(0, 0); + * describe('An example showing the use of camera object properties'); * } * * function draw() { @@ -511,8 +508,6 @@ p5.Camera = function(renderer) { * box(10); * div.html('eyeY = ' + cam.eyeY); * } - * - * describe('An example showing the use of camera object properties'); * * * @alt @@ -533,6 +528,7 @@ p5.Camera = function(renderer) { * cam = createCamera(); * div = createDiv(); * div.position(0, 0); + * describe('An example showing the use of camera object properties'); * } * * function draw() { @@ -540,8 +536,6 @@ p5.Camera = function(renderer) { * box(10); * div.html('eyeZ = ' + cam.eyeZ); * } - * - * describe('An example showing the use of camera object properties'); * * * @alt @@ -564,14 +558,13 @@ p5.Camera = function(renderer) { * div = createDiv('centerX = ' + cam.centerX); * div.position(0, 0); * div.style('color', 'white'); + * describe('An example showing the use of camera object properties'); * } * * function draw() { * orbitControl(); * box(10); * } - * - * describe('An example showing the use of camera object properties'); * * * @alt @@ -594,14 +587,13 @@ p5.Camera = function(renderer) { * div = createDiv('centerY = ' + cam.centerY); * div.position(0, 0); * div.style('color', 'white'); + * describe('An example showing the use of camera object properties'); * } * * function draw() { * orbitControl(); * box(10); * } - * - * describe('An example showing the use of camera object properties'); * * * @alt @@ -624,14 +616,13 @@ p5.Camera = function(renderer) { * div = createDiv('centerZ = ' + cam.centerZ); * div.position(0, 0); * div.style('color', 'white'); + * describe('An example showing the use of camera object properties'); * } * * function draw() { * orbitControl(); * box(10); * } - * - * describe('An example showing the use of camera object properties'); * * * @alt @@ -654,9 +645,8 @@ p5.Camera = function(renderer) { * div.position(0, 0); * div.style('color', 'blue'); * div.style('font-size', '18px'); + * describe('An example showing the use of camera object properties'); * } - * - * describe('An example showing the use of camera object properties'); * * * @alt @@ -679,9 +669,8 @@ p5.Camera = function(renderer) { * div.position(0, 0); * div.style('color', 'blue'); * div.style('font-size', '18px'); + * describe('An example showing the use of camera object properties'); * } - * - * describe('An example showing the use of camera object properties'); * * * @alt @@ -704,9 +693,8 @@ p5.Camera = function(renderer) { * div.position(0, 0); * div.style('color', 'blue'); * div.style('font-size', '18px'); + * describe('An example showing the use of camera object properties'); * } - * - * describe('An example showing the use of camera object properties'); * * * @alt @@ -1782,6 +1770,10 @@ p5.Camera.prototype._isActive = function() { * * // set variable for previously active camera: * currentCamera = 1; + * + * describe( + * 'Canvas switches between two camera views, each showing a series of spinning 3D boxes.' + * ); * } * * function draw() { @@ -1822,10 +1814,6 @@ p5.Camera.prototype._isActive = function() { * translate(35, 0, 0); * box(20); * } - * - * describe( - * 'Canvas switches between two camera views, each showing a series of spinning 3D boxes.' - * ); * * * diff --git a/src/webgl/p5.Shader.js b/src/webgl/p5.Shader.js index a4014b31af..5435814f2d 100644 --- a/src/webgl/p5.Shader.js +++ b/src/webgl/p5.Shader.js @@ -341,6 +341,10 @@ p5.Shader.prototype.useProgram = function() { * createCanvas(100, 100, WEBGL); * shader(grad); * noStroke(); + * + * describe( + * 'canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed.' + * ); * } * * function draw() { @@ -363,10 +367,6 @@ p5.Shader.prototype.useProgram = function() { * function mouseClicked() { * showRedGreen = !showRedGreen; * } - * - * describe( - * 'canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed.' - * ); * * * From 0ef2ecc229925667e84aea43f23566066f528b16 Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Wed, 6 Jul 2022 21:36:27 -0700 Subject: [PATCH 103/131] Update Welcome bot first issue message --- .github/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/config.yml b/.github/config.yml index 1d0f4cae3d..c4629c14ed 100644 --- a/.github/config.yml +++ b/.github/config.yml @@ -4,8 +4,7 @@ # Comment to be posted to on first time issues newIssueWelcomeComment: > - Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to be sure to fill out the issue form template inputs accurately if you haven't already. - + Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you! # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome # Comment to be posted to on PRs from first time contributors in your repository From 3646c531c6fa36ba45ae2c20615a522b897d0c43 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 7 Jul 2022 17:50:01 +0000 Subject: [PATCH 104/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ae83abd20d..453180c560 100644 --- a/README.md +++ b/README.md @@ -564,6 +564,7 @@ We recognize all types of contributions. This project follows the [all-contribut
Philip Bell

📖
tapioca24

🔌
Qianqian Ye

💻 🎨 📖 📋 👀 🌍 +
Adarsh

🌍 From 82bb3a8e644c334bcb0f917492e9d88dc00686b6 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 7 Jul 2022 17:50:02 +0000 Subject: [PATCH 105/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 7efcd834f1..b5532c40f1 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3082,6 +3082,15 @@ "review", "translation" ] + }, + { + "login": "adarrssh", + "name": "Adarsh", + "avatar_url": "https://avatars.githubusercontent.com/u/85433137?v=4", + "profile": "https://github.com/adarrssh", + "contributions": [ + "translation" + ] } ], "repoType": "github", From 6c5753e57c295a614ffb8ce2ef4f67c34124dd74 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 7 Jul 2022 18:00:03 +0000 Subject: [PATCH 106/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 453180c560..275c21dd91 100644 --- a/README.md +++ b/README.md @@ -565,6 +565,7 @@ We recognize all types of contributions. This project follows the [all-contribut
tapioca24

🔌
Qianqian Ye

💻 🎨 📖 📋 👀 🌍
Adarsh

🌍 +
kaabe1

🎨 📋 From e650be4c90ce0fac7537be363d29cfb7ec979ed6 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 7 Jul 2022 18:00:04 +0000 Subject: [PATCH 107/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index b5532c40f1..8a10b86a7a 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3091,6 +3091,16 @@ "contributions": [ "translation" ] + }, + { + "login": "kaabe1", + "name": "kaabe1", + "avatar_url": "https://avatars.githubusercontent.com/u/78185255?v=4", + "profile": "https://github.com/kaabe1", + "contributions": [ + "design", + "eventOrganizing" + ] } ], "repoType": "github", From 06856a2335df0797d8f42e5c78b0a34065d5ed3f Mon Sep 17 00:00:00 2001 From: evelyn masso Date: Thu, 7 Jul 2022 16:15:28 -0700 Subject: [PATCH 108/131] remove self from some steward areas --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 16f75510d5..4b74e10cab 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Stewards are contributors that are particularly involved, familiar, or responsiv Anyone interested can volunteer to be a steward! There are no specific requirements for expertise, just an interest in actively learning and participating. If you’re familiar with one or more parts of this project, open an issue to volunteer as a steward! * [@qianqianye](https://github.com/qianqianye) - project co-lead -* [@outofambit](https://github.com/outofambit) +* [@outofambit](https://github.com/outofambit) - project mentor * [@lmccart](https://github.com/lmccart) * [@limzykenneth](https://github.com/limzykenneth) * [@stalgiag](https://github.com/stalgiag) @@ -65,12 +65,12 @@ Anyone interested can volunteer to be a steward! There are no specific requireme | Area | Steward(s) | | :-------------------------------- | :------------------------------------------- | -| Accessibility (Web Accessibility) | outofambit | -| Color | outofambit | -| Core/Environment/Rendering | outofambit
limzykenneth | +| Accessibility (Web Accessibility) | | +| Color | | +| Core/Environment/Rendering | limzykenneth | | Data | | | DOM | outofambit | -| Events | outofambit
limzykenneth | +| Events | limzykenneth | | Image | stalgiag | | IO | limzykenneth | | Math | limzykenneth | From a1aea892c2a91441a18025e7e3ef9eb3f409b8e6 Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Thu, 7 Jul 2022 18:07:37 -0700 Subject: [PATCH 109/131] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4b74e10cab..5583f83dc7 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,8 @@ Stewards are contributors that are particularly involved, familiar, or responsiv Anyone interested can volunteer to be a steward! There are no specific requirements for expertise, just an interest in actively learning and participating. If you’re familiar with one or more parts of this project, open an issue to volunteer as a steward! -* [@qianqianye](https://github.com/qianqianye) - project co-lead -* [@outofambit](https://github.com/outofambit) - project mentor +* [@qianqianye](https://github.com/qianqianye) - p5.js Project Lead +* [@outofambit](https://github.com/outofambit) - p5.js Mentor * [@lmccart](https://github.com/lmccart) * [@limzykenneth](https://github.com/limzykenneth) * [@stalgiag](https://github.com/stalgiag) From fdd288a0fa7bff323946d56f502310cd0cdf3511 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 8 Jul 2022 03:01:03 +0000 Subject: [PATCH 110/131] docs: update README.md [skip ci] --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b5490032bd..1f0dd5d7e3 100644 --- a/README.md +++ b/README.md @@ -567,6 +567,9 @@ We recognize all types of contributions. This project follows the [all-contribut
Adarsh

🌍
kaabe1

🎨 📋 + +
Seb Méndez

🌍 + From 6ca8d8761b5d107b9425d7f3ccf62e61c04d3683 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 8 Jul 2022 03:01:03 +0000 Subject: [PATCH 111/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 8a10b86a7a..fd4e9a7805 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3101,6 +3101,15 @@ "design", "eventOrganizing" ] + }, + { + "login": "Guirdo", + "name": "Seb Méndez", + "avatar_url": "https://avatars.githubusercontent.com/u/21044700?v=4", + "profile": "https://www.guirdo.xyz/", + "contributions": [ + "translation" + ] } ], "repoType": "github", From 082a6de63e47c3fc5efc1e9cb96ada7306a364b7 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sat, 9 Jul 2022 08:50:48 +0000 Subject: [PATCH 112/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1f0dd5d7e3..d8f106205a 100644 --- a/README.md +++ b/README.md @@ -569,6 +569,7 @@ We recognize all types of contributions. This project follows the [all-contribut
Seb Méndez

🌍 +
Ryuya

🐛 👀 💻 From cebbc8fa1085cc349cabe7998ca5b663d196a089 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sat, 9 Jul 2022 08:50:50 +0000 Subject: [PATCH 113/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index fd4e9a7805..504c12535d 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3110,6 +3110,17 @@ "contributions": [ "translation" ] + }, + { + "login": "3ru", + "name": "Ryuya", + "avatar_url": "https://avatars.githubusercontent.com/u/69892552?v=4", + "profile": "https://github.com/3ru", + "contributions": [ + "bug", + "review", + "code" + ] } ], "repoType": "github", From 4a764bca7bcc01242471f4664c267c035a1f642b Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 12 Jul 2022 05:08:49 +0000 Subject: [PATCH 114/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d8f106205a..5036994f65 100644 --- a/README.md +++ b/README.md @@ -570,6 +570,7 @@ We recognize all types of contributions. This project follows the [all-contribut
Seb Méndez

🌍
Ryuya

🐛 👀 💻 +
LEMIBANDDEXARI

🌍 From 8a2f384a82e1e695a2febe9baadc3220d86bbc83 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 12 Jul 2022 05:08:50 +0000 Subject: [PATCH 115/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 504c12535d..09ef0e4b8a 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3121,6 +3121,15 @@ "review", "code" ] + }, + { + "login": "LEMIBANDDEXARI", + "name": "LEMIBANDDEXARI", + "avatar_url": "https://avatars.githubusercontent.com/u/70129787?v=4", + "profile": "https://github.com/LEMIBANDDEXARI", + "contributions": [ + "translation" + ] } ], "repoType": "github", From cd5e83e3a568191fc5fd3d1be3006430046ba278 Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Mon, 11 Jul 2022 22:38:57 -0700 Subject: [PATCH 116/131] Add stewards --- README.md | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 5036994f65..576e896902 100644 --- a/README.md +++ b/README.md @@ -63,24 +63,25 @@ Anyone interested can volunteer to be a steward! There are no specific requireme * [@dhowe](https://github.com/dhowe) * [@rahulm2310](https://github.com/rahulm2310) -| Area | Steward(s) | -| :-------------------------------- | :------------------------------------------- | -| Accessibility (Web Accessibility) | | -| Color | | -| Core/Environment/Rendering | limzykenneth | -| Data | | -| DOM | outofambit | -| Events | limzykenneth | -| Image | stalgiag | -| IO | limzykenneth | -| Math | limzykenneth | -| Typography | dhowe | -| Utilities | | -| WebGL | stalgiag | -| Build Process/Unit Testing | outofambit | -| Localization Tools | outofambit | -| Friendly Errors | outofambit | -| [Website](https://github.com/processing/p5.js-website) | limzykenneth
rahulm2310 | +| Area | Steward(s) | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| Overall | [@qianqianye](https://github.com/qianqianye) | +| [Accessibility](https://github.com/processing/p5.js/tree/main/src/accessibility) | [@kungfuchicken](https://github.com/kungfuchicken) | +| [Color](https://github.com/processing/p5.js/tree/main/src/color) | | +| [Core](https://github.com/processing/p5.js/tree/main/src/core)/Environment/Rendering | [@limzykenneth](https://github.com/limzykenneth) | +| [Data](https://github.com/processing/p5.js/tree/main/src/data) | [@kungfuchicken](https://github.com/kungfuchicken) | +| [DOM](https://github.com/processing/p5.js/tree/main/src/dom) | [@outofambit](https://github.com/outofambit) | +| [Events](https://github.com/processing/p5.js/tree/main/src/events) | [@limzykenneth](https://github.com/limzykenneth) | +| [Image](https://github.com/processing/p5.js/tree/main/src/image) | [@stalgiag](https://github.com/stalgiag), [@cgusb](https://github.com/cgusb), [@photon-niko](https://github.com/photon-niko) +| [IO](https://github.com/processing/p5.js/tree/main/src/io) | [@limzykenneth](https://github.com/limzykenneth) | +| [Math](https://github.com/processing/p5.js/tree/main/src/math) | [@limzykenneth](https://github.com/limzykenneth) | +| [Typography](https://github.com/processing/p5.js/tree/main/src/typography) | [@dhowe](https://github.com/dhowe) | +| [Utilities](https://github.com/processing/p5.js/tree/main/src/utilities) | [@kungfuchicken](https://github.com/kungfuchicken) | +| [WebGL](https://github.com/processing/p5.js/tree/main/src/webgl) | [@stalgiag](https://github.com/stalgiag); GSoC 2022: [@aceslowman](https://github.com/aceslowman)(Contributor), [@kjhollen](https://github.com/kjhollen)(Mentor); [@ShenpaiSharma](https://github.com/ShenpaiSharma)(Contributor), [@calebfoss](https://github.com/calebfoss)(Mentor) | +| Build Process/Unit Testing | [@outofambit](https://github.com/outofambit), [@kungfuchicken](https://github.com/kungfuchicken) | +| Localization Tools | [@outofambit](https://github.com/outofambit) | +| Friendly Errors | [@outofambit](https://github.com/outofambit) | +| [Contributor Docs](https://github.com/processing/p5.js/tree/main/contributor_docs) | [SoD 2022](https://github.com/processing/p5.js/wiki/Season-of-Docs-2022-Organization-Application---p5.js): [@limzykenneth](https://github.com/limzykenneth) | ## Contributors From 05c93858bcf2ed8f7b1c4362cd459c8312369112 Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Tue, 12 Jul 2022 13:15:25 -0700 Subject: [PATCH 117/131] Add more stewards --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 576e896902..84a21d3b0c 100644 --- a/README.md +++ b/README.md @@ -67,17 +67,17 @@ Anyone interested can volunteer to be a steward! There are no specific requireme | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | | Overall | [@qianqianye](https://github.com/qianqianye) | | [Accessibility](https://github.com/processing/p5.js/tree/main/src/accessibility) | [@kungfuchicken](https://github.com/kungfuchicken) | -| [Color](https://github.com/processing/p5.js/tree/main/src/color) | | -| [Core](https://github.com/processing/p5.js/tree/main/src/core)/Environment/Rendering | [@limzykenneth](https://github.com/limzykenneth) | +| [Color](https://github.com/processing/p5.js/tree/main/src/color) | [@KleoP](https://github.com/KleoP) | +| [Core](https://github.com/processing/p5.js/tree/main/src/core)/Environment/Rendering | [@limzykenneth](https://github.com/limzykenneth), [@davepagurek](https://github.com/davepagurek), [@jeffawang](https://github.com/jeffawang) | | [Data](https://github.com/processing/p5.js/tree/main/src/data) | [@kungfuchicken](https://github.com/kungfuchicken) | -| [DOM](https://github.com/processing/p5.js/tree/main/src/dom) | [@outofambit](https://github.com/outofambit) | +| [DOM](https://github.com/processing/p5.js/tree/main/src/dom) | [@outofambit](https://github.com/outofambit), [@SarveshLimaye](https://github.com/SarveshLimaye) | | [Events](https://github.com/processing/p5.js/tree/main/src/events) | [@limzykenneth](https://github.com/limzykenneth) | -| [Image](https://github.com/processing/p5.js/tree/main/src/image) | [@stalgiag](https://github.com/stalgiag), [@cgusb](https://github.com/cgusb), [@photon-niko](https://github.com/photon-niko) +| [Image](https://github.com/processing/p5.js/tree/main/src/image) | [@stalgiag](https://github.com/stalgiag), [@cgusb](https://github.com/cgusb), [@photon-niko](https://github.com/photon-niko), [@KleoP](https://github.com/KleoP) | [IO](https://github.com/processing/p5.js/tree/main/src/io) | [@limzykenneth](https://github.com/limzykenneth) | -| [Math](https://github.com/processing/p5.js/tree/main/src/math) | [@limzykenneth](https://github.com/limzykenneth) | -| [Typography](https://github.com/processing/p5.js/tree/main/src/typography) | [@dhowe](https://github.com/dhowe) | +| [Math](https://github.com/processing/p5.js/tree/main/src/math) | [@limzykenneth](https://github.com/limzykenneth), [@jeffawang](https://github.com/jeffawang) | +| [Typography](https://github.com/processing/p5.js/tree/main/src/typography) | [@dhowe](https://github.com/dhowe), [@SarveshLimaye](https://github.com/SarveshLimaye) | | [Utilities](https://github.com/processing/p5.js/tree/main/src/utilities) | [@kungfuchicken](https://github.com/kungfuchicken) | -| [WebGL](https://github.com/processing/p5.js/tree/main/src/webgl) | [@stalgiag](https://github.com/stalgiag); GSoC 2022: [@aceslowman](https://github.com/aceslowman)(Contributor), [@kjhollen](https://github.com/kjhollen)(Mentor); [@ShenpaiSharma](https://github.com/ShenpaiSharma)(Contributor), [@calebfoss](https://github.com/calebfoss)(Mentor) | +| [WebGL](https://github.com/processing/p5.js/tree/main/src/webgl) | [@stalgiag](https://github.com/stalgiag); GSoC 2022: [@aceslowman](https://github.com/aceslowman)(Contributor), [@kjhollen](https://github.com/kjhollen)(Mentor); [@ShenpaiSharma](https://github.com/ShenpaiSharma)(Contributor), [@calebfoss](https://github.com/calebfoss)(Mentor); [@davepagurek](https://github.com/davepagurek); [@jeffawang](https://github.com/jeffawang) | | Build Process/Unit Testing | [@outofambit](https://github.com/outofambit), [@kungfuchicken](https://github.com/kungfuchicken) | | Localization Tools | [@outofambit](https://github.com/outofambit) | | Friendly Errors | [@outofambit](https://github.com/outofambit) | From d25214f091e9009440491cf8b0020d258c852a25 Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Wed, 13 Jul 2022 14:06:55 -0700 Subject: [PATCH 118/131] Add more p5.js stewards --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 84a21d3b0c..c32035a5b4 100644 --- a/README.md +++ b/README.md @@ -67,20 +67,20 @@ Anyone interested can volunteer to be a steward! There are no specific requireme | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | | Overall | [@qianqianye](https://github.com/qianqianye) | | [Accessibility](https://github.com/processing/p5.js/tree/main/src/accessibility) | [@kungfuchicken](https://github.com/kungfuchicken) | -| [Color](https://github.com/processing/p5.js/tree/main/src/color) | [@KleoP](https://github.com/KleoP) | +| [Color](https://github.com/processing/p5.js/tree/main/src/color) | [@KleoP](https://github.com/KleoP), [@murilopolese](https://github.com/murilopolese) | | [Core](https://github.com/processing/p5.js/tree/main/src/core)/Environment/Rendering | [@limzykenneth](https://github.com/limzykenneth), [@davepagurek](https://github.com/davepagurek), [@jeffawang](https://github.com/jeffawang) | | [Data](https://github.com/processing/p5.js/tree/main/src/data) | [@kungfuchicken](https://github.com/kungfuchicken) | | [DOM](https://github.com/processing/p5.js/tree/main/src/dom) | [@outofambit](https://github.com/outofambit), [@SarveshLimaye](https://github.com/SarveshLimaye) | | [Events](https://github.com/processing/p5.js/tree/main/src/events) | [@limzykenneth](https://github.com/limzykenneth) | | [Image](https://github.com/processing/p5.js/tree/main/src/image) | [@stalgiag](https://github.com/stalgiag), [@cgusb](https://github.com/cgusb), [@photon-niko](https://github.com/photon-niko), [@KleoP](https://github.com/KleoP) | [IO](https://github.com/processing/p5.js/tree/main/src/io) | [@limzykenneth](https://github.com/limzykenneth) | -| [Math](https://github.com/processing/p5.js/tree/main/src/math) | [@limzykenneth](https://github.com/limzykenneth), [@jeffawang](https://github.com/jeffawang) | +| [Math](https://github.com/processing/p5.js/tree/main/src/math) | [@limzykenneth](https://github.com/limzykenneth), [@jeffawang](https://github.com/jeffawang), [@AdilRabbani](https://github.com/AdilRabbani) | | [Typography](https://github.com/processing/p5.js/tree/main/src/typography) | [@dhowe](https://github.com/dhowe), [@SarveshLimaye](https://github.com/SarveshLimaye) | | [Utilities](https://github.com/processing/p5.js/tree/main/src/utilities) | [@kungfuchicken](https://github.com/kungfuchicken) | -| [WebGL](https://github.com/processing/p5.js/tree/main/src/webgl) | [@stalgiag](https://github.com/stalgiag); GSoC 2022: [@aceslowman](https://github.com/aceslowman)(Contributor), [@kjhollen](https://github.com/kjhollen)(Mentor); [@ShenpaiSharma](https://github.com/ShenpaiSharma)(Contributor), [@calebfoss](https://github.com/calebfoss)(Mentor); [@davepagurek](https://github.com/davepagurek); [@jeffawang](https://github.com/jeffawang) | +| [WebGL](https://github.com/processing/p5.js/tree/main/src/webgl) | [@stalgiag](https://github.com/stalgiag); GSoC 2022: [@aceslowman](https://github.com/aceslowman)(Contributor), [@kjhollen](https://github.com/kjhollen)(Mentor); [@ShenpaiSharma](https://github.com/ShenpaiSharma)(Contributor), [@calebfoss](https://github.com/calebfoss)(Mentor); [@davepagurek](https://github.com/davepagurek); [@jeffawang](https://github.com/jeffawang); [@AdilRabbani](https://github.com/AdilRabbani) | | Build Process/Unit Testing | [@outofambit](https://github.com/outofambit), [@kungfuchicken](https://github.com/kungfuchicken) | -| Localization Tools | [@outofambit](https://github.com/outofambit) | -| Friendly Errors | [@outofambit](https://github.com/outofambit) | +| Localization Tools | [@outofambit](https://github.com/outofambit), [@almchung](https://github.com/almchung) | +| Friendly Errors | [@outofambit](https://github.com/outofambit), [@almchung](https://github.com/almchung) | | [Contributor Docs](https://github.com/processing/p5.js/tree/main/contributor_docs) | [SoD 2022](https://github.com/processing/p5.js/wiki/Season-of-Docs-2022-Organization-Application---p5.js): [@limzykenneth](https://github.com/limzykenneth) | ## Contributors From 43baa4838f6b961f370d1bd305f163610e60ce3a Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Thu, 14 Jul 2022 16:32:38 -0700 Subject: [PATCH 119/131] Add more stewards --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c32035a5b4..5ab476b575 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Anyone interested can volunteer to be a steward! There are no specific requireme | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | | Overall | [@qianqianye](https://github.com/qianqianye) | | [Accessibility](https://github.com/processing/p5.js/tree/main/src/accessibility) | [@kungfuchicken](https://github.com/kungfuchicken) | -| [Color](https://github.com/processing/p5.js/tree/main/src/color) | [@KleoP](https://github.com/KleoP), [@murilopolese](https://github.com/murilopolese) | +| [Color](https://github.com/processing/p5.js/tree/main/src/color) | [@KleoP](https://github.com/KleoP), [@murilopolese](https://github.com/murilopolese), [@aahdee](https://github.com/aahdee) | | [Core](https://github.com/processing/p5.js/tree/main/src/core)/Environment/Rendering | [@limzykenneth](https://github.com/limzykenneth), [@davepagurek](https://github.com/davepagurek), [@jeffawang](https://github.com/jeffawang) | | [Data](https://github.com/processing/p5.js/tree/main/src/data) | [@kungfuchicken](https://github.com/kungfuchicken) | | [DOM](https://github.com/processing/p5.js/tree/main/src/dom) | [@outofambit](https://github.com/outofambit), [@SarveshLimaye](https://github.com/SarveshLimaye) | From fdead358243be016b5b7940f9f1112cbf24ecda8 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Jul 2022 05:50:31 +0000 Subject: [PATCH 120/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5ab476b575..75b176270c 100644 --- a/README.md +++ b/README.md @@ -572,6 +572,7 @@ We recognize all types of contributions. This project follows the [all-contribut
Seb Méndez

🌍
Ryuya

🐛 👀 💻
LEMIBANDDEXARI

🌍 +
Vivek Tiwari

🌍 From 9e05f0894f839313f14745802ee76effd83f2f69 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Jul 2022 05:50:32 +0000 Subject: [PATCH 121/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 09ef0e4b8a..f9314486de 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3130,6 +3130,15 @@ "contributions": [ "translation" ] + }, + { + "login": "probablyvivek", + "name": "Vivek Tiwari", + "avatar_url": "https://avatars.githubusercontent.com/u/25459353?v=4", + "profile": "https://linktr.ee/probablyvivek", + "contributions": [ + "translation" + ] } ], "repoType": "github", From ba661dce0465c2842d38752d097701f5762e88b5 Mon Sep 17 00:00:00 2001 From: limzykenneth Date: Sat, 16 Jul 2022 15:05:17 +0800 Subject: [PATCH 122/131] Fix noSmooth printing message when used with a non WebGL graphics --- src/core/shape/attributes.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/shape/attributes.js b/src/core/shape/attributes.js index bf23b9c58e..84d6158bd3 100644 --- a/src/core/shape/attributes.js +++ b/src/core/shape/attributes.js @@ -103,11 +103,12 @@ p5.prototype.ellipseMode = function(m) { * 2 pixelated 36×36 white ellipses to left & right of center, black background */ p5.prototype.noSmooth = function() { - this.setAttributes('antialias', false); if (!this._renderer.isP3D) { if ('imageSmoothingEnabled' in this.drawingContext) { this.drawingContext.imageSmoothingEnabled = false; } + } else { + this.setAttributes('antialias', false); } return this; }; From f1a15189cca64a395e6baf0c8849658b2cea9ceb Mon Sep 17 00:00:00 2001 From: KevinGrajeda Date: Sat, 16 Jul 2022 22:32:07 -0500 Subject: [PATCH 123/131] chainable removed in angleMode --- src/math/trigonometry.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/math/trigonometry.js b/src/math/trigonometry.js index 979189d9f3..536d1d575d 100644 --- a/src/math/trigonometry.js +++ b/src/math/trigonometry.js @@ -284,7 +284,6 @@ p5.prototype.radians = angle => angle * constants.DEG_TO_RAD; * Calling angleMode() with no arguments returns current anglemode. * @method angleMode * @param {Constant} mode either RADIANS or DEGREES - * @chainable * @example *
* @@ -318,7 +317,6 @@ p5.prototype.angleMode = function(mode) { } else if (mode === constants.DEGREES || mode === constants.RADIANS) { this._angleMode = mode; } - return this; }; /** From 71a9165c7e0a3e30a0f9a0333b62e8bb855bcf32 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 17 Jul 2022 18:31:17 +0000 Subject: [PATCH 124/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 75b176270c..5aa27edab9 100644 --- a/README.md +++ b/README.md @@ -573,6 +573,7 @@ We recognize all types of contributions. This project follows the [all-contribut
Ryuya

🐛 👀 💻
LEMIBANDDEXARI

🌍
Vivek Tiwari

🌍 +
Kevin Grajeda

💻 From 67f371c27ea637317b2be8da6755963ad77e2c42 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 17 Jul 2022 18:31:18 +0000 Subject: [PATCH 125/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index f9314486de..8513335ced 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3139,6 +3139,15 @@ "contributions": [ "translation" ] + }, + { + "login": "KevinGrajeda", + "name": "Kevin Grajeda", + "avatar_url": "https://avatars.githubusercontent.com/u/60023139?v=4", + "profile": "https://github.com/KevinGrajeda", + "contributions": [ + "code" + ] } ], "repoType": "github", From 911d768db8a1deff8b83a35e2b55cc4bd176991a Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 20 Jul 2022 18:51:45 +0000 Subject: [PATCH 126/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5aa27edab9..4f8f8df5de 100644 --- a/README.md +++ b/README.md @@ -574,6 +574,7 @@ We recognize all types of contributions. This project follows the [all-contribut
LEMIBANDDEXARI

🌍
Vivek Tiwari

🌍
Kevin Grajeda

💻 +
anniezhengg

💻 🎨 From db846689281de2da9e68a12ddcf437611bc7ac94 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 20 Jul 2022 18:51:46 +0000 Subject: [PATCH 127/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 8513335ced..659b5be376 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3148,6 +3148,16 @@ "contributions": [ "code" ] + }, + { + "login": "anniezhengg", + "name": "anniezhengg", + "avatar_url": "https://avatars.githubusercontent.com/u/78184655?v=4", + "profile": "https://github.com/anniezhengg", + "contributions": [ + "code", + "design" + ] } ], "repoType": "github", From 781098a25fc5926f9dc4c56a917322a862e02de7 Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Wed, 20 Jul 2022 12:33:48 -0700 Subject: [PATCH 128/131] Add more stewards --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f8f8df5de..164461c3ca 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Anyone interested can volunteer to be a steward! There are no specific requireme | [Color](https://github.com/processing/p5.js/tree/main/src/color) | [@KleoP](https://github.com/KleoP), [@murilopolese](https://github.com/murilopolese), [@aahdee](https://github.com/aahdee) | | [Core](https://github.com/processing/p5.js/tree/main/src/core)/Environment/Rendering | [@limzykenneth](https://github.com/limzykenneth), [@davepagurek](https://github.com/davepagurek), [@jeffawang](https://github.com/jeffawang) | | [Data](https://github.com/processing/p5.js/tree/main/src/data) | [@kungfuchicken](https://github.com/kungfuchicken) | -| [DOM](https://github.com/processing/p5.js/tree/main/src/dom) | [@outofambit](https://github.com/outofambit), [@SarveshLimaye](https://github.com/SarveshLimaye) | +| [DOM](https://github.com/processing/p5.js/tree/main/src/dom) | [@outofambit](https://github.com/outofambit), [@SarveshLimaye](https://github.com/SarveshLimaye), [@SamirDhoke](https://github.com/SamirDhoke) | | [Events](https://github.com/processing/p5.js/tree/main/src/events) | [@limzykenneth](https://github.com/limzykenneth) | | [Image](https://github.com/processing/p5.js/tree/main/src/image) | [@stalgiag](https://github.com/stalgiag), [@cgusb](https://github.com/cgusb), [@photon-niko](https://github.com/photon-niko), [@KleoP](https://github.com/KleoP) | [IO](https://github.com/processing/p5.js/tree/main/src/io) | [@limzykenneth](https://github.com/limzykenneth) | From d2491d90bf3981fc4b7399007c6d433105c6e4fd Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 21 Jul 2022 02:00:17 +0000 Subject: [PATCH 129/131] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 164461c3ca..84f5fec034 100644 --- a/README.md +++ b/README.md @@ -575,6 +575,7 @@ We recognize all types of contributions. This project follows the [all-contribut
Vivek Tiwari

🌍
Kevin Grajeda

💻
anniezhengg

💻 🎨 +
Seung-Gi Kim(David)

🌍 From 1b65b3bb22eb3e49b1f201ed7540c87c34d9b03e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 21 Jul 2022 02:00:18 +0000 Subject: [PATCH 130/131] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 659b5be376..c8f6e2869a 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3158,6 +3158,15 @@ "code", "design" ] + }, + { + "login": "SNP0301", + "name": "Seung-Gi Kim(David)", + "avatar_url": "https://avatars.githubusercontent.com/u/68281918?v=4", + "profile": "https://github.com/SNP0301", + "contributions": [ + "translation" + ] } ], "repoType": "github", From 9cd186349cdb55c5faf28befff9c0d4a390e02ed Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Thu, 21 Jul 2022 15:40:18 -0700 Subject: [PATCH 131/131] 1.4.2 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index ffff484561..fec35c0586 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "p5", - "version": "1.4.1", + "version": "1.4.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 76acf7cb9b..4c4cba9eb6 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "node --require @babel/register ./utils/sample-linter.js" ] }, - "version": "1.4.1", + "version": "1.4.2", "devDependencies": { "@babel/core": "^7.7.7", "@babel/preset-env": "^7.10.2",