Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan committed May 15, 2017
1 parent 512b5db commit 4d6ccca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,25 @@ Every 'Object' provided by **ncc** (and also every return value of a method) is
<img src="https://raw.githubusercontent.com/indus/ncc/master/footage/flow.png" alt="flowchart"/>
</p>
The **Canvas-** RenderingContext2D, -Gradient and -Pattern Proxys are fully implemented.
The **HTML-** CanvasElement and -ImageElement Proxys only have properties and functions that are necessary. For example they both implement a 'width' and 'height' attribute but have no further DOM functionality.
The **HTML-** CanvasElement and -ImageElement Proxys only necessary properties and functions. For example they both implement a 'width' and 'height' attribute but don´t have further DOM functionality.

Methods and properties beyond the native API are marked with a leading underscore and hidden from console by default (e.g. 'image._toFile(fileName, &lt;callback&gt;)' to write a image to the filesystem).
Methods and properties beyond the native API are marked with a leading underscore and they are hidden from console by default (e.g. 'image._toFile(fileName, &lt;callback&gt;)' to write an image to the filesystem).

#### proxy - creators

* **ncc(** &lt;options&gt; **,** &lt;callback&gt; **)** >>> **[canvas]**
**ncc(** &lt;callback&gt; **)** >>> **[canvas]**

options (with defaults)
```javascript
{ logLevel: 'info', //['log','info','warn','error']
port: 9222,
retry: 9,
retryDelay: 500,
headless: false
}
```

* **ncc.createCanvas()** >>> **[canvas]** *if one is not enough*

* **ncc.createImage(** &lt;src&gt; **,** &lt;onloadFn&gt; **,** &lt;onerrorFn&gt; **)** >>> **[image]**
Expand All @@ -77,12 +87,3 @@ Methods and properties beyond the native API are marked with a leading underscor
**context2d.createRadialGradient(** *[nativeAPI](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D#createRadialGradient())* **)** >>> **[radialGradient]**
**context2d.createPattern(** *[nativeAPI](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D#createPattern())* **)** >>> **[pattern]**

#### options (with defaults)
```javascript
{ logLevel: 'info', //['log','info','warn','error']
port: 9222,
retry: 9,
retryDelay: 500,
headless: false
}
```
14 changes: 7 additions & 7 deletions examples/1_draw_ncc_logo.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ ncc({ logLevel: 'log' }, function (err, canvas) {
ctx.lineTo(253, 70);
ctx.lineTo(253, 105.7);
ctx.lineTo(244.1, 105.7);
ctx.bezierCurveTo(231.79999999999998, 105.7, 221.79999999999998, 115.7, 221.79999999999998, 128);
ctx.bezierCurveTo(221.79999999999998, 140.3, 231.79999999999998, 150.3, 244.1, 150.3);
ctx.bezierCurveTo(231.8, 105.7, 221.8, 115.7, 221.8, 128);
ctx.bezierCurveTo(221.8, 140.3, 231.8, 150.3, 244.1, 150.3);
ctx.lineTo(253, 150.3);
ctx.lineTo(253, 186);
ctx.closePath();
Expand All @@ -50,22 +50,22 @@ ncc({ logLevel: 'log' }, function (err, canvas) {
ctx.lineTo(244.1, 3);
ctx.bezierCurveTo(202.6, 3, 165.8, 23.3, 143, 54.5);
ctx.bezierCurveTo(134.4, 24.8, 106.9, 3, 74.4, 3);
ctx.bezierCurveTo(61.400000000000006, 3, 49.2, 6.5, 38.7, 12.6);
ctx.bezierCurveTo(61.4, 3, 49.2, 6.5, 38.7, 12.6);
ctx.lineTo(38.7, 3);
ctx.lineTo(3, 3);
ctx.lineTo(3, 235.1);
ctx.lineTo(38.7, 235.1);
ctx.lineTo(38.7, 74.4);
ctx.bezierCurveTo(38.7, 54.7, 54.7, 38.7, 74.4, 38.7);
ctx.bezierCurveTo(94.10000000000001, 38.7, 110.10000000000001, 54.7, 110.10000000000001, 74.4);
ctx.lineTo(110.10000000000001, 253);
ctx.bezierCurveTo(94.1, 38.7, 110.1, 54.7, 110.1, 74.4);
ctx.lineTo(110.1, 253);
ctx.lineTo(145.8, 253);
ctx.lineTo(145.8, 205.2);
ctx.bezierCurveTo(168.70000000000002, 234.29999999999998, 204.20000000000002, 253, 244, 253);
ctx.bezierCurveTo(168.7, 234.3, 204.2, 253, 244, 253);
ctx.lineTo(252.9, 253);
ctx.lineTo(252.9, 217.3);
ctx.lineTo(244, 217.3);
ctx.bezierCurveTo(194.8, 217.3, 154.7, 177.20000000000002, 154.7, 128);
ctx.bezierCurveTo(194.8, 217.3, 154.7, 177.2, 154.7, 128);
ctx.bezierCurveTo(154.8, 78.8, 194.8, 38.7, 244.1, 38.7);
ctx.closePath();
ctx.fill();
Expand Down

0 comments on commit 4d6ccca

Please sign in to comment.