Jump to content

Processing.js: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
Tag: Redirect target changed
 
(112 intermediate revisions by 62 users not shown)
Line 1: Line 1:
#REDIRECT [[Processing#Processing.js]]
{{Infobox software
| name = Processing.js
| logo =
| author = [[John Resig]]
| developer = Processing.js team
| released = {{initial release|2008}}
| latest release version = 1.3.0
| latest release date = {{release date|2011|8|24}}
| latest preview version =
| latest preview date =
| programming language = [[JavaScript]]
| status = Active
| genre = [[Web application framework]]
| license = [[MIT License|MIT]]
| website = http://processingjs.org/
| size = {{Nowrap|61 [[Kilobyte|KB]] (gzipped)}} / {{Nowrap|209 KB (production)}} / {{Nowrap|754 KB (development)}}
}}
'''Processing.js''' is a [[JavaScript]] port of [[Processing (programming language)|Processing]], a programming language designed to write visualizations, images, and interactive content. It allows web browsers to display animations, visual applications, games and other graphical rich content without the need for a [[Java Applet]] or [[Flash plugin]].


{{r from merge}}
Processing.js uses JavaScript to render 2D and 3D content on the HTML [[canvas element]], and is supported by browsers that have implemented this element (Currently the latest versions of Mozilla [[Firefox]], [[Opera (web browser)|Opera]], [[IE9]], [[Safari (web browser)|Safari]] and [[Google Chrome]]).
{{r to section}}

The development of Processing.js was picked-up by students at [[Seneca College]] after its initial release on 2008. A team of students finished the port of Processing.js, fixing more than 900 bugs, shipping 12 releases, and creating a vibrant community in the process. The project was done through a partnership between the [[Mozilla Foundation]] and [[Seneca College]], led by David Humphrey, Al MacDonald, and Corban Brook. The students continue to maintain the project today.

==Use==
The Processing.js syntax is almost identical to that of the Processing language, a <code>setup()</code> function is used to define general visualization properties like canvas size, frame rate and other variables, and the <code>draw()</code> function controls the behavior of each frame in the animation.

The Processing.js library can be included in the head section of a web page as a single JavaScript file:
<source lang="html4strict">
<html>
<head>
<script type="text/javascript" src="processing.js"></script>
</head>
</source>

A <code>canvas</code> element is declared inside the body, with a <code>data-processing-sources</code> attribute, specifying the location of an external file holding the Processing code:

<source lang="xml">
<canvas data-processing-sources="example.pde"></canvas>
</source>

Any extension can be used in the external file, for example the .pde extension used by the Processing language sketch files.

<source lang="javascript">
/* example.pde */

// The statements in the setup() function
// execute once when the program begins
void setup()
{
size(200, 200); // Sets the canvas size to 200 by 200 pixels
stroke(255); // Set line drawing color to monochrome white
frameRate(30); // Set up draw() to be called 30 times per second
}

float y = 100;

// The statements in draw() are executed until the
// program is stopped. The function is called as many
// times per second as the frameRate. If no explicit
// rate is set, this is 45 times per second.
void draw()
{
background(0); // Set the background to monochrome black
y = y - 1;
if (y < 0) { y = height; }
line(0, y, width, y); // draw a horizontal line at height y
}
</source>

==References==
{{Refbegin}}
*{{citation
| first1 = Andrew
| last1 = Glassner
| title = Processing for Visual Artists: How to Create Expressive Images and Interactive Art
| date = August 9, 2010
| edition = 1st
| publisher = A K Peters/CRC Press
| pages = 955
| isbn = 1568817169
| url = http://www.crcpress.com/ecommerce_product/product_detail.jsf?isbn=9781568817163
}}
*{{citation
| first1 = Casey
| last1 = Reas
| first2 = Ben
| last2 = Fry
| title = Getting Started with Processing
| date = June 17, 2010
| edition = 1st
| publisher = Make
| pages = 208
| isbn = 144937980X
| url =
}}
*{{citation
| first = Joshua
| last = Noble
| title = Programming Interactivity: A Designer's Guide to Processing, Arduino, and Openframeworks
| date = July 21, 2009
| edition = 1st
| publisher = [[O'Reilly Media]]
| pages = 736
| isbn = 0596154143
| url = http://oreilly.com/catalog/9780596154141/
}}
*{{citation
| first = Kostas
| last = Terzidis
| title = Algorithms for Visual Design Using the Processing Language
| date = May 11, 2009
| edition = 1st
| publisher = [[John Wiley & Sons|Wiley]]
| pages = 384
| isbn = 0470375485
| url = http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470375485.html
}}
*{{citation
| first1 = Casey
| last1 = Reas
| first2 = Ben
| last2 = Fry
| first3 = John
| last3 = Maeda
| title = Processing: A Programming Handbook for Visual Designers and Artists
| date = September 30, 2007
| edition = 1st
| publisher = The MIT Press
| pages = 736
| isbn = 0262182629
| url = http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=11251
}}
*{{citation
| first = Ben
| last = Fry
| title = Visualizing Data
| date = January 11, 2008
| edition = 1st
| publisher = [[O'Reilly Media]]
| pages = 382
| isbn = 0596514557
| url = http://oreilly.com/catalog/9780596514556/
}}
*{{citation
| first = Ira
| last = Greenberg
| title = Processing: Creative Coding and Computational Art (Foundation)
| date = May 28, 2007
| edition = 1st
| publisher = friends of ED
| pages = 840
| isbn = 159059617X
| url = http://friendsofed.com/book.html?isbn=159059617X
}}
*{{citation
| first = Daniel
| last = Shiffman
| title = Learning Processing: A Beginner's Guide to Programming Images, Animation, and Interaction
| date = August 19, 2008
| edition = 1st
| publisher = Morgan Kaufmann
| pages = 450
| isbn = 0123736021
| url = http://www.learningprocessing.com/
}}
{{Refend}}

==External links==
* [http://processingjs.org/ Official Website]
* [http://wiki.mozilla.org/Education/Projects/ProcessingForTheWeb Processing for the Web (POW) project]

[[Category:Free development toolkits and libraries]]
[[Category:JavaScript libraries]]

[[fr:Processing.js]]

Latest revision as of 23:58, 22 September 2022

  • From a merge: This is a redirect from a page that was merged into another page. This redirect was kept in order to preserve the edit history of this page after its content was merged into the content of the target page. Please do not remove the tag that generates this text (unless the need to recreate content on this page has been demonstrated) or delete this page.