Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A helper library for the canvas 2d API

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 _assets
Octocat-spinner-32 build
Octocat-spinner-32 demo
Octocat-spinner-32 docs
Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitmodules
Octocat-spinner-32 CHANGELOG.md
Octocat-spinner-32 Cee.js
Octocat-spinner-32 Cee.min.js
Octocat-spinner-32 MIT-license.txt
Octocat-spinner-32 README.md
Octocat-spinner-32 grids.jpg
Octocat-spinner-32 index.html
Octocat-spinner-32 web-server.js
README.md

Cee.js

Cee.js is a small helper library for the canvas 2d API. The goal is to extend and enhance the basic API while still remaining familiar.

API and Enhancements

There are currently two areas of focus

  • Chaining any method that doesn't return an explicit value or Cee object (e.g. createPattern, createLinearGradient) is chainable.
  • API Enhancements These range from new concepts (getting the boundingBox of the last operation, getting the currentPos (x and y) of the 'cursor',) missing methods (circle, rectangle) to convenience methods (canvas properties are now chainable getter/setter methods)

A simple example might look like this

    var ctx = new Cee("demo");
    for ( var i = 0; i < 100; i++ ){
      var x = Math.random() * ctx.width,
          y = Math.random() * ctx.height,
          radius = Math.random() * 100;
      ctx.circle({
        "x" : x,
        "y" : y,
        "radius" : radius,
        "fillStyle" : '#'+Math.floor(Math.random()*16777215).toString(16),
        "strokeStyle" : '#'+Math.floor(Math.random()*16777215).toString(16)
      });
    }


You can demo the library in this handy CeeJS demo plunker.

Credits

So far...

Rob Larsen ( slaving away )

with big high fives to

Bob Holt (kicked the project off and actually wrote the first lines of code)

Marc Neuwirth (added all the smart stuff)

Something went wrong with that request. Please try again.