# craftcanvas

> A Library For Canvas

Latest version **1.0.3** (published 2018-03-28) · MIT license · 0 weekly downloads

## Install

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

## 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.3 |
| Published | 2018-03-28 |
| First published | 2018-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 208 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Suresh Kommuri |
| Maintainers | suresh.kom |
| Keywords | craftCanvas, html5, javascript, canvas |

## Links

- npm: https://www.npmjs.com/package/craftcanvas
- Repository: https://github.com/suresh-kommuri/craftCanvas
- Homepage: https://github.com/suresh-kommuri/craftCanvas#readme
- Issues: https://github.com/suresh-kommuri/craftCanvas/issues
- npm.io page: https://npm.io/package/craftcanvas

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2018-03-28
- 1.0.2 — 2018-03-28
- 1.0.0 — 2018-03-27

## README

> "A Library For Canvas"

## Installation

```sh
$ npm install --save craftcanvas
```

## Usage

Just Include your canvas tag in your html page by adding id to it.

```html
<canvas id="canvas1" width="600" height="300"></canvas>
```

And include minified `craftCanvas.min.js` Javascript file

```html
<script type="text/javascript" src="craftCanvas.min.js"></script>
```

<h2>CraftCanvas</h2>

> No script to Draw just pass keys and Draw canvas as you like

Pass your own key values in an object by calling function to draw canvas in your hmtl

<h2>Hints</h2>

* You have to call a function by passing your key values with an object.
* `multiple` key will give you to draw multiple shapes for parent shape.
* You can pass only single image.

> Circle, Square and Line only available features are in progress.

```Javascript
callCanvas("#canvas1").create({
  width: '100%',
  height: 500,
  circle: {
    radius: 70,
    context: "2d",
    moon: "full",
    stroke: 1,
    left: 150,
    top: 120,
    lineColor: "red",
    image: '/images/img.png',
    multiple: {
      two: {
        radius: 70,
        lineColor: "yellow",
        top: 100,
        stroke: 5,
        left: 100,
      }
    }
  },
  square: {
    height: 100,
    context: '2d',
    width: 180,
    left: 50,
    top: 1,
    stroke: 1,
    lineColor: 'orange',
    multiple: {
      two: {
        lineColor: 'blue',
        width: 50,
        height: 50,
        left: 200,
        stroke: 10,
        top: 10
      },
      three: {
        lineColor: 'green',
        context: '2d',
        left: 100,
        width: 100,
        height: 40,
        top: 20,
        stroke: 1
      }
    }
  },
  line: {
    moveToX: 10,
    context: '2d',
    moveToY: 20,
    lineToX: 200,
    lineToY: 100,
    stroke: 5,
    lineColor: 'red',
    lineCap: 'butt'
  }
});
```

## github

[https://github.com/suresh-kommuri/craftCanvas.git](https://github.com/suresh-kommuri/craftCanvas.git)

## License

MIT © [Suresh Kommuri](https://github.com/suresh-kommuri)

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