Skip to content
Mathematic Canvas Library
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
__tests__ fix test Feb 12, 2018
src
.gitignore
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
LICENCE
README.md
canvasTest.html added Ellipse Mar 7, 2017
canvasTest.js added Ellipse Mar 7, 2017
graph.html
gulpfile.js
logo.png
package-lock.json
package.json
rollup.config.js
sample.html

README.md

UnitaryJS

Build Status

logo.png

UnitaryJS is a library for handling canvas with objects.

Demo: Demo

Wiki

wiki

Quick Example

<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="UTF-8">
    <title>Sample</title>
    <script src="./unitary.js"></script>
    <script>
    const {Point, Triangle} = Unitary;
    const A = new Point(30,30),
        B = new Point(90,90),
        C = new Point(90,40),
        ABC = new Triangle(A, B, C),
        circumcircleABC = ABC.getCircumcircle(),
        incircleABC = ABC.getIncircle(),
        canvas = new Canvas('canvas');

    canvas.add(ABC);
    canvas.add(circumcircleABC);
    canvas.add(incircleABC);
    canvas.draw();
    </script>
  </head>
  <body>
    <canvas id="canvas" width="200" height="200"></canvas>
  </body>
</html>

Getting started

npm install unitaryjs

and require unitaryjs.

const Unitary = require('unitaryjs');
new Unitary.Vector(1, 1);

Browser

download ./dist/unitary.min.js and load it.

<script src="unitary.js"></script>

Classes

  • BezierCurve
  • Circle
  • CircularSector
  • Doughnut
  • Graph
  • Group
  • Image
  • Line
  • Point
  • Polygon
  • Quadrilateral
  • Rect
  • Segment
  • Text
  • Triangle
  • Vector
You can’t perform that action at this time.