Skip to content

Commit

Permalink
Merge branch 'main' into improveSpecularColorExample
Browse files Browse the repository at this point in the history
  • Loading branch information
JetStarBlues committed Oct 17, 2021
2 parents 943d68e 42e91b0 commit c77727d
Show file tree
Hide file tree
Showing 53 changed files with 2,280 additions and 2,194 deletions.
92 changes: 92 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -2646,6 2646,98 @@
"contributions": [
"doc"
]
},
{
"login": "osteele",
"name": "Oliver Steele",
"avatar_url": "https://avatars.githubusercontent.com/u/674?v=4",
"profile": "https://code.osteele.com/",
"contributions": [
"doc"
]
},
{
"login": "pearmini",
"name": "MiniPear",
"avatar_url": "https://avatars.githubusercontent.com/u/49330279?v=4",
"profile": "https://github.com/pearmini",
"contributions": [
"doc"
]
},
{
"login": "sflanker",
"name": "Paul Wheeler",
"avatar_url": "https://avatars.githubusercontent.com/u/940246?v=4",
"profile": "http://www.paulwheeler.us/",
"contributions": [
"code"
]
},
{
"login": "Nitin-Rana",
"name": "Nitin Rana",
"avatar_url": "https://avatars.githubusercontent.com/u/58933197?v=4",
"profile": "https://nitin-rana.github.io/nitinrana.github.io/",
"contributions": [
"doc"
]
},
{
"login": "anniemckinnon",
"name": "Annie McKinnon",
"avatar_url": "https://avatars.githubusercontent.com/u/35992537?v=4",
"profile": "https://www.anniemckinnon.com/",
"contributions": [
"bug",
"code"
]
},
{
"login": "jiwonme",
"name": "Jiwon Park (hanpanic)",
"avatar_url": "https://avatars.githubusercontent.com/u/53327429?v=4",
"profile": "http://jiwon.me",
"contributions": [
"code"
]
},
{
"login": "truemaxdh",
"name": "truemaxdh",
"avatar_url": "https://avatars.githubusercontent.com/u/12081386?v=4",
"profile": "https://truemaxdh.github.io/",
"contributions": [
"bug",
"code"
]
},
{
"login": "katiejliu",
"name": "Katie",
"avatar_url": "https://avatars.githubusercontent.com/u/78124298?v=4",
"profile": "https://github.com/katiejliu",
"contributions": [
"code"
]
},
{
"login": "guilhermesilveira",
"name": "Guilherme Silveira",
"avatar_url": "https://avatars.githubusercontent.com/u/51391?v=4",
"profile": "http://www.alura.com.br",
"contributions": [
"doc"
]
},
{
"login": "camilleroux",
"name": "Camille Roux",
"avatar_url": "https://avatars.githubusercontent.com/u/25977?v=4",
"profile": "https://www.camilleroux.com/",
"contributions": [
"code"
]
}
],
"repoType": "github",
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 74,7 @@ Anyone interested can volunteer to be a steward! There are no specific requireme
| Image | stalgiag |
| IO | limzykenneth |
| Math | limzykenneth |
| Typography | dhowe |
| Typography | dhowe |
| Utilities | |
| WebGL | stalgiag |
| Build Process/Unit Testing | outofambit |
Expand Down Expand Up @@ -504,6 504,19 @@ We recognize all types of contributions. This project follows the [all-contribut
<td align="center"><a href="https://github.com/JetStarBlues"><img src="https://avatars.githubusercontent.com/u/4354703?v=4?s=100" width="100px;" alt=""/><br /><sub><b>JetStarBlues</b></sub></a><br /><a href="https://github.com/processing/p5.js/commits?author=JetStarBlues" title="Documentation">📖</a> <a href="https://github.com/processing/p5.js/commits?author=JetStarBlues" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/code4humanity"><img src="https://avatars.githubusercontent.com/u/66260854?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Avelar</b></sub></a><br /><a href="https://github.com/processing/p5.js/commits?author=code4humanity" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://code.osteele.com/"><img src="https://avatars.githubusercontent.com/u/674?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Oliver Steele</b></sub></a><br /><a href="https://github.com/processing/p5.js/commits?author=osteele" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/pearmini"><img src="https://avatars.githubusercontent.com/u/49330279?v=4?s=100" width="100px;" alt=""/><br /><sub><b>MiniPear</b></sub></a><br /><a href="https://github.com/processing/p5.js/commits?author=pearmini" title="Documentation">📖</a></td>
<td align="center"><a href="http://www.paulwheeler.us/"><img src="https://avatars.githubusercontent.com/u/940246?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Paul Wheeler</b></sub></a><br /><a href="https://github.com/processing/p5.js/commits?author=sflanker" title="Code">💻</a></td>
<td align="center"><a href="https://nitin-rana.github.io/nitinrana.github.io/"><img src="https://avatars.githubusercontent.com/u/58933197?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nitin Rana</b></sub></a><br /><a href="https://github.com/processing/p5.js/commits?author=Nitin-Rana" title="Documentation">📖</a></td>
<td align="center"><a href="https://www.anniemckinnon.com/"><img src="https://avatars.githubusercontent.com/u/35992537?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Annie McKinnon</b></sub></a><br /><a href="https://github.com/processing/p5.js/issues?q=author:anniemckinnon" title="Bug reports">🐛</a> <a href="https://github.com/processing/p5.js/commits?author=anniemckinnon" title="Code">💻</a></td>
<td align="center"><a href="http://jiwon.me"><img src="https://avatars.githubusercontent.com/u/53327429?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jiwon Park (hanpanic)</b></sub></a><br /><a href="https://github.com/processing/p5.js/commits?author=jiwonme" title="Code">💻</a></td>
<td align="center"><a href="https://truemaxdh.github.io/"><img src="https://avatars.githubusercontent.com/u/12081386?v=4?s=100" width="100px;" alt=""/><br /><sub><b>truemaxdh</b></sub></a><br /><a href="https://github.com/processing/p5.js/issues?q=author:truemaxdh" title="Bug reports">🐛</a> <a href="https://github.com/processing/p5.js/commits?author=truemaxdh" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/katiejliu"><img src="https://avatars.githubusercontent.com/u/78124298?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Katie</b></sub></a><br /><a href="https://github.com/processing/p5.js/commits?author=katiejliu" title="Code">💻</a></td>
<td align="center"><a href="http://www.alura.com.br"><img src="https://avatars.githubusercontent.com/u/51391?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Guilherme Silveira</b></sub></a><br /><a href="https://github.com/processing/p5.js/commits?author=guilhermesilveira" title="Documentation">📖</a></td>
</tr>
</table>

<!-- markdownlint-restore -->
Expand Down
4 changes: 2 additions & 2 deletions contributor_docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 14,8 @@ 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 [Moira Turner](https://github.com/mcturner1995).
- [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 [Moira Turner](https://github.com/mcturner1995).
- [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.

Expand Down
2 changes: 1 addition & 1 deletion contributor_docs/creating_libraries.md
Original file line number Diff line number Diff line change
@@ -1,4 1,4 @@
A p5.js library can be any JavaScript code that extends or adds to the p5.js core functionality. There are two categories of library. Core libraries (DOM and Sound) are part of the p5.js distribution, while contributed libraries are developed, owned, and maintained by members of the p5.js community.
A p5.js library can be any JavaScript code that extends or adds to the p5.js core functionality. There are two categories of library. Core libraries (p5.Sound) are part of the p5.js distribution, while contributed libraries are developed, owned, and maintained by members of the p5.js community.

If you have created a library and would like to have it included on the [p5js.org/libraries](https://p5js.org/libraries) page, submit [this form](https://docs.google.com/forms/d/e/1FAIpQLSdWWb95cfvosaIFI7msA7XC5zOEVsNruaA5klN1jH95ESJVcw/viewform).

Expand Down
36 changes: 36 additions & 0 deletions contributor_docs/friendly_error_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 27,8 @@ The FES can also help the user differentiate between errors that happen inside t

Please also see inline notes in [src/core/friendly_errors/fes_core.js](https://github.com/processing/p5.js/blob/main/src/core/friendly_errors/fes_core.js) for more technical information.

The FES can detect the declaration of reserved p5.js constants (for eg: PI) and functions (for eg: text) by the user. This operation is performed by `fesCodeReader()` in `sketch_reader.js`. You can have a look at the full code [src/core/friendly_errors/sketch_reader.js](https://github.com/processing/p5.js/blob/main/src/core/friendly_errors/sketch_reader.js)

### `core/friendly_errors/file_errors/friendlyFileLoadError()`:
* This function generates and displays friendly error messages if a file fails to load correctly. It also checks if the size of a file might be too large to load and produces a warning.
* This can be called through : `p5._friendlyFileLoadError(ERROR_TYPE, FILE_PATH)`.
Expand Down Expand Up @@ -137,6 139,36 @@ Please correct it to color if you wish to use the function from p5.js (http://p5
*/
```

### `core/friendly_errors/fes_core/sketch_reader/fesCodeReader()`:
* This function is executed everytime when the `load` event is triggered. It checks if a p5.js reserved constant or function is redefined by the user.

* Redefining p5.js reserved constant
```js
function setup() {
//PI is a p5.js reserved constant
let PI = 100;
}

/*
FES will show:
p5.js says: you have used a p5.js reserved variable "PI" make sure you change the variable name to something else.
(https://p5js.org/reference/#/p5/PI)
*/
```

* Redefining p5.js reserved function
```js
function setup() {
//text is a p5.js reserved function
let text = 100;
}

/*
FES will show:
p5.js says: you have used a p5.js reserved function "text" make sure you change the function name to something else.
*/
```

### `core/friendly_errors/fes_core/checkForUserDefinedFunctions()`:
* Checks if any user defined function (`setup()`, `draw()`, `mouseMoved()`, etc.) has been used with a capitalization mistake
* For example
Expand Down Expand Up @@ -200,6 232,8 @@ line(0, 0, 100, 100, x3, Math.PI);

* The functionality described under **`fesErrorMonitor()`** currently only works on the web editor or if running on a local server. For more details see [this](https://github.com/processing/p5.js/pull/4730).

* The extracting variable/function names feature of FES's `sketch_reader` is not perfect and some cases might go undetected (for eg: when all the code is written in a single line).

## In The Works
* Identify more common error types and generalize with FES (e.g. `bezierVertex()`, `quadraticVertex()` - required object not initiated; checking Number parameters positive for `nf()` `nfc()` `nfp()` `nfs()`)

Expand All @@ -211,6 245,8 @@ line(0, 0, 100, 100, x3, Math.PI);
* All the colors are checked for being color blind friendly.
* More elaborate ascii is always welcome!
* Extend Global Error catching. This means catching errors that the browser is throwing to the console and matching them with friendly messages. `fesErrorMonitor()` does this for a select few kinds of errors but help in supporting more is welcome :)
* Improve `sketch_reader.js`'s code reading and variable/function name extracting functionality (which extracts names of the function and variables declared by the user in their code). For example currently `sketch_reader.js` is not able to extract variable/function names properly if all the code is written in a single line.
* `sketch_reader.js` can be extended and new features (for example: Alerting the user when they have declared a variable in the `draw()` function) can be added to it to better aid the user.


```javascript
Expand Down
10 changes: 10 additions & 0 deletions contributor_docs/project_wrapups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 3,16 @@ This folder contains wrapup reports for projects from p5.js related [Google Summ

*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 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
* [Activism Through Storytelling with Code](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/nikiito_gsoc_2021.md) by Niki Ito, 2021
* [Addon Library Development - p5.teach.js](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/aditya_gsoc_2021.md) by Aditya Siddheshwar, 2021
* [Internationalization(i18n) and Deployment of p5.js website](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/sanjay_singh_rajpoot_gsoc2020.md) by Sanjay Singh Rajpoot, 2021
* [Improving the p5.xr Library Through Artistic Examples](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/anaisgonzalez_gsoc_2021.md) by Anais Gonzalez, 2021
* [Korean Translations and Website Redesign Proposal](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/josephhong_gsoc_2021.md) by [Joseph Hong](github.com/jhongover9500), 2021
* [Improve Test Coverage in p5.Sound library](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/sai_bhushan_gsoc_2021.md) by [Sai Bhushan](https://github.com/satyasaibhushan), 2021

### Google Summer of Code 2020
* [p5.js accessibility and canvas descriptions](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/luismn_gsoc_2020.md) by Luis Morales-Navarro, 2020
* [p5.js Web Editor Mobile UI](https://github.com/processing/p5.js/blob/main/contributor_docs/project_wrapups/ghalestrilo_gsoc_2020.md) by [ghales](https://github.com/ghalestrilo), 2020
Expand Down
55 changes: 55 additions & 0 deletions contributor_docs/project_wrapups/aditya_gsoc_2021.md
Original file line number Diff line number Diff line change
@@ -0,0 1,55 @@

# Addon Library Development - [p5.teach.js](https://github.com/two-ticks/p5.teach.js/)

| **Project** | [Addon Library Development - p5.teach.js](https://summerofcode.withgoogle.com/projects/#4613016500305920) |
| :--- | :--- |
| **Student** | Aditya Siddheshwar |
| **Github** | [@two-ticks](https://github.com/two-ticks) |
| **Organisation** | [Processing Foundation](https://processingfoundation.org/) |
| **Mentors** | [Nick McIntyre](https://github.com/nickmcintyre), [Jithin KS](https://github.com/JithinKS97) |
| **Repo**| https://github.com/two-ticks/p5.teach.js/ |
| **Merged Code** | https://github.com/two-ticks/p5.teach.js/tree/GSoC'21 |


## Overview
During the Google Summer of Code '21, I worked on p5.teach, under the mentorship of **Jithin KS** and **Nick McIntyre**. The goal of this project was to build an addon library for teaching maths through animations and simulations. It will provide users friendly API for creating text, TeX, and shape animations.
The major goals of this project were:
1. Development of animation methods and controls
2. Support for TeX

## Tasks Completed
* Created TeX elements with help of tex-to-svg library (using MathJax)
* Created TeX and text animations using MathJax and anime.js by manipulating p5.js DOM elements and SVG elements
* Wrote play function for animations like write, waveIn, waveOut, fadeIn, fadeOut, createFill, etc. for TeX and text
* Added controls like play, pause, and restart buttons for timeline
* Wrote test cases using Jest
* Included style, add, play, remove, update, fill, stroke, strokeWeight, position, and size methods for MObjects
* Included SVG plotting methods and animations
* Developed demo sketches and posted on Instagram, Processing Forum, and Twitter

## TODO
- [ ] Write unit-tests
- [ ] Refactor animations
- [ ] Export animations

## Challenges
* TDD is important and is one of the most preferred best practices; however, it was quite challenging to develop test cases considering the lack of documentation involving Jest with p5.js and keep progressing under GSoC time constraints.
* Adding animations to TeX with help of SVGs required a lot of effort and research. I learned a lot about SVGs and TypeScript from articles and tutorials while solving this problem.
* GObjects (Geometry Objects) required a lot of digging and discussion to figure out API and apply configurations to the plots.

## PRs
* https://github.com/two-ticks/p5.teach.js/pull/13
* https://github.com/two-ticks/p5.teach.js/pull/6
* https://github.com/two-ticks/p5.teach.js/pull/20

## Contribution & Next Steps
p5.teach is having text, TeX, and Shapes, I will refactor and fix bugs in animation. Before hosting it on the cloud, I will coordinate with mentors to ensure the library meets the coding standards and includes sufficient documentation. I will further improve the library by adding new features and adding more to the existing features.

## Conclusion and Acknowledgements
I really had a lot of fun working on this project and learned a lot of things this summer working with my mentors and Processing Community.
I would like to thank my mentors **Jithin KS** and **Nick McIntyre** for their invaluable help and guidance throughout this summer of code. Their love for teaching, code, and STEM inspired me to do more work on the library. Nick pushed me in the right direction for API, and Jithin always emphasized best practices and standards. I am extremely grateful to the Processing community for having me in the team (family).

## Useful Links
* [API Reference](https://github.com/two-ticks/p5.teach.js/blob/GSoC'21/api_reference.md)
* [Animating maths in p5.js](https://discourse.processing.org/t/animating-maths-in-p5-js/31583)
* [Discussion and Review of Proposal - Addon Library Development - p5-teach.js](https://discourse.processing.org/t/discussion-and-review-of-proposal-addon-library-development-p5-teach-js/29065)
Loading

0 comments on commit c77727d

Please sign in to comment.