@gudhub/quote-tool

1.4.9 • Public • Published

Package Specification

The Drawing Tool will be an npm module that could be imported into your project. To start program you should pass to DrawingTool a shape object and canvas element where you want the drawing tool to be appeared. (see example below)

How to use

Import DrawingTool from ‘drawing_tool’;

let canvas = document.querySelector("#myCanvase");
const dt = new DrawingTool(shape, canvas);

// on change callback
dt.onUpdate((side) =>{
/*this function will be called each time when side will be changed
the side object will be passed as argument*/
});
// on delete callback
dt.onDelete((side) =>{
/*this function will be called each time when shape will be deleted, shape object will be passed as argument*/
});

// returns the measurement object
let meashurement = dt.getMeasurements();


// returns the shape object
let shape = dt.getShape();

Methods Specification

onUpdate( function )

This method will call function each time when side will be changed (side type, side dimension or side modification). The side object will be passed as argument to the callback function

.onDelete(function)

This method will call function each time when shape will be deleted. Shape object of deteled shape will be passed as argument

getMeasurements()

This method will return the shape measurement object where will be specified dimensions for wall, edge, backsplash, waterfall, arch and square feet of the shape. See the detail description on slide 30.

getShape()

This method will return shape object. See detail specification of the shape object on the next slide. You can use this method to get the shape object after users modification.

Readme

Keywords

none

Package Sidebar

Install

npm i @gudhub/quote-tool

Weekly Downloads

28

Version

1.4.9

License

ISC

Unpacked Size

139 kB

Total Files

35

Last publish

Collaborators

  • gudhub