# ctx-render-polyline

> render line segments using html5 2d canvas

Latest version **1.0.2** (published 2015-10-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install ctx-render-polyline
pnpm add ctx-render-polyline
yarn add ctx-render-polyline
bun add ctx-render-polyline
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2015-10-06 |
| First published | 2015-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Elijah Insua |
| Maintainers | tmpvar |
| Keywords | canvas, 2d, ctx, CanvasRenderingContext2D, segments, polyline |

## Links

- npm: https://www.npmjs.com/package/ctx-render-polyline
- Repository: https://github.com/tmpvar/ctx-render-polyline
- Issues: https://github.com/tmpvar/ctx-render-polyline/issues
- npm.io page: https://npm.io/package/ctx-render-polyline

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2015-10-06
- 1.0.1 — 2015-04-19
- 1.0.0 — 2015-04-19

## README

# ctx-render-polyline

render line segments using html5 2d canvas

## install

`npm install ctx-render-polyline`

## use

```javascript
var center = require('ctx-translate-center');
var poly = require('./ctx-render-polyline')
var ctx = document.createElement('canvas').getContext('2d');

document.body.appendChild(ctx.canvas);

ctx.fillStyle = "black";
ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);

center(ctx);

ctx.beginPath();

  // wound CCW
  poly(ctx, [
    [-50, -50],
    [-50, 50],
    [50, 50],
  ]);

  // wound CW
  poly(ctx, [
    [-20, -20],
    [20, 20],
    [-20, 20],
  ]);

  ctx.fillStyle = "orange";
  ctx.fill()
```

results in ![ctx-render-polyline](http://i.imgur.com/JW66SGr.png)

## license

[MIT](LICENSE.txt)

---
_Source: https://npm.io/package/ctx-render-polyline · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
