Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions contributor_docs/ko/method.example.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* "이것은 메소드의 인라인 문서 템플릿입니다. 이 템플릿을 사용하려면 큰 따옴표
* "이것은 메소드의 인라인 문서 템플릿입니다. 이 템플릿을 사용하려면 큰 따옴표
* 사이의 모든 텍스트를 제거하십시오. 메소드에 대한 일부 설명은 여기에 들어갑니다.
* 간단한 단어로 함수가 하는 일과 그에 대한 좋은/나쁜 사용 예를 설명하십시오.
* 만약 비정상적인 케이스나 경고가 있다면 여기에서 설명해 주세요."
Expand Down Expand Up @@ -31,7 +31,7 @@
* "두 번째 예시를 명확히 설명하는 줄입니다"
*/

// "메소드에 둘 이상의 특징이 있으면, 각 특징은 다음과 같은 파라미터 설명과 함께
// "메소드에 둘 이상의 특징이 있으면, 각 특징은 다음과 같은 파라미터 설명과 함께
// 자체 블록에 문서화할 수 있습니다."
/**
* @method "메소드명"
Expand All @@ -46,11 +46,11 @@ p5.prototype.methodName = function() {

// 이 부분은 템플릿을 채운 예시입니다.
/**
* <a href="#/p5/background">background()</a> 함수는 p5.js 캔버스의 배경 색상을
* 설정합니다. 이 함수는 일반적으로 draw()에서 각 프레임의 시작 부분에 디스플레이
* 윈도우를 지우는 데 사용되지만, 애니메이션의 첫 번째 프레임에 배경색을 설정하거나
* <a href="#/p5/background">background()</a> 함수는 p5.js 캔버스의 배경 색상을
* 설정합니다. 이 함수는 일반적으로 draw()에서 각 프레임의 시작 부분에 디스플레이
* 윈도우를 지우는 데 사용되지만, 애니메이션의 첫 번째 프레임에 배경색을 설정하거나
* 배경을 한 번만 설정해야 할 경우 setup() 내에서 사용할 수 있습니다.
*
*
* 배경색 기본 설정은 투명입니다.
*
* @method background
Expand Down Expand Up @@ -81,7 +81,7 @@ p5.prototype.methodName = function() {
/**
* @method background
* @param {String} 문자열 형태의 색상 설정에 사용할 수 있는 형식:
정수, rgb(), rgba(), rgb() 비율, rgba() 비율,
정수, rgb(), rgba(), rgb() 비율, rgba() 비율,
3자리 16진법, 6자리 16진법,
* @param {Number} [a]
* @chainable
Expand Down
2 changes: 1 addition & 1 deletion contributor_docs/project_wrapups/slominski_gsoc_2022.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ The tutorials can be found on the p5.js websites Learn section here (to be added

And the code and commits for these contributions can be found at (to be added):

##Acknowledgements
## Acknowledgements

I want to express my gratitude towards my mentor Kate Hollenbach for her guidance throughout this project, as well as towards the p5.js community for its openness and helpfulness.
4 changes: 4 additions & 0 deletions docs/parameterData.json
Original file line number Diff line number Diff line change
Expand Up @@ -4655,6 +4655,10 @@
},
"modify": {
"overloads": [
[
"Function",
"Object?"
],
[
"Object?"
]
Expand Down
4 changes: 2 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const commonRules = {
'@stylistic/max-len': [
warn,
{
code: 80,
code: 120,
ignoreComments: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
Expand Down Expand Up @@ -272,4 +272,4 @@ export default defineConfig([
// * contributor_docs/zh-Hans/unit_testing.md 35:1 error Parsing error: Unexpected token
// * rfc_p5js_2.md 205:50 error Parsing error: Binding arguments in strict mode
// ...markdown.configs.processor
]);
]);
73 changes: 57 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,62 @@
"license": "LGPL-2.1",
"browser": "./lib/p5.min.js",
"exports": {
".": "./dist/app.js",
"./core": "./dist/core/main.js",
"./shape": "./dist/shape/index.js",
"./accessibility": "./dist/accessibility/index.js",
"./friendlyErrors": "./dist/core/friendlyErrors/index.js",
"./data": "./dist/data/index.js",
"./dom": "./dist/dom/index.js",
"./events": "./dist/events/index.js",
"./image": "./dist/image/index.js",
"./io": "./dist/io/index.js",
"./math": "./dist/math/index.js",
"./utilities": "./dist/utilities/index.js",
"./webgl": "./dist/webgl/index.js",
"./type": "./dist/type/index.js"
".": {
"default": "./dist/app.js",
"types": "./types/p5.d.ts"
},
"./core": {
"default": "./dist/core/main.js",
"types": "./types/core/main.d.ts"
},
"./shape": {
"default": "./dist/shape/index.js",
"types": "./types/shape/index.d.ts"
},
"./accessibility": {
"default": "./dist/accessibility/index.js",
"types": "./types/accessibility/index.d.ts"
},
"./friendly_errors": {
"default": "./dist/core/friendly_errors/index.js",
"types": "./types/core/friendly_errors/index.d.ts"
},
"./data": {
"default": "./dist/data/index.js",
"types": "./types/data/index.d.ts"
},
"./dom": {
"default": "./dist/dom/index.js",
"types": "./types/dom/index.d.ts"
},
"./events": {
"default": "./dist/events/index.js",
"types": "./types/events/index.d.ts"
},
"./image": {
"default": "./dist/image/index.js",
"types": "./types/image/index.d.ts"
},
"./io": {
"default": "./dist/io/index.js",
"types": "./types/io/index.d.ts"
},
"./math": {
"default": "./dist/math/index.js",
"types": "./types/math/index.d.ts"
},
"./utilities": {
"default": "./dist/utilities/index.js",
"types": "./types/utilities/index.d.ts"
},
"./webgl": {
"default": "./dist/webgl/index.js",
"types": "./types/webgl/index.d.ts"
},
"./type": {
"default": "./dist/type/index.js",
"types": "./types/type/index.d.ts"
}
},
"files": [
"dist/**",
Expand Down Expand Up @@ -111,6 +153,5 @@
"workerDirectory": [
"test"
]
},
"types": "./types/p5.d.ts"
}
}
6 changes: 3 additions & 3 deletions src/color/p5.Color.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import {
ColorSpace,
to,
toGamut,

Check warning on line 14 in src/color/p5.Color.js

View workflow job for this annotation

GitHub Actions / lint

'toGamut' is defined but never used
serialize,
parse,
range,
Expand All @@ -37,7 +37,7 @@
result = Math.min(result, Math.max(start2, stop2));
}
return result;
}
};

const serializationMap = {};

Expand Down Expand Up @@ -102,7 +102,7 @@
});
this.mode = mode;
this._color = to(this._color, this._color.spaceId);
}catch(err){

Check warning on line 105 in src/color/p5.Color.js

View workflow job for this annotation

GitHub Actions / lint

'err' is defined but never used
// TODO: Invalid color string
throw new Error('Invalid color string');
}
Expand Down Expand Up @@ -547,11 +547,11 @@
let coords = structuredClone(to(this._color, 'srgb').coords);
coords.push(this._color.alpha);

const rangeMaxes = maxes.map((v) => {
const rangeMaxes = maxes.map(v => {
if(!Array.isArray(v)){
return [0, v];
}else{
return v
return v;
}
});

Expand Down
2 changes: 1 addition & 1 deletion src/core/friendly_errors/sketch_verifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const ignoreFunction = [
'keyPressed',
'keyReleased',
'keyTyped',
'windowResized',
'windowResized'
// 'name',
// 'parent',
// 'toString',
Expand Down
6 changes: 3 additions & 3 deletions src/image/filterRenderer2D.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ class FilterRenderer2D {


const identityMatrix = [1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1];
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1];
this._shader.setUniform('uModelViewMatrix', identityMatrix);
this._shader.setUniform('uProjectionMatrix', identityMatrix);

Expand Down
38 changes: 19 additions & 19 deletions src/shape/curves.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,22 +517,22 @@ function curves(p5, fn){
* function setup() {
* createCanvas(200, 200);
* background(245);
*
*
* // Ensure the curve includes both end spans p0->p1 and p2->p3
* splineProperty('ends', INCLUDE);
*
*
* // Control / anchor points
* const p0 = createVector(30, 160);
* const p1 = createVector(60, 40);
* const p2 = createVector(140, 40);
* const p3 = createVector(170, 160);
*
*
* // Draw the spline that passes through ALL four points (INCLUDE)
* noFill();
* stroke(0);
* strokeWeight(2);
* spline(p0.x, p0.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y);
*
*
* // Draw markers + labels
* fill(255);
* stroke(0);
Expand All @@ -541,19 +541,19 @@ function curves(p5, fn){
* circle(p1.x, p1.y, r);
* circle(p2.x, p2.y, r);
* circle(p3.x, p3.y, r);
*
*
* noStroke();
* fill(0);
* text('p0', p0.x - 14, p0.y + 14);
* text('p1', p1.x - 14, p1.y - 8);
* text('p2', p2.x + 4, p2.y - 8);
* text('p3', p3.x + 4, p3.y + 14);
*
*
* describe('A black Catmull-Rom spline passes through p0, p1, p2, p3 with endpoints included.');
* }
* </code>
* </div>
*
*
* <div>
* <code>
* function setup() {
Expand Down Expand Up @@ -848,45 +848,45 @@ function curves(p5, fn){
* }
* </code>
* </div>
*
*
* <div>
* <code>
* let p0, p1, p2, p3;
*
*
* function setup() {
* createCanvas(200, 200);
* splineProperty('ends', INCLUDE); // make endpoints part of the curve
*
*
* // Four points forming a gentle arch
* p0 = createVector(30, 160);
* p1 = createVector(60, 50);
* p2 = createVector(140, 50);
* p3 = createVector(170, 160);
*
*
* describe('Black spline through p0–p3. A red dot marks the location at parameter t on p1->p2 using splinePoint.');
* }
*
*
* function draw() {
* background(245);
*
*
* // Draw the spline for context
* noFill();
* stroke(0);
* strokeWeight(2);
* spline(p0.x, p0.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y);
*
*
* // Map mouse X to t in [0, 1] (span p1->p2)
* let t = constrain(map(mouseX, 0, width, 0, 1), 0, 1);
*
*
* // Evaluate the curve point by axis (splinePoint works one axis at a time)
* let x = splinePoint(p0.x, p1.x, p2.x, p3.x, t);
* let y = splinePoint(p0.y, p1.y, p2.y, p3.y, t);
*
*
* // Marker at the evaluated position
* noStroke();
* fill('red');
* circle(x, y, 8);
*
*
* // Draw control/anchor points
* stroke(0);
* strokeWeight(1);
Expand All @@ -896,7 +896,7 @@ function curves(p5, fn){
* circle(p1.x, p1.y, r);
* circle(p2.x, p2.y, r);
* circle(p3.x, p3.y, r);
*
*
* // Labels + UI hint
* noStroke();
* fill(20);
Expand All @@ -909,7 +909,7 @@ function curves(p5, fn){
* }
* </code>
* </div>
*
*
*/

fn.splinePoint = function(a, b, c, d, t) {
Expand Down
Loading
Loading