<
PrototypeJungle
>

Conventions

Types

In these documents, I will use the notation exemplified below to indicate the types of functions or methods:

nd.set(name:string,shp:shape) => shape

This means that the first argument to the method nd.set is meant to be a string, and the second a shape, and that the output is a shape. The variable names nm and shp serve only as a way to reference the arguments in subsequent text, and have no other significance. The types string and shape are not formal, but rather informal names of kinds of JavaScript values. Of course JavaScript is not a statically typed language, so you will see things like

nd.set('a',shp);

in code, but never the types.

Some methods take as input an object whose properties contain the parameters to the function. The form of the expected parameter object is indicated in the following way:

addRectangle({width:number,height:number,stroke_width:number,position:Point=Point(0,0),stroke:color='white',fill:color='Transparent'})

If an "=" appears, this indicates that the parameter is optional, and gives its default value.

User-Defined Methods

In each of the image generation modules, many methods will be defined by the module, but some need to be defined by the user. For example, in the grid module, generateGrid is defined by the module, but shapeGenerator should be defined by the user. The latter sort of method will appear in red.

Top-level Image Generation Functions

In each case, the top-level generation functions are named generate<Whatever>, for example, generateGrid, generateWeb, and generateDrop.