# canvax

> A javascript canvas 2d rendering engine

Latest version **2.0.91** (published 2025-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install canvax
pnpm add canvax
yarn add canvax
bun add canvax
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.0.91 |
| Published | 2025-11-19 |
| First published | 2017-07-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 744 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | nickli |
| Maintainers | canvax |
| Keywords | 2d, canvas, webgl, Cross-platform, Cross-terminal |

## Links

- npm: https://www.npmjs.com/package/canvax
- Repository: git
- Homepage: http://canvax.org
- npm.io page: https://npm.io/package/canvax

## Dependencies (3)

- [earcut](https://npm.io/package/earcut.md) 2.2.2
- [pixi-gl-core](https://npm.io/package/pixi-gl-core.md) 1.1.4
- [@tweenjs/tween.js](https://npm.io/package/@tweenjs/tween.js.md) 18.6.4

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.91 (latest) — 2025-11-19
- 2.0.90 — 2024-02-14
- 2.0.89 — 2024-01-26
- 2.0.88 — 2024-01-22
- 2.0.87 — 2024-01-19
- 2.0.86 — 2022-08-15
- 2.0.85 — 2022-08-15
- 2.0.84 — 2022-07-19
- 2.0.83 — 2022-07-19
- 2.0.82 — 2022-05-12
- 2.0.81 — 2022-05-12
- 2.0.80 — 2022-05-05
- 2.0.79 — 2022-05-05
- 2.0.78 — 2022-05-05
- 2.0.77 — 2022-05-05
- … 71 more at https://npm.io/package/canvax/versions

## README

canvax
======

```js
var app = new Canvax({
	el: el, 
	width: width,
	height: height,
	...
});
```

el 和 width,height 二选一，如果有传递el，则必须是要个能获取到尺寸的dom容器，而且new Canvax后会自动把app.view appendTo 对应的el。

如果传递的是width，height，则是在缓存中创建一个对应尺寸的app.view，然后你可以用dom操作把app.view appenTo任何目标dom容器。




======

npm run build


======


参考

https://github.com/mapbox/earcut


=======

change log

1， line.xStart line.yStart line.xEnd line.yEnd --》 line.start:{x,y} line.start:{x,y}

2,  去掉ctx.save ctx.resolve ctx.transform
    该用ctx.setTransform



,
    "prepublish": "gulp prePublishToNpm"

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