What is JS-Graphics?
JS-Graphics is a TypeScript/JavaScript library for drawing UI on canvas in an object-oriented manner. It provides a small suite of common graphical objects, structures and styles.
Installation
npm install js-graphics
Features
Graphical Objects
Graphical objects can be instantiated and drawn simply by calling the draw()
method on it.
Basic Graphical Objects
- Label
- Rectangle
- Oval
- Sprite
Nested Graphical Objects
- Animation
- LayeredGraphic
- Button
Structures
Structures define abstract properties about graphical objects.
- Alignment
- ButtonFrames
- CornerAttribute
- SideAttribute
- RegistrationPoint
- Point
Styles
Styles define graphical themes about graphical objects.
- Color
- LineStyle
API Reference
Coming soon.
Test
Module is tested with mocha and chai.