{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 94e777aff5ec2effb4a0","webpack:///./src/Pt.ts","webpack:///./src/Util.ts","webpack:///./src/Op.ts","webpack:///./src/Num.ts","webpack:///./src/LinearAlgebra.ts","webpack:///./src/Bound.ts","webpack:///./src/Form.ts","webpack:///./src/Space.ts","webpack:///./src/Dom.ts","webpack:///./src/Typography.ts","webpack:///./src/Canvas.ts","webpack:///./src/Color.ts","webpack:///./src/Create.ts","webpack:///./src/Svg.ts","webpack:///./src/UI.ts","webpack:///./src/_lib.ts"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;AChEA,kDAAkD;AAClD,sEAAsE;;AAGtE,sCAAmC;AACnC,qCAAgC;AAChC,+CAAyC;AAU9B,mBAAW,GAAG,YAAY,CAAC;AAKtC;;;GAGG;AACH,QAAgB,SAAQ,mBAAW;IAIjC;;;;;;OAMG;IACH,YAAY,GAAG,IAAI;QACjB,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC;YACpD,KAAK,CAAE,IAAI,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,6FAA6F;QACjH,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,KA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AAE,EAAS;IACzB,IAAI,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC;IACzB,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;QAClB,EAAE,CAAC,CAAC,CAAC,IAAE,WAAW,CAAC,CAAC,CAAC;YACnB,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,mBACZ,SAAS,IACN,MAAM,EACN,OAAO,EACP,OAAO,EACP,KAAK,EACL,cAAc,EACd,GAAG,EACH,IAAI,EACJ,GAAG,EACH,MAAM,EACN,KAAK,EACL,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,WAAW,CACf,CAAC","file":"pts.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Pts\"] = factory();\n\telse\n\t\troot[\"Pts\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 15);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 94e777aff5ec2effb4a0","// Source code licensed under Apache License 2.0. \r\n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\r\n\r\n\r\nimport {Util, Const} from \"./Util\";\r\nimport {Geom, Num} from \"./Num\";\r\nimport {Vec, Mat} from \"./LinearAlgebra\";\r\n\r\n\r\nexport interface IPt {\r\n x?:number;\r\n y?:number;\r\n z?:number;\r\n w?:number;\r\n}\r\n\r\nexport var PtBaseArray = Float32Array;\r\nexport type GroupLike = Group | Pt[];\r\nexport type PtLike = Pt | Float32Array | number[];\r\n\r\n\r\n/**\r\n * Pt is a subclass of Float32Array with additional properties and functions to support vector and geometric calculations.\r\n * See [Pt guide](../../guide/Pt-0200.html) for details\r\n */\r\nexport class Pt extends PtBaseArray implements IPt, Iterable<number> {\r\n\r\n protected _id:string;\r\n\r\n /**\r\n * Create a Pt. If no parameter is provided, this will instantiate a Pt with 2 dimensions [0, 0]. \r\n * \r\n * Note that `new Pt(3)` will only instantiate Pt with length of 3 (ie, same as `new Float32Array(3)` ). If you need a Pt with 1 dimension of value 3, use `new Pt([3])`.\r\n * @example `new Pt()`, `new Pt(1,2,3,4,5)`, `new Pt([1,2])`, `new Pt({x:0, y:1})`, `new Pt(pt)`\r\n * @param args a list of numeric parameters, an array of numbers, or an object with {x,y,z,w} properties\r\n */\r\n constructor(...args) {\r\n if (args.length === 1 && typeof args[0] == \"number\") {\r\n super( args[0] ); // init with the TypedArray's length. Needed this in order to make \".map\", \".slice\" etc work.\r\n } else {\r\n super( (args.length>0) ? Util.getArgs(args) : [0,0] );\r\n } \r\n }\r\n\r\n static make( dimensions:number, defaultValue:number=0, randomize:boolean=false ):Pt {\r\n let p = new PtBaseArray(dimensions);\r\n if (defaultValue) p.fill( defaultValue );\r\n if (randomize) {\r\n for (let i=0, len=p.length; i<len; i++) {\r\n p[i] = p[i]*Math.random();\r\n }\r\n }\r\n return new Pt( p );\r\n }\r\n\r\n get id():string { return this._id; }\r\n set id( s:string ) { this._id = s; }\r\n\r\n get x():number { return this[0]; }\r\n get y():number { return this[1]; }\r\n get z():number { return this[2]; }\r\n get w():number { return this[3]; }\r\n\r\n set x( n:number ) { this[0] = n; }\r\n set y( n:number ) { this[1] = n; }\r\n set z( n:number ) { this[2] = n; }\r\n set w( n:number ) { this[3] = n; }\r\n \r\n\r\n /**\r\n * Clone this Pt\r\n */\r\n clone():Pt {\r\n return new Pt( this );\r\n }\r\n\r\n\r\n /**\r\n * Check if another Pt is equal to this Pt, within a threshold\r\n * @param p another Pt to compare with\r\n * @param threshold a threshold value within which the two Pts are considered equal. Default is 0.000001.\r\n */\r\n equals( p:PtLike, threshold=0.000001 ):boolean {\r\n for (let i=0, len=this.length; i<len; i++) {\r\n if ( Math.abs(this[i]-p[i]) > threshold ) return false;\r\n }\r\n return true;\r\n }\r\n\r\n\r\n /**\r\n * Update the values of this Pt\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n to( ...args ):this {\r\n let p = Util.getArgs( args );\r\n for (let i=0, len=Math.min(this.length, p.length); i<len; i++) {\r\n this[i] = p[i];\r\n }\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Like `to()` but returns a new Pt\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n $to( ...args ):Pt {\r\n return this.clone().to( ...args );\r\n }\r\n\r\n\r\n /**\r\n * Update the values of this Pt to point at a specific angle\r\n * @param radian target angle in radian\r\n * @param magnitude Optional magnitude if known. If not provided, it'll calculate and use this Pt's magnitude.\r\n * @param anchorFromPt If `true`, translate to new position from current position. Default is `false` which update the position from origin (0,0);\r\n */\r\n toAngle( radian:number, magnitude?:number, anchorFromPt:boolean=false ):this {\r\n let m = (magnitude!=undefined) ? magnitude : this.magnitude();\r\n let change = [Math.cos(radian)*m, Math.sin(radian)*m];\r\n return (anchorFromPt) ? this.add( change ) : this.to( change );\r\n }\r\n\r\n\r\n /**\r\n * Create an operation using this Pt, passing this Pt into a custom function's first parameter. See the [Op guide](../../guide/Op-0400.html) for details.\r\n * For example: `let myOp = pt.op( fn ); let result = myOp( [1,2,3] );`\r\n * @param fn any function that takes a Pt as its first parameter\r\n * @returns a resulting function that takes other parameters required in `fn`\r\n */\r\n op( fn:(p1:PtLike, ...rest:any[]) => any ): ( ...rest:any[] ) => any {\r\n let self = this;\r\n return ( ...params:any[] ) => {\r\n return fn( self, ...params );\r\n };\r\n }\r\n\r\n\r\n /**\r\n * This combines a series of operations into an array. See `op()` for details.\r\n * For example: `let myOps = pt.ops([fn1, fn2, fn3]); let results = myOps.map( (op) => op([1,2,3]) );`\r\n * @param fns an array of functions for `op`\r\n * @returns an array of resulting functions\r\n */\r\n ops( fns:((p1:PtLike, ...rest:any[]) => any)[] ): (( ...rest:any[] ) => any)[] {\r\n let _ops = [];\r\n for (let i=0, len=fns.length; i<len; i++) {\r\n _ops.push( this.op( fns[i] ) );\r\n }\r\n return _ops;\r\n }\r\n\r\n\r\n /**\r\n * Take specific dimensional values from this Pt and create a new Pt\r\n * @param axis a string such as \"xy\" (use Const.xy) or an array to specify index for two dimensions\r\n */\r\n $take( axis:string|number[] ):Pt {\r\n let p = [];\r\n for (let i=0, len=axis.length; i<len; i++) {\r\n p.push( this[axis[i]] || 0 );\r\n }\r\n return new Pt(p);\r\n }\r\n\r\n\r\n /**\r\n * Concatenate this Pt with addition dimensional values and return as a new Pt\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n $concat( ...args ):Pt {\r\n return new Pt( this.toArray().concat( Util.getArgs( args ) ) );\r\n }\r\n\r\n\r\n /**\r\n * Add scalar or vector values to this Pt\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n add(...args): this { \r\n (args.length === 1 && typeof args[0] == \"number\") ? Vec.add( this, args[0] ) : Vec.add( this, Util.getArgs(args) );\r\n return this; \r\n }\r\n\r\n\r\n /**\r\n * Like `add`, but returns result as a new Pt\r\n */\r\n $add(...args): Pt { return this.clone().add(...args); }\r\n\r\n\r\n /**\r\n * Subtract scalar or vector values from this Pt\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n subtract(...args): this { \r\n (args.length === 1 && typeof args[0] == \"number\") ? Vec.subtract( this, args[0] ) : Vec.subtract( this, Util.getArgs(args) );\r\n return this; \r\n }\r\n\r\n\r\n /**\r\n * Like `subtract`, but returns result as a new Pt\r\n */\r\n $subtract(...args): Pt { return this.clone().subtract(...args); }\r\n\r\n\r\n /**\r\n * Multiply scalar or vector values (as element-wise) with this Pt.\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n multiply(...args): this { \r\n (args.length === 1 && typeof args[0] == \"number\") ? Vec.multiply( this, args[0] ) : Vec.multiply( this, Util.getArgs(args) );\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Like `multiply`, but returns result as a new Pt\r\n */\r\n $multiply(...args): Pt { return this.clone().multiply(...args); }\r\n\r\n\r\n /**\r\n * Divide this Pt over scalar or vector values (as element-wise)\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n divide(...args): this { \r\n (args.length === 1 && typeof args[0] == \"number\") ? Vec.divide( this, args[0] ) : Vec.divide( this, Util.getArgs(args) );\r\n return this; \r\n }\r\n\r\n\r\n /**\r\n * Like `divide`, but returns result as a new Pt\r\n */\r\n $divide(...args): Pt { return this.clone().divide(...args); }\r\n\r\n\r\n /**\r\n * Get the sqaured distance (magnitude) of this Pt from origin\r\n */\r\n magnitudeSq():number { return Vec.dot( this, this ); }\r\n\r\n\r\n /**\r\n * Get the distance (magnitude) of this Pt from origin\r\n */\r\n magnitude():number { return Vec.magnitude( this ); }\r\n\r\n\r\n /**\r\n * Convert to a unit vector, which is a normalized vector whose magnitude equals 1.\r\n * @param magnitude Optional: if the magnitude is known, pass it as a parameter to avoid duplicate calculation.\r\n */\r\n unit( magnitude:number=undefined ):Pt {\r\n Vec.unit( this, magnitude );\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Get a unit vector from this Pt\r\n */\r\n $unit( magnitude:number=undefined ):Pt { return this.clone().unit( magnitude ); }\r\n\r\n\r\n /**\r\n * Dot product of this Pt and another Pt\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n dot( ...args ):number { return Vec.dot( this, Util.getArgs(args) ); }\r\n\r\n\r\n /**\r\n * 2D Cross product of this Pt and another Pt. Return results as a new Pt.\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n cross2D( ...args ):number { return Vec.cross2D( this, Util.getArgs(args) ); }\r\n\r\n \r\n /**\r\n * 3D Cross product of this Pt and another Pt. Return results as a new Pt.\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n $cross( ...args ): Pt { return Vec.cross( this, Util.getArgs( args ) ); }\r\n\r\n\r\n /**\r\n * Calculate vector projection of this Pt on another Pt. Returns result as a new Pt.\r\n * @param p a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n $project( p:Pt ):Pt {\r\n let m = p.magnitude();\r\n let a = this.$unit();\r\n let b = p.$divide(m);\r\n let dot = a.dot( b );\r\n return a.multiply( m * dot );\r\n }\r\n\r\n\r\n /**\r\n * Absolute values for all values in this pt\r\n */\r\n abs():Pt {\r\n Vec.abs( this );\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Get a new Pt with absolute values of this Pt\r\n */\r\n $abs():Pt {\r\n return this.clone().abs();\r\n }\r\n\r\n\r\n /**\r\n * Floor values for all values in this pt\r\n */\r\n floor():Pt {\r\n Vec.floor( this );\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Get a new Pt with floor values of this Pt\r\n */\r\n $floor():Pt {\r\n return this.clone().floor();\r\n }\r\n\r\n\r\n /**\r\n * Ceil values for all values in this pt\r\n */\r\n ceil():Pt {\r\n Vec.ceil( this );\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Get a new Pt with ceil values of this Pt\r\n */\r\n $ceil():Pt {\r\n return this.clone().ceil();\r\n }\r\n\r\n\r\n /**\r\n * Round values for all values in this pt\r\n */\r\n round():Pt {\r\n Vec.round( this );\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Get a new Pt with round values of this Pt\r\n */\r\n $round():Pt {\r\n return this.clone().round();\r\n }\r\n\r\n\r\n /**\r\n * Find the minimum value across all dimensions in this Pt\r\n * @returns an object with `value` and `index` which returns the minimum value and its dimensional index\r\n */\r\n minValue():{value:number, index:number} {\r\n return Vec.min( this );\r\n }\r\n\r\n\r\n /**\r\n * Find the maximum value across all dimensions in this Pt\r\n * @returns an object with `value` and `index` which returns the maximum value and its dimensional index\r\n */\r\n maxValue():{value:number, index:number} {\r\n return Vec.max( this );\r\n }\r\n\r\n\r\n /**\r\n * Get a new Pt that has the minimum dimensional values of this Pt and another Pt\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n $min( ...args ):Pt {\r\n let p = Util.getArgs( args );\r\n let m = this.clone();\r\n for (let i=0, len=Math.min( this.length, p.length ); i<len; i++) {\r\n m[i] = Math.min( this[i], p[i] );\r\n }\r\n return m;\r\n }\r\n\r\n\r\n /**\r\n * Get a new Pt that has the maximum dimensional values of this Pt and another Pt\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n $max( ...args ):Pt {\r\n let p = Util.getArgs( args );\r\n let m = this.clone();\r\n for (let i=0, len=Math.min( this.length, p.length ); i<len; i++) {\r\n m[i] = Math.max( this[i], p[i] );\r\n }\r\n return m;\r\n }\r\n \r\n\r\n /**\r\n * Get angle of this vector from origin\r\n * @param axis a string such as \"xy\" (use Const.xy) or an array to specify index for two dimensions\r\n */\r\n angle( axis:string|number[]=Const.xy ):number {\r\n return Math.atan2( this[axis[1]], this[axis[0]] );\r\n }\r\n\r\n\r\n /**\r\n * Get the angle between this and another Pt\r\n * @param p the other Pt\r\n * @param axis a string such as \"xy\" (use Const.xy) or an array to specify index for two dimensions\r\n */\r\n angleBetween( p:Pt, axis:string|number[]=Const.xy ):number {\r\n return Geom.boundRadian( this.angle(axis) ) - Geom.boundRadian( p.angle(axis) );\r\n }\r\n\r\n\r\n /**\r\n * Scale this Pt from origin or from an anchor point\r\n * @param scale scale ratio\r\n * @param anchor optional anchor point to scale from\r\n */\r\n scale( scale:number|number[]|PtLike, anchor?:PtLike ) { \r\n Geom.scale( this, scale, anchor || Pt.make( this.length, 0) );\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Rotate this Pt from origin or from an anchor point in 2D\r\n * @param angle rotate angle\r\n * @param anchor optional anchor point to scale from\r\n * @param axis optional string such as \"yz\" to specify a 2D plane\r\n */\r\n rotate2D( angle:number, anchor?:PtLike, axis?:string ) { \r\n Geom.rotate2D( this, angle, anchor || Pt.make( this.length, 0), axis );\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Shear this Pt from origin or from an anchor point in 2D\r\n * @param shear shearing value which can be a number or an array of 2 numbers\r\n * @param anchor optional anchor point to scale from\r\n * @param axis optional string such as \"yz\" to specify a 2D plane\r\n */\r\n shear2D( scale:number|number[]|PtLike, anchor?:PtLike, axis?:string) {\r\n Geom.shear2D( this, scale, anchor || Pt.make( this.length, 0), axis );\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Reflect this Pt along a 2D line\r\n * @param line a Group of 2 Pts that defines a line for reflection\r\n * @param axis optional axis such as \"yz\" to define a 2D plane of reflection\r\n */\r\n reflect2D( line:GroupLike, axis?:string):this {\r\n Geom.reflect2D( this, line, axis );\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * A string representation of this Pt: \"Pt(1, 2, 3)\"\r\n */\r\n toString():string {\r\n return `Pt(${ this.join(\", \")})`;\r\n }\r\n\r\n\r\n /**\r\n * Convert this Pt to a javascript Array\r\n */\r\n toArray():number[] {\r\n return [].slice.call( this );\r\n }\r\n\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * A Group is a subclass of Array. It should onnly contain Pt instances. You can think of it as an array of arrays (Float32Arrays to be specific).\r\n * See [Group guide](../../guide/Group-0300.html) for details\r\n */\r\nexport class Group extends Array<Pt> {\r\n\r\n protected _id:string;\r\n \r\n constructor(...args:Pt[]) {\r\n super(...args);\r\n }\r\n\r\n get id():string { return this._id; }\r\n set id( s:string ) { this._id = s; }\r\n\r\n /** The first Pt in this group */\r\n get p1():Pt { return this[0]; }\r\n\r\n /** The second Pt in this group */\r\n get p2():Pt { return this[1]; }\r\n\r\n /** The third Pt in this group */\r\n get p3():Pt { return this[2]; }\r\n\r\n /** The forth Pt in this group */\r\n get p4():Pt { return this[3]; }\r\n\r\n /** The last Pt in this group */\r\n get q1():Pt { return this[this.length-1]; }\r\n\r\n /** The second-last Pt in this group */\r\n get q2():Pt { return this[this.length-2]; }\r\n\r\n /** The third-last Pt in this group */\r\n get q3():Pt { return this[this.length-3]; }\r\n\r\n /** The forth-last Pt in this group */\r\n get q4():Pt { return this[this.length-4]; }\r\n\r\n \r\n\r\n\r\n /**\r\n * Depp clone this group and its Pts\r\n */\r\n clone():Group {\r\n let group = new Group(); \r\n for (let i=0, len=this.length; i<len; i++) {\r\n group.push( this[i].clone() );\r\n }\r\n return group;\r\n }\r\n\r\n\r\n /**\r\n * Convert an array of numeric arrays into a Group of Pts\r\n * @param list an array of numeric arrays\r\n * @example `Group.fromArray( [[1,2], [3,4], [5,6]] )`\r\n */\r\n static fromArray( list:PtLike[] ):Group {\r\n let g = new Group();\r\n for (let i=0, len=list.length; i<len; i++) {\r\n let p = (list[i] instanceof Pt) ? list[i] as Pt : new Pt(list[i]);\r\n g.push( p );\r\n }\r\n return g;\r\n }\r\n\r\n\r\n /**\r\n * Convert an array of Pts into a Group.\r\n * @param list an array of Pts\r\n */\r\n static fromPtArray( list:GroupLike ):Group {\r\n return Group.from( list ) as Group;\r\n }\r\n\r\n\r\n /**\r\n * Split this Group into an array of sub-groups\r\n * @param chunkSize number of items per sub-group\r\n * @param stride forward-steps after each sub-group\r\n * @param loopBack if `true`, always go through the array till the end and loop back to the beginning to complete the segments if needed\r\n */\r\n split( chunkSize:number, stride?:number, loopBack:boolean=false ):Group[] {\r\n let sp = Util.split( this, chunkSize, stride, loopBack );\r\n return sp as Group[];\r\n }\r\n\r\n\r\n /**\r\n * Insert a Pt into this group\r\n * @param pts Another group of Pts\r\n * @param index the index position to insert into\r\n */\r\n insert( pts:GroupLike, index=0 ):this {\r\n Group.prototype.splice.apply( this, [index, 0, ...pts] );\r\n return this;\r\n }\r\n \r\n\r\n /**\r\n * Like Array's splice function, with support for negative index and a friendlier name.\r\n * @param index start index, which can be negative (where -1 is at index 0, -2 at index 1, etc)\r\n * @param count number of items to remove\r\n * @returns The items that are removed. \r\n */\r\n remove( index=0, count:number=1 ):Group {\r\n let param = (index<0) ? [index*-1 - 1, count] : [index, count];\r\n return Group.prototype.splice.apply( this, param );\r\n }\r\n\r\n\r\n /**\r\n * Split this group into an array of sub-group segments\r\n * @param pts_per_segment number of Pts in each segment\r\n * @param stride forward-step to take\r\n * @param loopBack if `true`, always go through the array till the end and loop back to the beginning to complete the segments if needed\r\n */\r\n segments( pts_per_segment:number=2, stride:number=1, loopBack:boolean=false ):Group[] { \r\n return this.split(pts_per_segment, stride, loopBack); \r\n }\r\n\r\n\r\n /**\r\n * Get all the line segments (ie, edges in a graph) of this group\r\n */\r\n lines():Group[] { return this.segments(2, 1); }\r\n\r\n\r\n /**\r\n * Find the centroid of this group's Pts, which is the average middle point.\r\n */\r\n centroid(): Pt {\r\n return Geom.centroid( this );\r\n }\r\n\r\n \r\n /**\r\n * Find the rectangular bounding box of this group's Pts.\r\n * @returns a Group of 2 Pts representing the top-left and bottom-right of the rectangle\r\n */\r\n boundingBox():Group {\r\n return Geom.boundingBox( this );\r\n }\r\n\r\n\r\n /**\r\n * Anchor all the Pts in this Group using a target Pt as origin. (ie, subtract all Pt with the target anchor to get a relative position). All the Pts' values will be updated.\r\n * @param ptOrIndex a Pt, or a numeric index to target a specific Pt in this Group\r\n */\r\n anchorTo( ptOrIndex:PtLike|number=0 ) { Geom.anchor( this, ptOrIndex, \"to\" ); }\r\n\r\n\r\n /**\r\n * Anchor all the Pts in this Group by its absolute position from a target Pt. (ie, add all Pt with the target anchor to get an absolute position). All the Pts' values will be updated.\r\n * @param ptOrIndex a Pt, or a numeric index to target a specific Pt in this Group\r\n */\r\n anchorFrom( ptOrIndex:PtLike|number=0 ) { Geom.anchor( this, ptOrIndex, \"from\" ); }\r\n\r\n\r\n /**\r\n * Create an operation using this Group, passing this Group into a custom function's first parameter. See the [Op guide](../../guide/Op-0400.html) for details.\r\n * For example: `let myOp = group.op( fn ); let result = myOp( [1,2,3] );`\r\n * @param fn any function that takes a Group as its first parameter\r\n * @returns a resulting function that takes other parameters required in `fn`\r\n */\r\n op( fn:(g1:GroupLike, ...rest:any[]) => any ): ( ...rest:any[] ) => any {\r\n let self = this;\r\n return ( ...params:any[] ) => {\r\n return fn( self, ...params );\r\n };\r\n }\r\n\r\n\r\n /**\r\n * This combines a series of operations into an array. See `op()` for details.\r\n * For example: `let myOps = pt.ops([fn1, fn2, fn3]); let results = myOps.map( (op) => op([1,2,3]) );`\r\n * @param fns an array of functions for `op`\r\n * @returns an array of resulting functions\r\n */\r\n ops( fns:((g1:GroupLike, ...rest:any[]) => any)[] ): (( ...rest:any[] ) => any)[] {\r\n let _ops = [];\r\n for (let i=0, len=fns.length; i<len; i++) {\r\n _ops.push( this.op( fns[i] ) );\r\n }\r\n return _ops;\r\n }\r\n\r\n\r\n /**\r\n * Get an interpolated point on the line segments defined by this Group\r\n * @param t a value between 0 to 1 usually\r\n */\r\n interpolate( t:number ):Pt {\r\n t = Num.clamp( t, 0, 1 );\r\n let chunk = this.length-1;\r\n let tc = 1/(this.length-1);\r\n let idx = Math.floor( t / tc );\r\n return Geom.interpolate( this[idx], this[ Math.min( this.length-1, idx+1)], (t - idx*tc) * chunk );\r\n }\r\n\r\n\r\n /**\r\n * Move every Pt's position by a specific amount. Same as `add`.\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n moveBy( ...args ):this {\r\n return this.add( ...args );\r\n }\r\n\r\n /**\r\n * Move the first Pt in this group to a specific position, and move all the other Pts correspondingly\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n moveTo( ...args ):this {\r\n let d = new Pt( Util.getArgs(args) ).subtract( this[0] );\r\n this.moveBy( d );\r\n return this; \r\n }\r\n\r\n\r\n /**\r\n * Scale this group's Pts from an anchor point. Default anchor point is the first Pt in this group.\r\n * @param scale scale ratio\r\n * @param anchor optional anchor point to scale from\r\n */\r\n scale( scale:number|number[]|PtLike, anchor?:PtLike ):this { \r\n for (let i=0, len=this.length; i<len; i++) {\r\n Geom.scale( this[i], scale, anchor || this[0] );\r\n }\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Rotate this group's Pt from an anchor point in 2D. Default anchor point is the first Pt in this group.\r\n * @param angle rotate angle\r\n * @param anchor optional anchor point to scale from\r\n * @param axis optional string such as \"yz\" to specify a 2D plane\r\n */\r\n rotate2D( angle:number, anchor?:PtLike, axis?:string ):this { \r\n for (let i=0, len=this.length; i<len; i++) {\r\n Geom.rotate2D( this[i], angle, anchor || this[0], axis );\r\n } \r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Shear this group's Pt from an anchor point in 2D. Default anchor point is the first Pt in this group.\r\n * @param shear shearing value which can be a number or an array of 2 numbers\r\n * @param anchor optional anchor point to scale from\r\n * @param axis optional string such as \"yz\" to specify a 2D plane\r\n */\r\n shear2D( scale:number|number[]|PtLike, anchor?:PtLike, axis?:string):this {\r\n for (let i=0, len=this.length; i<len; i++) {\r\n Geom.shear2D( this[i], scale, anchor || this[0], axis );\r\n }\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Reflect this group's Pts along a 2D line. Default anchor point is the first Pt in this group.\r\n * @param line a Group of 2 Pts that defines a line for reflection\r\n * @param axis optional axis such as \"yz\" to define a 2D plane of reflection\r\n */\r\n reflect2D( line:GroupLike, axis?:string):this {\r\n for (let i=0, len=this.length; i<len; i++) {\r\n Geom.reflect2D( this[i], line, axis );\r\n }\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Sort this group's Pts by values in a specific dimension\r\n * @param dim dimensional index\r\n * @param desc if true, sort descending. Default is false (ascending)\r\n */\r\n sortByDimension( dim:number, desc:boolean=false ):this {\r\n return this.sort( (a, b) => (desc) ? b[dim] - a[dim] : a[dim] - b[dim] );\r\n }\r\n\r\n\r\n /**\r\n * Update each Pt in this Group with a Pt function\r\n * @param ptFn string name of an existing Pt function. Note that the function must return Pt.\r\n * @param args arguments for the function specified in ptFn\r\n */\r\n forEachPt( ptFn:string, ...args ):this {\r\n if (!this[0][ptFn]) {\r\n Util.warn( `${ptFn} is not a function of Pt` );\r\n return this;\r\n }\r\n for (let i=0, len=this.length; i<len; i++) {\r\n this[i] = this[i][ptFn]( ...args );\r\n }\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Add scalar or vector values to this group's Pts.\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n add( ...args ):this {\r\n return this.forEachPt( \"add\", ...args );\r\n }\r\n\r\n\r\n /**\r\n * Subtract scalar or vector values from this group's Pts.\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n subtract( ...args ):this {\r\n return this.forEachPt( \"subtract\", ...args );\r\n }\r\n\r\n\r\n /**\r\n * Multiply scalar or vector values (as element-wise) with this group's Pts.\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n multiply( ...args ):this {\r\n return this.forEachPt( \"multiply\", ...args );\r\n }\r\n \r\n\r\n /**\r\n * Divide this group's Pts over scalar or vector values (as element-wise)\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n divide( ...args ):this {\r\n return this.forEachPt( \"divide\", ...args );\r\n }\r\n\r\n\r\n /**\r\n * Apply this group as a matrix and calculate matrix addition\r\n * @param g a scalar number, an array of numeric arrays, or a group of Pt\r\n * @returns a new Group\r\n */\r\n $matrixAdd( g:GroupLike|number[][]|number ):Group {\r\n return Mat.add( this, g );\r\n }\r\n\r\n\r\n /**\r\n * Apply this group as a matrix and calculate matrix multiplication\r\n * @param g a scalar number, an array of numeric arrays, or a Group of K Pts, each with N dimensions (K-rows, N-columns) -- or if transposed is true, then N Pts with K dimensions\r\n * @param transposed (Only applicable if it's not elementwise multiplication) If true, then a and b's columns should match (ie, each Pt should have the same dimensions). Default is `false`.\r\n * @param elementwise if true, then the multiplication is done element-wise. Default is `false`.\r\n * @returns If not elementwise, this will return a new Group with M Pt, each with N dimensions (M-rows, N-columns).\r\n */\r\n $matrixMultiply( g:GroupLike|number, transposed:boolean=false, elementwise:boolean=false ):Group {\r\n return Mat.multiply( this, g, transposed , elementwise);\r\n }\r\n\r\n\r\n /**\r\n * Zip one slice of an array of Pt. Imagine the Pts are organized in rows, then this function will take the values in a specific column.\r\n * @param idx index to zip at\r\n * @param defaultValue a default value to fill if index out of bound. If not provided, it will throw an error instead.\r\n */\r\n zipSlice( index:number, defaultValue:number|boolean = false ):Pt {\r\n return Mat.zipSlice( this, index, defaultValue );\r\n }\r\n\r\n /**\r\n * Zip a group of Pt. eg, [[1,2],[3,4],[5,6]] => [[1,3,5],[2,4,6]]\r\n * @param defaultValue a default value to fill if index out of bound. If not provided, it will throw an error instead.\r\n * @param useLongest If true, find the longest list of values in a Pt and use its length for zipping. Default is false, which uses the first item's length for zipping.\r\n */\r\n $zip( defaultValue:number|boolean = undefined, useLongest=false ):Group {\r\n return Mat.zip( this, defaultValue, useLongest );\r\n }\r\n\r\n\r\n /**\r\n * Get a string representation of this group\r\n */\r\n toString():string {\r\n return \"Group[ \"+ this.reduce( (p, c) => p+c.toString()+\" \", \"\" )+\" ]\";\r\n }\r\n\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/Pt.ts","// Source code licensed under Apache License 2.0.\r\n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\r\n\r\n\r\nimport {Group} from \"./Pt\";\r\n\r\n\r\n/**\r\n * Various constant values for enumerations and calculations\r\n */\r\nexport const Const = {\r\n xy: \"xy\",\r\n yz: \"yz\",\r\n xz: \"xz\",\r\n xyz: \"xyz\",\r\n\r\n horizontal: 0,\r\n vertical: 1,\r\n\r\n /* represents identical point or value */\r\n identical: 0,\r\n\r\n /* represents right position or direction */\r\n right: 4,\r\n\r\n /* represents bottom right position or direction */\r\n bottom_right: 5,\r\n\r\n /* represents bottom position or direction */\r\n bottom: 6,\r\n\r\n /* represents bottom left position or direction */\r\n bottom_left: 7,\r\n\r\n /* represents left position or direction */\r\n left: 8,\r\n\r\n /* represents top left position or direction */\r\n top_left: 1,\r\n\r\n /* represents top position or direction */\r\n top: 2,\r\n\r\n /* represents top right position or direction */\r\n top_right: 3,\r\n\r\n /* represents an arbitrary very small number. It is set as 0.0001 here. */\r\n epsilon : 0.0001,\r\n\r\n /* represents Number.MAX_VALUE */\r\n max: Number.MAX_VALUE,\r\n\r\n /* represents Number.MIN_VALUE */\r\n min: Number.MIN_VALUE,\r\n\r\n /* pi radian (180 deg) */\r\n pi: Math.PI,\r\n\r\n /* two pi radian (360deg) */\r\n two_pi : 6.283185307179586,\r\n\r\n /* half pi radian (90deg) */\r\n half_pi : 1.5707963267948966,\r\n\r\n /* pi/4 radian (45deg) */\r\n quarter_pi : 0.7853981633974483,\r\n\r\n /* pi/180: 1 degree in radian */\r\n one_degree: 0.017453292519943295,\r\n\r\n /* multiply this constant with a radian to get a degree */\r\n rad_to_deg: 57.29577951308232,\r\n\r\n /* multiply this constant with a degree to get a radian */\r\n deg_to_rad: 0.017453292519943295,\r\n\r\n /* Gravity acceleration (unit: m/s^2) and gravity force (unit: Newton) on 1kg of mass. */\r\n gravity: 9.81,\r\n\r\n /* 1 Newton: 0.10197 Kilogram-force */\r\n newton: 0.10197,\r\n\r\n /* Gaussian constant (1 / Math.sqrt(2 * Math.PI)) */\r\n gaussian: 0.3989422804014327\r\n\r\n};\r\n\r\n\r\n/**\r\n * Util provides various helper functions\r\n */\r\nexport class Util {\r\n\r\n static warnLevel:\"error\"|\"warn\"|\"default\" = \"default\";\r\n\r\n /**\r\n * Convert different kinds of parameters (arguments, array, object) into an array of numbers\r\n * @param args a list of numbers, an array of number, or an object with {x,y,z,w} properties\r\n */\r\n static getArgs( args:any[] ):Array<number> {\r\n if (args.length<1) return [];\r\n\r\n let pos = [];\r\n \r\n let isArray = Array.isArray( args[0] ) || ArrayBuffer.isView( args[0] );\r\n \r\n // positional arguments: x,y,z,w,...\r\n if (typeof args[0] === 'number') {\r\n pos = Array.prototype.slice.call( args );\r\n\r\n // as an object of {x, y?, z?, w?}\r\n } else if (typeof args[0] === 'object' && !isArray ) {\r\n let a = [\"x\", \"y\", \"z\", \"w\"];\r\n let p = args[0];\r\n for (let i=0; i<a.length; i++) {\r\n if ( (p.length && i>=p.length) || !(a[i] in p) ) break; // check for length and key exist\r\n pos.push( p[ a[i] ] );\r\n }\r\n\r\n // as an array of values\r\n } else if (isArray) {\r\n pos = [].slice.call( args[0] );\r\n }\r\n \r\n return pos;\r\n }\r\n\r\n\r\n /**\r\n * Send a warning message based on Util.warnLevel global setting. This allows you to dynamically set whether minor errors should be thrown or printed in console or muted.\r\n * @param message any error or warning message\r\n * @param defaultReturn optional return value\r\n */\r\n static warn( message:string=\"error\", defaultReturn:any=undefined ):any {\r\n if (Util.warnLevel == \"error\") {\r\n throw new Error( message );\r\n } else if (Util.warnLevel == \"warn\") {\r\n console.warn( message );\r\n }\r\n return defaultReturn;\r\n \r\n }\r\n\r\n\r\n static randomInt( range:number, start:number=0 ) {\r\n return Math.floor( Math.random()*range ) + start;\r\n }\r\n\r\n /**\r\n * Split an array into chunks of sub-array\r\n * @param pts an array \r\n * @param size chunk size, ie, number of items in a chunk\r\n * @param stride optional parameter to \"walk through\" the array in steps\r\n * @param loopBack if `true`, always go through the array till the end and loop back to the beginning to complete the segments if needed\r\n */\r\n static split( pts:any[], size:number, stride?:number, loopBack:boolean=false ):any[][] {\r\n let st = stride || size;\r\n let chunks = [];\r\n for (let i=0; i<pts.length; i++) {\r\n if (i*st+size > pts.length) {\r\n if (loopBack) {\r\n let g = pts.slice(i*st);\r\n g = g.concat( pts.slice( 0, (i*st+size)%size ) );\r\n chunks.push( g );\r\n } else {\r\n break;\r\n }\r\n } else {\r\n chunks.push( pts.slice(i*st, i*st+size ) );\r\n }\r\n }\r\n return chunks;\r\n }\r\n\r\n\r\n /**\r\n * Flatten an array of arrays such as Group[] to a flat Array or Group\r\n * @param pts an array, usually an array of Groups\r\n * @param flattenAsGroup a boolean to specify whether the return type should be a Group or Array. Default is `true` which returns a Group.\r\n */\r\n static flatten( pts:any[], flattenAsGroup:boolean=true ) {\r\n let arr = (flattenAsGroup) ? new Group() : new Array();\r\n return arr.concat.apply(arr, pts);\r\n }\r\n\r\n\r\n /**\r\n * Given two arrays of object<T>, and a function that operate on two object<T>, return an array of T \r\n * @param a an array of object<T>, eg [ Group, Group, ... ]\r\n * @param b another array of object<T>\r\n * @param op a function that takes two parameters (a, b) and returns a T\r\n */\r\n static combine<T>( a:T[], b:T[], op:(a:T, b:T) => T ):T[] {\r\n let result = [];\r\n for (let i=0, len=a.length; i<len; i++) {\r\n for (let k=0, lenB=b.length; k<lenB; k++) {\r\n result.push( op(a[i], b[k]) );\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n\r\n /**\r\n * Zip arrays. eg, [[1,2],[3,4],[5,6]] => [[1,3,5],[2,4,6]]\r\n * @param arrays an array of arrays \r\n */\r\n static zip( ...arrays:Array<any>[] ) {\r\n let z = [];\r\n for (let i=0, len=arrays[0].length; i<len; i++) {\r\n let p = [];\r\n for (let k=0; k<arrays.length; k++) {\r\n p.push( arrays[k][i] );\r\n }\r\n z.push( p );\r\n }\r\n return z;\r\n }\r\n\r\n\r\n /**\r\n * Create a convenient stepper. This returns a function which you can call repeatedly to step a counter.\r\n * @param max Maximum of the stepper range. The resulting stepper will return (min to max-1) values.\r\n * @param min Minimum of the stepper range. Default is 0.\r\n * @param stride Stride of the step. Default is 1.\r\n * @param callback An optional callback function( step ), which will be called each tiem when stepper function is called.\r\n * @example `let counter = stepper(100); let c = counter(); c = counter(); ...`\r\n * @returns a function which will increment the stepper and return its value at each call.\r\n */\r\n static stepper( max:number, min:number=0, stride:number=1, callback?:(n:number) => void ):(() => number) {\r\n let c = min;\r\n return function() {\r\n c += stride;\r\n if (c >= max) {\r\n c = min + (c-max);\r\n }\r\n if (callback) callback(c);\r\n return c;\r\n };\r\n }\r\n\r\n\r\n /**\r\n * A convenient way to step through a range. Same as `for (i=0; i<range; i++)`, except this also stores the resulting return values at each step and return them as an array.\r\n * @param range a range to step through\r\n * @param fn a callback function(index). If this function returns a value, it will be stored at each step\r\n * @returns an array of returned values at each step \r\n */\r\n static forRange( fn:(index:number) => any, range:number, start:number=0, step:number=1 ):any[] {\r\n let temp = [];\r\n for (let i=start, len=range; i<len; i+=step) {\r\n temp[i] = fn(i);\r\n }\r\n return temp;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/Util.ts","// Source code licensed under Apache License 2.0. \n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\n\n\nimport {Util} from \"./Util\";\nimport {Geom, Num} from \"./Num\";\nimport {Pt, PtLike, Group, GroupLike} from \"./Pt\";\nimport {Mat} from \"./LinearAlgebra\";\n\n\nlet _errorLength = (obj, param:number|string=\"expected\") => Util.warn( \"Group's length is less than \"+param, obj );\nlet _errorOutofBound = (obj, param:number|string=\"\") => Util.warn( `Index ${param} is out of bound in Group`, obj );\n\n\n/**\n * Line class provides static functions to create and operate on lines. A line is usually represented as a Group of 2 Pts.\n * You can use the static function as-is, or apply the `op` method in Group or Pt to many of these functions.\n * See [Op guide](../../guide/Op-0400.html) for details.\n */\nexport class Line {\n\n /**\n * Create a line by \"drawing\" from an anchor point, given an angle and a magnitude\n * @param anchor an anchor Pt\n * @param angle an angle in radian\n * @param magnitude magnitude of the line\n * @return a Group of 2 Pts representing a line segement\n */\n static fromAngle( anchor:PtLike, angle:number, magnitude:number ):Group {\n let g = new Group( new Pt(anchor), new Pt(anchor) );\n g[1].toAngle( angle, magnitude, true );\n return g;\n }\n\n\n /**\n * Calculate the slope of a line\n * @param p1 line's first end point\n * @param p2 line's second end point\n */\n static slope( p1:PtLike|number[], p2:PtLike|number[] ):number {\n return (p2[0] - p1[0] === 0) ? undefined : (p2[1] - p1[1]) / (p2[0] - p1[0]);\n }\n\n\n /**\n * Calculate the slope and xy intercepts of a line\n * @param p1 line's first end point\n * @param p2 line's second end point\n * @returns an object with `slope`, `xi`, `yi` properties \n */\n static intercept( p1:PtLike|number[], p2:PtLike|number[] ):{ slope:number, xi:number, yi:number } {\n if (p2[0] - p1[0] === 0) {\n return undefined;\n } else {\n let m = (p2[1] - p1[1]) / (p2[0] - p1[0]);\n let c = p1[1] - m * p1[0];\n return { slope: m, yi: c, xi: (m===0) ? undefined : -c/m };\n }\n }\n\n\n /**\n * Given a 2D path and a point, find whether the point is on left or right side of the line\n * @param line a Group of at least 2 Pts\n * @param pt a Pt\n * @returns a negative value if on left and a positive value if on right. If collinear, then the return value is 0.\n */\n static sideOfPt2D( line:GroupLike, pt:PtLike ):number {\n return (line[1][0] - line[0][0]) * (pt[1] - line[0][1]) - (pt[0] - line[0][0]) * (line[1][1] - line[0][1]);\n }\n\n\n /**\n * Check if three Pts are collinear, ie, on the same straight path.\n * @param p1 first Pt\n * @param p2 second Pt\n * @param p3 third Pt\n * @param threshold a threshold where a smaller value means higher precision threshold for the straight line. Default is 0.01.\n */\n static collinear( p1:PtLike|number[], p2:PtLike|number[], p3:PtLike|number[], threshold:number=0.01 ):boolean {\n // Use cross product method\n let a = new Pt(0,0,0).to(p1).$subtract( p2 );\n let b = new Pt(0,0,0).to(p1).$subtract( p3 ); \n return a.$cross( b ).divide(1000).equals( new Pt(0,0,0), threshold );\n }\n\n\n /**\n * Get magnitude of a line segment\n * @param line a Group of at least 2 Pts\n */\n static magnitude( line:GroupLike ):number {\n return (line.length >= 2) ? line[1].$subtract( line[0] ).magnitude() : 0;\n }\n\n\n /**\n * Get squared magnitude of a line segment\n * @param line a Group of at least 2 Pts\n */\n static magnitudeSq( line:GroupLike ):number {\n return (line.length >= 2) ? line[1].$subtract( line[0] ).magnitudeSq() : 0;\n }\n\n\n /**\n * Find a point on a line that is perpendicular (shortest distance) to a target point\n * @param pt a target Pt \n * @param ln a group of Pts that defines a line\n * @param asProjection if true, this returns the projection vector instead. Default is false.\n * @returns a Pt on the line that is perpendicular to the target Pt, or a projection vector if `asProjection` is true.\n */\n static perpendicularFromPt( line:GroupLike, pt:PtLike|number[], asProjection:boolean=false ):Pt {\n if (line[0].equals(line[1])) return undefined;\n let a = line[0].$subtract( line[1] );\n let b = line[1].$subtract( pt );\n let proj = b.$subtract( a.$project( b ) );\n\n return (asProjection) ? proj : proj.$add( pt );\n }\n\n\n /**\n * Given a line and a point, find the shortest distance from the point to the line\n * @param line a Group of 2 Pts\n * @param pt a Pt\n * @see `Line.perpendicularFromPt`\n */\n static distanceFromPt( line:GroupLike, pt:PtLike|number[] ):number {\n return Line.perpendicularFromPt( line, pt, true ).magnitude();\n }\n\n\n /**\n * Given two lines as rays (infinite lines), find their intersection point if any.\n * @param la a Group of 2 Pts representing a ray\n * @param lb a Group of 2 Pts representing a ray\n * @returns an intersection Pt or undefined if no intersection\n */\n static intersectRay2D( la:GroupLike, lb:GroupLike ):Pt {\n\n let a = Line.intercept( la[0], la[1] );\n let b = Line.intercept( lb[0], lb[1] );\n\n let pa = la[0];\n let pb = lb[0];\n\n if (a == undefined) {\n if (b == undefined) return undefined;\n // one of them is vertical line, while the other is not, so they will intersect\n let y1 = -b.slope * (pb[0] - pa[0]) + pb[1]; // -slope * x + y\n return new Pt( pa[0], y1 );\n\n } else {\n // diff slope, or b slope is vertical line\n if (b == undefined) {\n let y1 = -a.slope * (pa[0] - pb[0]) + pa[1];\n return new Pt( pb[0], y1 );\n\n } else if (b.slope != a.slope) {\n let px = (a.slope * pa[0] - b.slope * pb[0] + pb[1] - pa[1]) / (a.slope - b.slope);\n let py = a.slope * ( px - pa[0] ) + pa[1];\n return new Pt( px, py );\n \n } else {\n if (a.yi == b.yi) { // exactly along the same path\n return new Pt( pa[0], pa[1] );\n } else {\n return undefined;\n }\n }\n }\n }\n\n\n /**\n * Given two line segemnts, find their intersection point if any.\n * @param la a Group of 2 Pts representing a line segment\n * @param lb a Group of 2 Pts representing a line segment\n * @returns an intersection Pt or undefined if no intersection\n */\n static intersectLine2D( la:GroupLike, lb:GroupLike ):Pt {\n let pt = Line.intersectRay2D( la, lb );\n return ( pt && Geom.withinBound( pt, la[0], la[1] ) && Geom.withinBound(pt, lb[0], lb[1]) ) ? pt : undefined;\n }\n\n\n /**\n * Given a line segemnt and a ray (infinite line), find their intersection point if any.\n * @param line a Group of 2 Pts representing a line segment\n * @param ray a Group of 2 Pts representing a ray\n * @returns an intersection Pt or undefined if no intersection\n */\n static intersectLineWithRay2D( line:GroupLike, ray:GroupLike ):Pt {\n let pt = Line.intersectRay2D( line, ray );\n return ( pt && Geom.withinBound( pt, line[0], line[1] )) ? pt : undefined;\n }\n\n\n /**\n * Given a line segemnt and a ray (infinite line), find its intersection point(s) with a polygon.\n * @param lineOrRay a Group of 2 Pts representing a line or ray\n * @param poly a Group of Pts representing a polygon\n * @param sourceIsRay a boolean value to treat the line as a ray (infinite line). Default is `false`.\n */\n static intersectPolygon2D( lineOrRay:GroupLike, poly:GroupLike[], sourceIsRay:boolean=false ):Group {\n let fn = sourceIsRay ? Line.intersectLineWithRay2D : Line.intersectLine2D; \n let pts = new Group();\n for (let i=0, len=poly.length; i<len; i++) {\n let d = fn( poly[i], lineOrRay );\n if (d) pts.push( d ); \n }\n return (pts.length > 0) ? pts : undefined;\n } \n\n\n /**\n * Get two intersection Pts of a ray with a 2D grid point\n * @param ray a ray specified by 2 Pts\n * @param gridPt a Pt on the grid\n * @returns a group of two intersecting Pts. The first one is horizontal intersection and the second one is vertical intersection.\n */\n static intersectGridWithRay2D( ray:GroupLike, gridPt:PtLike|number[] ):Group {\n let t = Line.intercept( new Pt( ray[0] ).subtract( gridPt ), new Pt( ray[1] ).subtract( gridPt ) );\n let g = new Group();\n if (t && t.xi) g.push( new Pt( gridPt[0] + t.xi, gridPt[1] ) );\n if (t && t.yi) g.push( new Pt( gridPt[0], gridPt[1] + t.yi ) );\n return g;\n } \n\n\n /**\n * Get two intersection Pts of a line segment with a 2D grid point\n * @param ray a ray specified by 2 Pts\n * @param gridPt a Pt on the grid\n * @returns a group of two intersecting Pts. The first one is horizontal intersection and the second one is vertical intersection.\n */\n static intersectGridWithLine2D( line:GroupLike, gridPt:PtLike|number[] ):Group {\n let g = Line.intersectGridWithRay2D( line, gridPt );\n let gg = new Group();\n for (let i=0, len=g.length; i<len; i++) {\n if ( Geom.withinBound( g[i], line[0], line[1] ) ) gg.push( g[i] );\n }\n return gg;\n }\n\n\n /**\n * Quick way to check rectangle intersection. \n * For more optimized implementation, store the rectangle's sides separately (eg, `Rectangle.sides()`) and use `Polygon.intersect2D()`.\n * @param line a Group representing a line\n * @param rect a Group representing a rectangle\n */\n static intersectRect2D( line:GroupLike, rect:GroupLike ):Group {\n return Rectangle.intersectRect2D( Line.toRect(line), rect );\n }\n\n\n /**\n * Get evenly distributed points on a line\n * @param line a Group representing a line\n * @param num number of points to get\n */\n static subpoints( line:GroupLike|number[][], num:number ) {\n let pts = new Group();\n for (let i=1; i<=num; i++) {\n pts.push( Geom.interpolate( line[0], line[1], i/(num+1) ) );\n }\n return pts;\n }\n\n\n /**\n * Crop this line by a circle or rectangle at end point.\n * @param line line to crop\n * @param size size of circle or rectangle as Pt\n * @param index line's end point index, ie, 0 = start and 1 = end.\n * @param cropAsCircle a boolean to specify whether the `size` parameter should be treated as circle. Default is `true`.\n * @return an intersecting point on the line that can be used for cropping.\n */\n static crop( line:GroupLike, size:PtLike, index:number=0, cropAsCircle:boolean=true ):Pt {\n let tdx = (index === 0) ? 1 : 0;\n let ls = line[tdx].$subtract( line[index] );\n if (ls[0] === 0 || size[0] === 0) return line[index];\n\n if (cropAsCircle) {\n let d = ls.unit().multiply( size[1] );\n return line[index].$add( d );\n\n } else {\n let rect = Rectangle.fromCenter( line[index], size );\n let sides = Rectangle.sides( rect );\n let sideIdx = 0;\n\n if ( Math.abs( ls[1]/ls[0] ) > Math.abs( size[1]/size[0] ) ) {\n sideIdx = (ls[1] < 0) ? 0 : 2;\n } else {\n sideIdx = (ls[0] < 0) ? 3 : 1;\n }\n return Line.intersectRay2D( sides[sideIdx], line );\n\n }\n }\n\n /**\n * Create an marker arrow or line, placed at an end point of this line\n * @param line line to place marker\n * @param size size of the marker as Pt\n * @param graphic either \"arrow\" or \"line\"\n * @param atTail a boolean, if `true`, the marker will be positioned at tail of the line (ie, index = 1). Default is `true`.\n * @returns a Group that defines the marker's shape\n */\n static marker( line:GroupLike, size:PtLike, graphic:string=(\"arrow\"||\"line\"), atTail:boolean=true ):Group {\n let h = atTail ? 0 : 1;\n let t = atTail ? 1 : 0;\n let unit = line[h].$subtract( line[t] );\n if (unit.magnitudeSq() === 0) return new Group();\n unit.unit();\n \n let ps = Geom.perpendicular( unit ).multiply( size[0] ).add( line[t] );\n if (graphic == \"arrow\") {\n ps.add( unit.$multiply( size[1]) );\n return new Group( line[t], ps[0], ps[1] );\n } else {\n return new Group( ps[0], ps[1] );\n }\n\n }\n\n /**\n * Convert this line to a rectangle representation\n * @param line a Group representing a line\n */\n static toRect( line:GroupLike ) {\n return new Group( line[0].$min( line[1] ), line[0].$max( line[1] ) );\n }\n\n}\n\n\n\n/**\n * Rectangle class provides static functions to create and operate on rectangles. A rectangle is usually represented as a Group of 2 Pts, marking the top-left and bottom-right corners of the rectangle.\n * You can use the static function as-is, or apply the `op` method in Group or Pt to many of these functions.\n * See [Op guide](../../guide/Op-0400.html) for details.\n */\nexport class Rectangle {\n\n /**\n * Same as `Rectangle.fromTopLeft`\n */\n static from( topLeft:PtLike|number[], widthOrSize:number|PtLike, height?:number ):Group {\n return Rectangle.fromTopLeft( topLeft, widthOrSize, height );\n }\n\n\n /**\n * Create a rectangle given a top-left position and a size\n * @param topLeft top-left point\n * @param widthOrSize width as a number, or a Pt that defines its size\n * @param height optional height as a number\n */\n static fromTopLeft( topLeft:PtLike|number[], widthOrSize:number|PtLike, height?:number ):Group {\n let size = (typeof widthOrSize == \"number\") ? [widthOrSize, (height||widthOrSize) ] : widthOrSize;\n return new Group(new Pt(topLeft), new Pt(topLeft).add( size ) );\n }\n\n\n /**\n * Create a rectangle given a center position and a size\n * @param topLeft top-left point\n * @param widthOrSize width as a number, or a Pt that defines its size\n * @param height optional height as a number\n */\n static fromCenter( center:PtLike|number[], widthOrSize:number|PtLike, height?:number ):Group {\n let half = (typeof widthOrSize == \"number\") ? [ widthOrSize/2, (height||widthOrSize)/2 ] : new Pt(widthOrSize).divide(2);\n return new Group(new Pt(center).subtract(half), new Pt(center).add(half));\n }\n\n\n /**\n * Convert this rectangle to a circle that fits within the rectangle\n * @returns a Group that represents a circle\n * @see `Circle`\n */\n static toCircle( pts:GroupLike ):Group {\n return Circle.fromRect( pts );\n }\n\n \n /**\n * Create a square that either fits within or encloses a rectangle\n * @param pts a Group of 2 Pts representing a rectangle\n * @param enclose if `true`, the square will enclose the rectangle. Default is `false`, which will fit the square inside the rectangle.\n */\n static toSquare( pts:GroupLike, enclose=false ):Group {\n let s = Rectangle.size( pts );\n let m = (enclose) ? s.maxValue().value : s.minValue().value;\n return Rectangle.fromCenter( Rectangle.center(pts), m, m );\n }\n\n\n /**\n * Get the size of this rectangle as a Pt\n * @param pts a Group of 2 Pts representing a Rectangle\n */\n static size( pts:GroupLike ):Pt {\n return pts[0].$max( pts[1] ).subtract( pts[0].$min( pts[1] ) );\n }\n\n\n /**\n * Get the center of this rectangle \n * @param pts a Group of 2 Pts representing a Rectangle\n */\n static center( pts:GroupLike ):Pt {\n let min = pts[0].$min( pts[1] );\n let max = pts[0].$max( pts[1] );\n return min.add( max.$subtract( min ).divide( 2 ) );\n }\n\n\n /**\n * Get the 4 corners of this rectangle as a Group\n * @param rect a Group of 2 Pts representing a Rectangle\n */\n static corners( rect:GroupLike ):Group {\n let p0 = rect[0].$min(rect[1]);\n let p2 = rect[0].$max(rect[1]);\n return new Group(p0, new Pt(p2.x, p0.y), p2, new Pt(p0.x, p2.y));\n }\n\n\n /**\n * Get the 4 sides of this rectangle as an array of 4 Groups\n * @param rect a Group of 2 Pts representing a Rectangle\n * @returns an array of 4 Groups, each of which represents a line segment\n */\n static sides( rect:GroupLike ):Group[] {\n let [p0, p1, p2, p3] = Rectangle.corners( rect );\n return [\n new Group( p0, p1 ), new Group( p1, p2 ),\n new Group( p2, p3 ), new Group( p3, p0 )\n ];\n }\n\n \n /**\n * Same as `Rectangle.sides`\n */\n static lines( rect:GroupLike ): Group[] {\n return Rectangle.sides( rect );\n }\n \n\n /**\n * Given an array of rectangles, get a rectangle that bounds all of them\n * @param rects an array of Groups that represent rectangles\n * @returns the bounding rectangle as a Group\n */\n static boundingBox( rects:GroupLike[] ):Group {\n let merged = Util.flatten( rects, false );\n let min = Pt.make( 2, Number.MAX_VALUE );\n let max = Pt.make( 2, Number.MIN_VALUE );\n\n // calculate min max in a single pass\n for (let i=0, len=merged.length; i<len; i++) {\n for (let k=0; k<2; k++) {\n min[k] = Math.min( min[k], merged[i][k] );\n max[k] = Math.max( max[k], merged[i][k] );\n }\n }\n return new Group( min, max );\n }\n\n\n /**\n * Convert this rectangle into a Group representing a polygon\n * @param rect a Group of 2 Pts representing a Rectangle\n */\n static polygon( rect:GroupLike ):Group {\n return Rectangle.corners( rect );\n }\n\n\n /**\n * Subdivide a rectangle into 4 rectangles, one for each quadrant\n * @param rect a Group of 2 Pts representing a Rectangle\n * @returns an array of 4 Groups of rectangles\n */\n static quadrants( rect:GroupLike, center?:PtLike ):Group[] {\n let corners = Rectangle.corners( rect );\n let _center = (center!=undefined) ? new Pt(center) : Rectangle.center( rect );\n return corners.map( (c) => new Group(c, _center).boundingBox() );\n }\n\n\n /**\n * Subdivde a rectangle into 2 rectangles, by row or by column\n * @param rect Group of 2 Pts representing a Rectangle\n * @param ratio a value between 0 to 1 to indicate the split ratio\n * @param asRows if `true`, split into 2 rows. Default is `false` which splits into 2 columns.\n * @returns an array of 2 Groups of rectangles\n */\n static halves( rect:GroupLike, ratio:number=0.5, asRows:boolean=false ):Group[] {\n let min = rect[0].$min( rect[1] );\n let max = rect[0].$max( rect[1] );\n let mid = (asRows) ? Num.lerp( min[1], max[1], ratio ) : Num.lerp( min[0], max[0], ratio );\n return (asRows) \n ? [new Group( min, new Pt(max[0],mid) ), new Group( new Pt(min[0],mid), max )]\n : [new Group( min, new Pt(mid,max[1]) ), new Group( new Pt(mid,min[1]), max )];\n }\n\n\n /**\n * Check if a point is within a rectangle\n * @param rect a Group of 2 Pts representing a Rectangle\n * @param pt the point to check\n */\n static withinBound( rect:GroupLike, pt:PtLike ):boolean {\n return Geom.withinBound( pt, rect[0], rect[1] );\n }\n\n\n /**\n * Check if a rectangle is within the bounds of another rectangle\n * @param rect1 a Group of 2 Pts representing a rectangle\n * @param rect2 a Group of 2 Pts representing a rectangle\n */\n static hasIntersectRect2D( rect1:GroupLike, rect2:GroupLike ):boolean {\n let pts = Rectangle.corners( rect1 );\n for (let i=0, len=pts.length; i<len; i++) {\n if (Geom.withinBound( pts[i], rect2[0], rect2[1])) return true;\n }\n return false;\n }\n\n\n /**\n * Quick way to check rectangle intersection. \n * For more optimized implementation, store the rectangle's sides separately (eg, `Rectangle.sides()`) and use `Polygon.intersect2D()`.\n * @param rect1 a Group of 2 Pts representing a rectangle\n * @param rect2 a Group of 2 Pts representing a rectangle\n */\n static intersectRect2D( rect1:GroupLike, rect2:GroupLike ):Group {\n return Util.flatten(\n Polygon.intersect2D( Rectangle.sides( rect1 ), Rectangle.sides( rect2 ) )\n );\n }\n\n}\n\n\n\n/**\n * Circle class provides static functions to create and operate on circles. A circle is usually represented as a Group of 2 Pts, where the first Pt specifies the center, and the second Pt specifies the radius.\n * You can use the static function as-is, or apply the `op` method in Group or Pt to many of these functions.\n * See [Op guide](../../guide/Op-0400.html) for details.\n */\nexport class Circle {\n \n\n /**\n * Create a circle that either fits within or encloses a rectangle\n * @param pts a Group of 2 Pts representing a rectangle\n * @param enclose if `true`, the circle will enclose the rectangle. Default is `false`, which will fit the circle inside the rectangle.\n */\n static fromRect( pts:GroupLike, enclose=false ):Group {\n let r = 0;\n let min = r = Rectangle.size( pts ).minValue().value / 2;\n if (enclose) {\n let max = Rectangle.size( pts ).maxValue().value / 2;\n r = Math.sqrt( min*min + max*max );\n } else {\n r = min;\n }\n return new Group( Rectangle.center( pts ), new Pt(r, r) );\n }\n\n\n /**\n * Create a circle based on a center point and a radius\n * @param pt center point of circle\n * @param radius radius of circle\n */\n static fromCenter( pt:PtLike, radius:number ):Group {\n return new Group( new Pt(pt), new Pt(radius, radius) );\n }\n\n\n /**\n * Check if a point is within a circle\n * @param pts a Group of 2 Pts representing a circle\n * @param pt the point to checks\n * @param threshold an optional small number to set threshold. Default is 0.\n */\n static withinBound( pts:GroupLike, pt:PtLike, threshold:number=0 ):boolean {\n let d = pts[0].$subtract( pt );\n return d.dot(d) + threshold < pts[1].x * pts[1].x;\n }\n\n\n /**\n * Get the intersection points between a circle and a ray (infinite line)\n * @param pts a Group of 2 Pts representing a circle\n * @param ray a Group of 2 Pts representing a ray \n * @returns a Group of intersection points, or an empty Group if no intersection is found\n */\n static intersectRay2D( pts:GroupLike, ray:GroupLike ):Group {\n let d = ray[0].$subtract( ray[1] );\n let f = pts[0].$subtract( ray[0] );\n\n let a = d.dot( d );\n let b = f.dot( d );\n let c = f.dot( f ) - pts[1].x * pts[1].x;\n let p = b/a;\n let q = c/a;\n let disc = p * p - q; // discriminant\n\n if (disc < 0) {\n return new Group();\n } else {\n let discSqrt = Math.sqrt( disc );\n\n let t1 = -p + discSqrt;\n let p1 = ray[0].$subtract( d.$multiply( t1 ) );\n if (disc === 0) return new Group( p1 );\n\n let t2 = -p - discSqrt;\n let p2 = ray[0].$subtract( d.$multiply( t2 ) );\n return new Group( p1, p2 );\n }\n }\n\n\n /**\n * Get the intersection points between a circle and a line segment\n * @param pts a Group of 2 Pts representing a circle\n * @param ray a Group of 2 Pts representing a line\n * @returns a Group of intersection points, or an empty Group if no intersection is found\n */\n static intersectLine2D( pts:GroupLike, line:GroupLike ):Group {\n let ps = Circle.intersectRay2D( pts, line );\n let g = new Group();\n if (ps.length > 0) {\n for (let i=0, len=ps.length; i<len; i++) {\n if (Rectangle.withinBound( line, ps[i] )) g.push( ps[i] );\n }\n }\n return g;\n }\n\n\n /**\n * Get the intersection points between two circles\n * @param pts a Group of 2 Pts representing a circle\n * @param circle a Group of 2 Pts representing a circle\n * @returns a Group of intersection points, or an empty Group if no intersection is found\n */\n static intersectCircle2D( pts:GroupLike, circle:GroupLike ):Group {\n let dv = circle[0].$subtract( pts[0] );\n let dr2 = dv.magnitudeSq();\n let dr = Math.sqrt( dr2 );\n\n let ar = pts[1].x;\n let br = circle[1].x;\n let ar2 = ar * ar;\n let br2 = br * br;\n\n\n if ( dr > ar + br ) { // not intersected\n return new Group();\n } else if ( dr < Math.abs( ar - br ) ) { // completely enclosed\n return new Group( pts[0].clone() );\n } else {\n let a = (ar2 - br2 + dr2) / (2 * dr);\n let h = Math.sqrt( ar2 - a*a );\n let p = dv.$multiply( a/dr ).add( pts[0] );\n return new Group( \n new Pt( p.x + h*dv.y/dr, p.y - h*dv.x/dr ),\n new Pt( p.x - h*dv.y/dr, p.y + h*dv.x/dr )\n );\n }\n }\n\n\n /**\n * Quick way to check rectangle intersection with a circle. \n * For more optimized implementation, store the rectangle's sides separately (eg, `Rectangle.sides()`) and use `Polygon.intersect2D()`.\n * @param pts a Group of 2 Pts representing a circle\n * @param rect a Group of 2 Pts representing a rectangle\n * @returns a Group of intersection points, or an empty Group if no intersection is found\n */\n static intersectRect2D( pts:GroupLike, rect:GroupLike ):Group {\n let sides = Rectangle.sides( rect );\n let g = [];\n for (let i=0, len=sides.length; i<len; i++) {\n let ps = Circle.intersectLine2D( pts, sides[i] );\n if (ps.length > 0) g.push( ps );\n }\n return Util.flatten( g );\n }\n\n\n /**\n * Convert this cirlce to a rectangle that encloses this circle\n * @param pts a Group of 2 Pts representing a circle\n */\n static toRect( pts:GroupLike ):Group {\n let r = pts[1][0];\n return new Group( pts[0].$subtract( r ), pts[0].$add( r ) );\n }\n\n\n /**\n * Convert this cirlce to a rectangle that fits within this circle\n * @param pts a Group of 2 Pts representing a circle\n */\n static toInnerRect( pts:GroupLike ):Group {\n let r = pts[1][0];\n let half = Math.sqrt(r*r)/2;\n return new Group( pts[0].$subtract(half), pts[0].$add( half ) );\n }\n\n\n /**\n * Convert this cirlce to a triangle that fits within this circle\n * @param pts a Group of 2 Pts representing a circle\n */\n static toInnerTriangle( pts:GroupLike ):Group {\n let ang = -Math.PI/2;\n let inc = Math.PI * 2/3;\n let g = new Group();\n for (let i=0; i<3; i++) {\n g.push( pts[0].clone().toAngle( ang, pts[1][0], true ) );\n ang += inc;\n }\n return g;\n }\n\n}\n\n\n\n/**\n * Triangle class provides static functions to create and operate on trianges. A triange is usually represented as a Group of 3 Pts.\n * You can use the static function as-is, or apply the `op` method in Group or Pt to many of these functions.\n * See [Op guide](../../guide/Op-0400.html) for details.\n */\nexport class Triangle {\n \n /**\n * Create a triangle from a rectangle. The triangle will be isosceles, with the bottom of the rectangle as its base.\n * @param rect a Group of 2 Pts representing a rectangle\n */\n static fromRect( rect:GroupLike ):Group {\n let top = rect[0].$add( rect[1] ).divide(2);\n top.y = rect[0][1];\n let left = rect[1].clone();\n left.x = rect[0][0];\n return new Group( top, rect[1].clone(), left );\n }\n\n\n /**\n * Create a triangle that fits within a circle\n * @param circle a Group of 2 Pts representing a circle\n */\n static fromCircle( circle:GroupLike ):Group {\n return Circle.toInnerTriangle( circle );\n }\n\n\n /**\n * Create an equilateral triangle based on a center point and a size\n * @param pt the center point\n * @param size size is the magnitude of lines from center to the triangle's vertices, like a \"radius\".\n */\n static fromCenter( pt:PtLike, size:number ):Group {\n return Triangle.fromCircle( Circle.fromCenter( pt, size ) );\n }\n\n\n /**\n * Get the medial, which is an inner triangle formed by connecting the midpoints of this triangle's sides\n * @param pts a Group of Pts\n * @returns a Group representing a medial triangle\n */\n static medial( pts:GroupLike ):Group {\n if (pts.length < 3) return _errorLength( new Group(), 3 );\n return Polygon.midpoints( pts, true );\n }\n\n\n /**\n * Given a point of the triangle, the opposite side is the side which the point doesn't touch.\n * @param pts a Group of Pts\n * @param index a Pt on the triangle group\n * @returns a Group that represents a line of the opposite side\n */\n static oppositeSide( pts:GroupLike, index:number ):Group {\n if (pts.length < 3) return _errorLength( new Group(), 3 );\n if (index === 0) {\n return Group.fromPtArray( [pts[1], pts[2]] );\n } else if (index === 1) {\n return Group.fromPtArray( [pts[0], pts[2]] );\n } else {\n return Group.fromPtArray( [pts[0], pts[1]] );\n }\n }\n\n /**\n * Get a triangle's altitude, which is a line from a triangle's point to its opposite side, and perpendicular to its opposite side.\n * @param pts a Group of Pts\n * @param index a Pt on the triangle group\n * @returns a Group that represents the altitude line\n */\n static altitude( pts:GroupLike, index:number ):Group {\n let opp = Triangle.oppositeSide( pts, index );\n if (opp.length > 1) {\n return new Group( pts[index], Line.perpendicularFromPt( opp, pts[index] ) ); \n } else {\n return new Group();\n }\n }\n\n /**\n * Get orthocenter, which is the intersection point of a triangle's 3 altitudes (the 3 lines that are perpendicular to its 3 opposite sides).\n * @param pts a Group of Pts\n * @returns the orthocenter as a Pt\n */\n static orthocenter( pts:GroupLike ):Pt {\n if (pts.length < 3) return _errorLength( undefined, 3 );\n let a = Triangle.altitude( pts, 0 );\n let b = Triangle.altitude( pts, 1 );\n return Line.intersectRay2D( a, b );\n }\n\n /**\n * Get incenter, which is the center point of its inner circle, and also the intersection point of its 3 angle bisector lines (each of which cuts one of the 3 angles in half).\n * @param pts a Group of Pts\n * @returns the incenter as a Pt\n */\n static incenter( pts:GroupLike ):Pt {\n if (pts.length < 3) return _errorLength( undefined, 3 );\n let a = Polygon.bisector( pts, 0 ).add( pts[0] );\n let b = Polygon.bisector( pts, 1 ).add( pts[1] );\n return Line.intersectRay2D( new Group(pts[0], a), new Group(pts[1], b) );\n }\n\n /**\n * Get an interior circle, which is the largest circle completed enclosed by this triangle\n * @param pts a Group of Pts\n * @param center Optional parameter if the incenter is already known. Otherwise, leave it empty and the incenter will be calculated\n */\n static incircle( pts:GroupLike, center?:Pt ):Group {\n let c = (center) ? center : Triangle.incenter( pts );\n let area = Polygon.area( pts );\n let perim = Polygon.perimeter( pts, true );\n let r = 2 * area / perim.total;\n return Circle.fromCenter( c, r );\n }\n\n /**\n * Get circumcenter, which is the intersection point of its 3 perpendicular bisectors lines ( each of which divides a side in half and is perpendicular to the side)\n * @param pts a Group of Pts\n * @returns the circumcenter as a Pt\n */\n static circumcenter( pts:GroupLike ):Pt {\n let md = Triangle.medial( pts );\n let a = [ md[0], Geom.perpendicular( pts[0].$subtract( md[0] )).p1.$add( md[0] ) ];\n let b = [ md[1], Geom.perpendicular( pts[1].$subtract( md[1] )).p1.$add( md[1] ) ];\n return Line.intersectRay2D( a, b );\n } \n\n /**\n * Get circumcenter, which is the intersection point of its 3 perpendicular bisectors lines ( each of which divides a side in half and is perpendicular to the side)\n * @param pts a Group of Pts\n * @param center Optional parameter if the circumcenter is already known. Otherwise, leave it empty and the circumcenter will be calculated \n */\n static circumcircle( pts:GroupLike, center?:Pt ):Group {\n let c = (center) ? center : Triangle.circumcenter( pts );\n let r = pts[0].$subtract( c ).magnitude();\n return Circle.fromCenter( c, r );\n }\n}\n\n\n\n/**\n * Polygon class provides static functions to create and operate on polygons. A polygon is usually represented as a Group of 3 or more Pts.\n * You can use the static function as-is, or apply the `op` method in Group or Pt to many of these functions.\n * See [Op guide](../../guide/Op-0400.html) for details.\n */\nexport class Polygon {\n\n /**\n * Get the centroid of a polygon, which is the average of all its points.\n * @param pts a Group of Pts representing a polygon\n */\n static centroid( pts:GroupLike ):Pt {\n return Geom.centroid( pts );\n }\n\n /**\n * Get the line segments in this polygon\n * @param pts a Group of Pts\n * @param closePath a boolean to specify whether the polygon should be closed (ie, whether the final segment should be counted).\n * @returns an array of Groups which has 2 Pts in each group\n */\n static lines( pts:GroupLike, closePath:boolean=false ):Group[] {\n if (pts.length < 2) return _errorLength( new Group(), 2 );\n let sp = Util.split( pts, 2, 1 );\n if (closePath) sp.push( new Group( pts[pts.length-1], pts[0]) );\n return sp.map( (g) => g as Group );\n }\n\n /**\n * Get a new polygon group that is derived from midpoints in this polygon\n * @param pts a Group of Pts\n * @param closePath a boolean to specify whether the polygon should be closed (ie, whether the final segment should be counted).\n * @param t a value between 0 to 1 for interpolation. Default to 0.5 which will get the middle point.\n */\n static midpoints( pts:GroupLike, closePath:boolean=false, t:number=0.5 ):Group {\n if (pts.length < 2) return _errorLength( new Group(), 2 );\n let sides = Polygon.lines( pts, closePath );\n let mids = sides.map( (s) => Geom.interpolate( s[0], s[1], t) );\n return mids as Group;\n }\n\n /**\n * Given a Pt in the polygon group, the adjacent sides are the two sides which the Pt touches.\n * @param pts a group of Pts\n * @param index the target Pt\n * @param closePath a boolean to specify whether the polygon should be closed (ie, whether the final segment should be counted).\n */\n static adjacentSides( pts:GroupLike, index:number, closePath:boolean=false ):Group[] {\n if (pts.length < 2) return _errorLength( new Group(), 2 );\n if (index < 0 || index >= pts.length) return _errorOutofBound( new Group(), index );\n\n let gs = [];\n let left = index-1;\n if (closePath && left < 0) left = pts.length-1;\n if (left >= 0) gs.push( new Group( pts[index], pts[left]) );\n\n let right = index+1;\n if (closePath && right > pts.length-1) right = 0;\n if (right <= pts.length-1) gs.push( new Group( pts[index], pts[right]) );\n\n return gs;\n }\n\n\n /**\n * Get a bisector which is a line that split between two sides of a polygon equally. \n * @param pts a group of Pts\n * @param index the Pt in the polygon to bisect from\n * @param closePath a boolean to specify whether the polygon should be closed (ie, whether the final segment should be counted).\n * @returns a bisector Pt that's a normalized unit vector\n */\n static bisector( pts:GroupLike, index:number ):Pt {\n \n let sides = Polygon.adjacentSides( pts, index, true );\n if (sides.length >= 2) {\n let a = sides[0][1].$subtract( sides[0][0] ).unit();\n let b = sides[1][1].$subtract( sides[1][0] ).unit();\n return a.add( b ).divide( 2 ); \n } else {\n return undefined;\n }\n\n }\n \n\n /**\n * Find the perimeter of this polygon, ie, the lengths of its sides.\n * @param pts a group of Pts\n * @param closePath a boolean to specify whether the polygon should be closed (ie, whether the final segment should be counted).\n * @returns an object with `total` length, and `segments` which is a Pt that stores each segment's length\n */\n static perimeter( pts:GroupLike, closePath:boolean=false ):{total:number, segments:Pt} {\n if (pts.length < 2) return _errorLength( new Group(), 2 );\n let lines = Polygon.lines( pts, closePath );\n let mag = 0;\n let p = Pt.make( lines.length, 0 );\n\n for (let i=0, len=lines.length; i<len; i++) {\n let m = Line.magnitude( lines[i] );\n mag += m;\n p[i] = m;\n }\n\n return {\n total: mag,\n segments: p\n };\n }\n\n \n /**\n * Find the area of a *convex* polygon.\n * @param pts a group of Pts\n */\n static area( pts:GroupLike ) {\n if (pts.length < 3) return _errorLength( new Group(), 3 );\n // determinant\n let det = (a, b) => a[0] * b[1] - a[1] * b[0];\n\n let area = 0;\n for (let i=0, len=pts.length; i<len; i++) {\n if (i < pts.length-1) {\n area += det( pts[i], pts[i+1]);\n } else { \n area += det( pts[i], pts[0] );\n }\n }\n return Math.abs( area/2 );\n }\n\n /**\n * Get a convex hull of the point set using Melkman's algorithm\n * (Reference: http://geomalgorithms.com/a12-_hull-3.html)\n * @param pts a group of Pt\n * @param sorted a boolean value to indicate if the group is pre-sorted by x position. Default is false.\n * @returns a group of Pt that defines the convex hull polygon\n */\n static convexHull( pts:GroupLike, sorted:boolean=false ): Group {\n if (pts.length < 3) return _errorLength( new Group(), 3 );\n\n if (!sorted) {\n pts = pts.slice();\n pts.sort( (a,b) => a[0]-b[0] );\n } \n\n // check if is on left of ray a-b\n let left = (a, b, c) => {\n return (b[0] - a[0]) * (c[1] - a[1]) - (c[0] - a[0]) * (b[1] - a[1]) > 0;\n };\n \n // double end queue\n let dq = [];\n let bot = pts.length - 2;\n let top = bot + 3;\n dq[bot] = pts[2];\n dq[top] = pts[2];\n\n // first 3 pt as counter-clockwise triangle\n if ( left( pts[0], pts[1], pts[2]) ) {\n dq[bot+1] = pts[0];\n dq[bot+2] = pts[1];\n } else {\n dq[bot+1] = pts[1];\n dq[bot+2] = pts[0];\n }\n\n // remaining pts\n for (let i=3, len=pts.length; i<len; i++) {\n let pt = pts[i];\n \n // if inside the hull\n if ( left( dq[bot], dq[bot+1], pt ) && left(dq[top-1], dq[top], pt)) {\n continue;\n }\n\n // rightmost tangent\n while ( !left(dq[bot], dq[bot+1], pt)) { bot += 1; }\n bot -= 1;\n dq[bot] = pt;\n \n // leftmost tangent\n while ( !left( dq[top-1], dq[top], pt)) { top -= 1; }\n top += 1;\n dq[top] = pt;\n }\n\n let hull = new Group();\n for (let h=0; h<(top-bot); h++) {\n hull.push( dq[bot+h] );\n }\n\n return hull;\n\n }\n\n\n /**\n * Find intersection points of 2 polygons\n * @param poly a Group representing a polygon\n * @param linesOrRays an array of Groups representing lines\n * @param sourceIsRay a boolean value to treat the line as a ray (infinite line). Default is `false`.\n */\n static intersect2D( poly:GroupLike[], linesOrRays:GroupLike[], sourceIsRay:boolean=false):Group[] {\n let groups = [];\n for (let i=0, len=linesOrRays.length; i<len; i++) {\n let _ip = Line.intersectPolygon2D( linesOrRays[i], poly, sourceIsRay );\n if (_ip) groups.push( _ip );\n }\n return groups;\n }\n\n\n /**\n * Given a point in the polygon as an origin, get an array of lines that connect all the remaining points to the origin point.\n * @param pts a Group representing a polygon\n * @param originIndex the origin point's index in the polygon\n */\n static network( pts:GroupLike, originIndex:number=0 ):Group[] {\n let g = [];\n for (let i=0, len=pts.length; i<len; i++) {\n if (i != originIndex) g.push( new Group( pts[originIndex], pts[i] ) );\n }\n return g;\n }\n\n\n /**\n * Given a target Pt, find a Pt in a Group that's nearest to it.\n * @param pts a Group of Pt\n * @param pt Pt to check\n * @returns an index in the pts indicating the nearest Pt, or -1 if none found\n */\n static nearestPt( pts:GroupLike, pt:PtLike ):number {\n let _near = Number.MAX_VALUE;\n let _item = -1;\n for (let i=0, len=pts.length; i<len; i++) {\n let d = pts[i].$subtract( pt ).magnitudeSq();\n if (d < _near) {\n _near = d;\n _item = i;\n }\n }\n return _item;\n }\n\n\n /**\n * Get a bounding box for each polygon group, as well as a union bounding-box for all groups\n * @param polys an array of Groups, or an array of Pt arrays\n */\n static toRects( poly:GroupLike[] ):GroupLike[] {\n let boxes = poly.map( (g) => Geom.boundingBox(g) );\n let merged = Util.flatten( boxes, false );\n boxes.unshift( Geom.boundingBox( merged ) );\n return boxes;\n }\n\n}\n\n\n\n/**\n * Curve class provides static functions to interpolate curves. A curve is usually represented as a Group of 3 control points.\n * You can use the static function as-is, or apply the `op` method in Group or Pt to many of these functions.\n * See [Op guide](../../guide/Op-0400.html) for details.\n */\nexport class Curve {\n\n /**\n * Get a precalculated coefficients per step\n * @param steps number of steps\n */\n static getSteps( steps:number ):Group {\n let ts = new Group();\n for (let i=0; i<=steps; i++) {\n let t = i/steps;\n ts.push( new Pt(t*t*t, t*t, t, 1) );\n }\n return ts;\n }\n\n /**\n * Given an index for the starting position in a Pt group, get the control and/or end points of a curve segment\n * @param pts a group of Pt\n * @param index start index in `pts` array. Default is 0.\n * @param copyStart an optional boolean value to indicate if the start index should be used twice. Default is false.\n * @returns a group of 4 Pts\n */\n static controlPoints( pts:GroupLike, index:number=0, copyStart:boolean=false):Group {\n if (index > pts.length-1) return new Group();\n let _index = (i) => (i < pts.length-1) ? i : pts.length-1;\n\n let p0 = pts[index];\n index = (copyStart) ? index : index+1;\n\n // get points based on index\n return new Group(\n p0, pts[ _index(index++) ],\n pts[ _index(index++) ], pts[ _index(index++) ]\n );\n }\n\n /**\n * Calulcate weighted sum to get the interpolated points\n * @param ctrls anchors\n * @param params parameters\n */\n static _calcPt( ctrls:GroupLike, params:PtLike ):Pt {\n let x = ctrls.reduce( (a, c, i) => a + c.x*params[i], 0 );\n let y = ctrls.reduce( (a, c, i) => a + c.y*params[i], 0 );\n if (ctrls[0].length > 2) {\n let z = ctrls.reduce( (a, c, i) => a + c.z*params[i], 0 );\n return new Pt( x, y, z );\n }\n return new Pt( x, y );\n }\n\n /**\n * Create a Catmull-Rom curve. Catmull-Rom is a kind of Cardinal curve with smooth-looking curve.\n * @param pts a group of anchor Pt\n * @param steps the number of line segments per curve. Defaults to 10 steps.\n * @returns a curve as a group of interpolated Pt\n */\n static catmullRom( pts:GroupLike, steps:number=10 ):Group {\n if (pts.length < 2) return new Group();\n\n let ps = new Group();\n let ts = Curve.getSteps( steps );\n\n // use first point twice\n let c = Curve.controlPoints( pts, 0, true );\n for (let i=0; i<=steps; i++) {\n ps.push( Curve.catmullRomStep( ts[i], c ) );\n }\n\n let k = 0;\n while ( k < pts.length-2 ) {\n let cp = Curve.controlPoints( pts, k );\n if (cp.length > 0) {\n for (let i=0; i<=steps; i++) {\n ps.push( Curve.catmullRomStep( ts[i], cp ) );\n }\n k++;\n }\n }\n\n return ps;\n }\n\n\n /**\n * Interpolate to get a point on Catmull-Rom curve\n * @param step the coefficients [t*t*t, t*t, t, 1]\n * @param ctrls a group of anchor Pts\n * @return an interpolated Pt on the curve\n */\n static catmullRomStep( step:Pt, ctrls:GroupLike ):Pt {\n /*\n * Basis Matrix (http://mrl.nyu.edu/~perlin/courses/fall2002/hw/12.html)\n * [-0.5, 1.5, -1.5, 0.5],\n * [ 1 , -2.5, 2 ,-0.5],\n * [-0.5, 0 , 0.5, 0 ],\n * [ 0 , 1 , 0 , 0 ]\n */\n\n let m = new Group(\n new Pt(-0.5, 1, -0.5, 0),\n new Pt(1.5, -2.5, 0, 1),\n new Pt(-1.5, 2, 0.5, 0),\n new Pt( 0.5, -0.5, 0, 0 )\n );\n\n return Curve._calcPt( ctrls, Mat.multiply( [step], m, true )[0] );\n }\n\n /**\n * Create a Cardinal spline curve\n * @param pts a group of anchor Pt\n * @param steps the number of line segments per curve. Defaults to 10 steps.\n * @param tension optional value between 0 to 1 to specify a \"tension\". Default to 0.5 which is the tension for Catmull-Rom curve.\n * @returns a curve as a group of interpolated Pt\n */\n static cardinal( pts:GroupLike, steps:number=10, tension=0.5 ):Group {\n if (pts.length < 2) return new Group();\n\n let ps = new Group();\n let ts = Curve.getSteps( steps );\n\n // use first point twice\n let c = Curve.controlPoints( pts, 0, true );\n for (let i=0; i<=steps; i++) {\n ps.push( Curve.cardinalStep( ts[i], c, tension ) );\n }\n\n let k = 0;\n while ( k < pts.length-2 ) {\n let cp = Curve.controlPoints( pts, k );\n if (cp.length > 0) {\n for (let i=0; i<=steps; i++) {\n ps.push( Curve.cardinalStep( ts[i], cp, tension ) );\n }\n k++;\n }\n }\n\n return ps;\n }\n\n /**\n * Interpolate to get a point on Catmull-Rom curve\n * @param step the coefficients [t*t*t, t*t, t, 1]\n * @param ctrls a group of anchor Pts\n * @param tension optional value between 0 to 1 to specify a \"tension\". Default to 0.5 which is the tension for Catmull-Rom curve\n * @return an interpolated Pt on the curve\n */\n static cardinalStep( step:Pt, ctrls:GroupLike, tension:number=0.5 ):Pt {\n /*\n * Basis Matrix (http://algorithmist.wordpress.com/2009/10/06/cardinal-splines-part-4/)\n * [ -s 2-s s-2 s ]\n * [ 2s s-3 3-2s -s ]\n * [ -s 0 s 0 ]\n * [ 0 1 0 0 ]\n */\n\n let m = new Group(\n new Pt( -1, 2, -1, 0),\n new Pt( -1, 1, 0, 0),\n new Pt( 1, -2, 1, 0),\n new Pt( 1, -1, 0, 0)\n );\n\n let h = Mat.multiply( [step], m, true )[0].multiply( tension );\n let h2 = (2*step[0] - 3*step[1] + 1);\n let h3 = -2*step[0] + 3*step[1];\n\n let pt = Curve._calcPt( ctrls, h );\n\n pt.x += h2*ctrls[1].x + h3*ctrls[2].x;\n pt.y += h2*ctrls[1].y + h3*ctrls[2].y;\n if (pt.length > 2) pt.z += h2*ctrls[1].z + h3*ctrls[2].z;\n\n return pt;\n }\n\n\n /**\n * Create a Bezier curve. In a cubic bezier curve, the first and 4th anchors are end-points, and 2nd and 3rd anchors are control-points.\n * @param pts a group of anchor Pt\n * @param steps the number of line segments per curve. Defaults to 10 steps.\n * @returns a curve as a group of interpolated Pt\n */\n static bezier( pts:GroupLike, steps:number=10 ) {\n\n if (pts.length < 4) return new Group();\n\n let ps = new Group();\n let ts = Curve.getSteps( steps );\n\n let k = 0;\n while ( k < pts.length-3 ) {\n let c = Curve.controlPoints( pts, k );\n if (c.length > 0) {\n for (let i=0; i<=steps; i++) {\n ps.push( Curve.bezierStep( ts[i], c ) );\n }\n\n // go to the next set of point, but assume current end pt is next start pt\n k+=3;\n }\n }\n\n return ps;\n }\n\n /**\n * Interpolate to get a point on a cubic Bezier curve\n * @param step the coefficients [t*t*t, t*t, t, 1]\n * @param ctrls a group of anchor Pts\n * @return an interpolated Pt on the curve\n */\n static bezierStep( step:Pt, ctrls:GroupLike ) {\n /*\n * Bezier basis matrix\n * [ -1, 3, -3, 1 ]\n * [ 3, -6, 3, 0 ]\n * [ -3, 3, 0, 0 ]\n * [ 1, 0, 0, 0 ]\n */\n\n let m = new Group(\n new Pt( -1, 3, -3, 1),\n new Pt( 3, -6, 3, 0),\n new Pt( -3, 3, 0, 0),\n new Pt( 1, 0, 0, 0)\n );\n\n return Curve._calcPt( ctrls, Mat.multiply( [step], m, true )[0] );\n }\n\n /**\n * Create a B-spline curve\n * @param pts a group of anchor Pt\n * @param steps the number of line segments per curve. Defaults to 10 steps.\n * @param tension optional value between 0 to n to specify a \"tension\". Default is 1 which is the usual tension.\n * @returns a curve as a group of interpolated Pt\n */\n static bspline( pts:GroupLike, steps:number=10, tension:number=1 ):Group {\n if (pts.length < 2) return new Group();\n\n let ps = new Group();\n let ts = Curve.getSteps( steps );\n\n\n let k = 0;\n while ( k < pts.length-3 ) {\n let c = Curve.controlPoints( pts, k );\n if (c.length > 0) {\n if (tension !== 1) {\n for (let i=0; i<=steps; i++) {\n ps.push( Curve.bsplineTensionStep( ts[i], c, tension ) );\n }\n } else {\n for (let i=0; i<=steps; i++) {\n ps.push( Curve.bsplineStep( ts[i], c ) );\n }\n }\n k++;\n }\n }\n\n return ps;\n }\n\n /**\n * Interpolate to get a point on a B-spline curve\n * @param step the coefficients [t*t*t, t*t, t, 1]\n * @param ctrls a group of anchor Pts\n * @return an interpolated Pt on the curve\n */ \n static bsplineStep( step:Pt, ctrls:GroupLike ):Pt {\n /*\n * Basis matrix:\n * [ -1.0/6.0, 3.0/6.0, -3.0/6.0, 1.0/6.0 ],\n * [ 3.0/6.0, -6.0/6.0, 3.0/6.0, 0.0 ],\n * [ -3.0/6.0, 0.0, 3.0/6.0, 0.0 ],\n * [ 1.0/6.0, 4.0/6.0, 1.0/6.0, 0.0 ]\n */\n\n let m = new Group(\n new Pt( -0.16666666666666666, 0.5, -0.5, 0.16666666666666666),\n new Pt( 0.5, -1, 0, 0.6666666666666666),\n new Pt( -0.5, 0.5, 0.5, 0.16666666666666666),\n new Pt( 0.16666666666666666, 0, 0, 0)\n );\n\n return Curve._calcPt( ctrls, Mat.multiply( [step], m, true )[0] );\n }\n\n /**\n * Interpolate to get a point on a B-spline curve\n * @param step the coefficients [t*t*t, t*t, t, 1]\n * @param ctrls a group of anchor Pts\n * @param tension optional value between 0 to n to specify a \"tension\". Default to 1 which is the usual tension.\n * @return an interpolated Pt on the curve\n */ \n static bsplineTensionStep( step:Pt, ctrls:GroupLike, tension:number=1 ):Pt {\n /*\n * Basis matrix:\n * [ -1/6a, 2 - 1.5a, 1.5a - 2, 1/6a ]\n * [ 0.5a, 2a-3, 3-2.5a 0 ]\n * [ -0.5a, 0, 0.5a, 0 ]\n * [ 1/6a, 1 - 1/3a, 1/6a, 0 ]\n */\n\n let m = new Group(\n new Pt( -0.16666666666666666, 0.5, -0.5, 0.16666666666666666),\n new Pt( -1.5, 2, 0, -0.3333333333333333),\n new Pt( 1.5, -2.5, 0.5, 0.16666666666666666),\n new Pt( 0.16666666666666666, 0, 0, 0)\n );\n\n let h = Mat.multiply( [step], m, true )[0].multiply( tension );\n let h2 = (2*step[0] - 3*step[1] + 1);\n let h3 = -2*step[0] + 3*step[1];\n\n let pt = Curve._calcPt( ctrls, h );\n\n pt.x += h2*ctrls[1].x + h3*ctrls[2].x;\n pt.y += h2*ctrls[1].y + h3*ctrls[2].y;\n if (pt.length > 2) pt.z += h2*ctrls[1].z + h3*ctrls[2].z;\n\n return pt;\n } \n\n}\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/Op.ts","// Source code licensed under Apache License 2.0. \n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\n\n\nimport { Const } from \"./Util\";\nimport { Curve } from \"./Op\";\nimport { Pt, PtLike, Group, GroupLike } from \"./Pt\";\nimport { Vec, Mat } from \"./LinearAlgebra\";\n\n/**\n * Num class provides various helper functions for basic numeric operations\n */\nexport class Num {\n\n /**\n * Check if two numbers are equal or almost equal within a threshold\n * @param a number a\n * @param b number b\n * @param threshold a threshold within which the two numbers are considered equal\n */\n static equals( a:number, b:number, threshold=0.00001 ):boolean {\n return Math.abs( a-b ) < threshold;\n }\n\n\n /**\n * Linear interpolation\n * @param a start value\n * @param b end value\n * @param t usually a value between 0 to 1\n */\n static lerp( a:number, b:number, t:number ):number {\n return (1 - t) * a + t * b;\n }\n\n\n /**\n * Clamp values between min and max\n * @param val value to clamp\n * @param min min value\n * @param max max value\n */\n static clamp( val:number, min:number, max:number ):number {\n return Math.max(min, Math.min(max, val));\n }\n\n\n /**\n * Different from Num.clamp in that the value out-of-bound will be \"looped back\" to the other end.\n * @param val value to bound\n * @param min min value\n * @param max max value\n * @example `boundValue(361, 0, 360)` will return 1\n */\n static boundValue( val:number, min:number, max:number ):number {\n let len = Math.abs(max - min);\n let a = val % len;\n\n if (a > max) a -= len;\n else if (a < min) a += len;\n\n return a;\n }\n\n\n /**\n * Check if a value is within \n * @param p \n * @param a \n * @param b \n */\n static within( p:number, a:number, b:number ):boolean {\n return p >= Math.min(a, b) && p <= Math.max(a, b);\n }\n\n\n /**\n * Get a random number within a range\n * @param a range value 1\n * @param b range value 2\n */\n static randomRange( a:number, b:number = 0 ):number {\n let r = (a > b) ? (a - b) : (b - a);\n return a + Math.random() * r;\n }\n\n\n /**\n * Normalize a value within a range\n * @param n the value to normalize\n * @param a range value 1\n * @param b range value 1\n */\n static normalizeValue(n:number, a:number, b:number):number {\n let min = Math.min(a, b);\n let max = Math.max(a, b);\n return (n - min) / (max - min);\n }\n\n\n /**\n * Sum a group of numeric arrays\n * @param pts an array of numeric arrays\n * @returns a array of sums\n */\n static sum(pts: GroupLike|number[][]): Pt {\n let c = new Pt( pts[0] );\n for (let i = 1, len = pts.length; i < len; i++) {\n Vec.add(c, pts[i]);\n }\n return c;\n }\n\n\n /**\n * Sum a group of numeric arrays\n * @param pts an array of numeric arrays\n * @returns a array of sums\n */\n static average(pts: GroupLike|number[][]): Pt {\n return Num.sum(pts).divide(pts.length);\n }\n\n\n /**\n * Given a value between 0 to 1, returns a value that cycles between 0 -> 1 -> 0 using sine method.\n * @param t a value between 0 to 1\n * @return a value between 0 to 1\n */\n static cycle( t:number ):number {\n return (Math.sin( Math.PI * 2 * t ) + 1) / 2;\n }\n\n\n /** \n * Map a value from one range to another\n * @param n a value in the first range\n * @param currMin lower bound of the first range\n * @param currMax upper bound of the first range\n * @param targetMin lower bound of the second range\n * @param targetMax upper bound of the second range\n * @returns a remapped value in the second range\n */\n static mapToRange(n:number, currA, currB, targetA, targetB) {\n if (currA == currB) throw new Error(\"[currMin, currMax] must define a range that is not zero\");\n let min = Math.min(targetA, targetB);\n let max = Math.max(targetA, targetB);\n return Num.normalizeValue(n, currA, currB) * (max - min) + min;\n }\n}\n\n\n\n/**\n * Geom class provides various helper functions for basic geometric operations\n */\nexport class Geom {\n\n /**\n * Bound an angle between 0 to 360 degrees\n */\n static boundAngle( angle:number ):number {\n return Num.boundValue(angle, 0, 360);\n }\n\n\n /**\n * Bound a radian between 0 to 2-PI\n */\n static boundRadian( angle:number ):number {\n return Num.boundValue(angle, 0, Const.two_pi);\n }\n\n\n /**\n * Convert an angle in degree to radian\n */\n static toRadian( angle:number ):number {\n return angle * Const.deg_to_rad;\n }\n\n\n /**\n * Convert an angle in radian to degree\n */\n static toDegree( radian:number ):number {\n return radian * Const.rad_to_deg;\n }\n\n\n /**\n * Get a bounding box for a set of Pts\n * @param pts a Group or an array of Pts\n * @return a Group of two Pts, representing the top-left and bottom-right corners.\n */\n static boundingBox( pts:GroupLike ): Group {\n let minPt = pts.reduce((a: Pt, p: Pt) => a.$min(p));\n let maxPt = pts.reduce((a: Pt, p: Pt) => a.$max(p));\n return new Group(minPt, maxPt);\n }\n\n\n /**\n * Get a centroid (the average middle point) for a set of Pts\n * @param pts a Group or an array of Pts\n * @return a centroid Pt \n */\n static centroid( pts:GroupLike|number[][] ):Pt {\n return Num.average(pts);\n }\n\n\n /**\n * Given an anchor Pt, rebase all Pts in this group either to or from this anchor base.\n * @param pts a Group or array of Pt\n * @param ptOrIndex an index for the Pt array, or an external Pt\n * @param direction \"to\" (subtract all Pt with this anchor base) or \"from\" (add all Pt from this anchor base)\n */\n static anchor( pts:GroupLike, ptOrIndex:PtLike|number=0, direction:(\"to\"|\"from\")=\"to\") {\n let method = (direction == \"to\") ? \"subtract\" : \"add\";\n for (let i = 0, len = pts.length; i < len; i++) {\n if (typeof ptOrIndex == \"number\") {\n if (ptOrIndex !== i) pts[i][method](pts[ptOrIndex]);\n } else {\n pts[i][method](ptOrIndex);\n }\n }\n }\n\n\n /**\n * Get an interpolated (or extrapolated) value between two Pts\n * @param a first Pt\n * @param b second Pt\n * @param t a value between 0 to 1 to interpolate, or any other value to extrapolate\n * @returns interpolated point as a new Pt\n */\n static interpolate( a:Pt|number[], b:Pt|number[], t:number=0.5 ):Pt {\n let len = Math.min(a.length, b.length);\n let d = Pt.make(len);\n for (let i = 0; i < len; i++) {\n d[i] = a[i] * (1 - t) + b[i] * t;\n }\n return d;\n }\n\n\n /**\n * Find two Pt that are perpendicular to this Pt (2D)\n * @param axis a string such as \"xy\" (use Const.xy) or an array to specify index for two dimensions\n * @returns an array of two Pt that are perpendicular to this Pt\n */\n static perpendicular( pt:PtLike, axis:string|number[]=Const.xy ):Group {\n let y = axis[1];\n let x = axis[0];\n\n let p = new Pt(pt);\n let pa = new Pt(p);\n pa[x] = -p[y];\n pa[y] = p[x];\n let pb = new Pt(p);\n pb[x] = p[y];\n pb[y] = -p[x];\n\n return new Group(pa, pb);\n }\n\n\n /**\n * Check if two Pts (vectors) are perpendicular to each other \n */\n static isPerpendicular( p1:PtLike, p2:PtLike ):boolean {\n return new Pt(p1).dot(p2) === 0;\n }\n\n\n /**\n * Check if a Pt is within the rectangular boundary defined by two Pts\n * @param pt the Pt to check\n * @param boundPt1 boundary Pt 1\n * @param boundPt2 boundary Pt 2\n */\n static withinBound( pt:PtLike|number[], boundPt1:PtLike|number[], boundPt2:PtLike|number[] ):boolean {\n for (let i = 0, len = Math.min(pt.length, boundPt1.length, boundPt2.length); i < len; i++) {\n if (!Num.within(pt[i], boundPt1[i], boundPt2[i])) return false;\n }\n return true;\n }\n\n\n /**\n * Sort the Pts so that their edges will form a non-overlapping polygon\n * Ref: https://stackoverflow.com/questions/6989100/sort-points-in-clockwise-order\n * @param pts an array of Pts\n */\n static sortEdges( pts:GroupLike ):GroupLike {\n\n let bounds = Geom.boundingBox( pts );\n let center = bounds[1].add(bounds[0]).divide(2);\n \n let fn = ( a:Pt, b:Pt ):number => {\n if (a.length < 2 || b.length < 2) throw new Error( \"Pt dimension cannot be less than 2\");\n\n let da = a.$subtract( center );\n let db = b.$subtract( center );\n \n if (da[0] >= 0 && db[0] < 0) return 1;\n if (da[0] < 0 && db[0] >= 0) return -1;\n if (da[0] == 0 && db[0] == 0) {\n if (da[1] >= 0 || db[1] >= 0)\n return (da[1] > db[1]) ? 1 : -1;\n return (db[1] > da[1]) ? 1 : -1;\n }\n\n // compute the cross product of vectors (center -> a) x (center -> b)\n let det = da.cross2D( db );\n if (det < 0) return 1;\n if (det > 0) return -1;\n \n // points a and b are on the same line from the center\n // check which point is closer to the center\n return (da[0]*da[0] + da[1]*da[1] > db[0]*db[0] + db[1]*db[1]) ? 1 : -1;\n };\n\n return pts.sort( fn );\n }\n\n\n /**\n * Scale a Pt or a Group of Pts\n * @param ps a Pt or a Group of Pts\n * @param scale scale value\n * @param anchor optional anchor point to scale from\n */\n static scale( ps:Pt|GroupLike, scale:number|number[]|PtLike, anchor?:PtLike ):Geom {\n let pts = (!Array.isArray(ps)) ? [ps] : ps;\n let scs = (typeof scale == \"number\") ? Pt.make(pts[0].length, scale) : scale;\n if (!anchor) anchor = Pt.make(pts[0].length, 0);\n\n for (let i = 0, len = pts.length; i < len; i++) {\n let p = pts[i];\n for (let k = 0, lenP = p.length; k < lenP; k++) {\n p[k] = (anchor && anchor[k]) ? anchor[k] + (p[k] - anchor[k]) * scs[k] : p[k] * scs[k];\n }\n }\n\n return Geom;\n }\n\n\n /**\n * Rotate a Pt or a Group of Pts in 2D space\n * @param ps a Pt or a Group of Pts\n * @param angle rotate angle\n * @param anchor optional anchor point to rotate from\n * @param axis optional axis such as \"yz\" to define a 2D plane of rotation\n */\n static rotate2D( ps:Pt|GroupLike, angle:number, anchor?:PtLike, axis?:string ):Geom {\n let pts = (!Array.isArray(ps)) ? [ps] : ps;\n let fn = (anchor) ? Mat.rotateAt2DMatrix : Mat.rotate2DMatrix;\n if (!anchor) anchor = Pt.make(pts[0].length, 0);\n let cos = Math.cos(angle);\n let sin = Math.sin(angle);\n\n for (let i = 0, len = pts.length; i < len; i++) {\n let p = (axis) ? pts[i].$take(axis) : pts[i];\n p.to(Mat.transform2D(p, fn(cos, sin, anchor)));\n }\n\n return Geom;\n }\n\n\n /**\n * Shear a Pt or a Group of Pts in 2D space\n * @param ps a Pt or a Group of Pts\n * @param scale shearing value which can be a number or an array of 2 numbers\n * @param anchor optional anchor point to shear from\n * @param axis optional axis such as \"yz\" to define a 2D plane of shearing\n */\n static shear2D( ps:Pt|GroupLike, scale:number|number[]|PtLike, anchor?:PtLike, axis?:string):Geom {\n let pts = (!Array.isArray(ps)) ? [ps] : ps;\n let s = (typeof scale == \"number\") ? [scale, scale] : scale;\n if (!anchor) anchor = Pt.make(pts[0].length, 0);\n let fn = (anchor) ? Mat.shearAt2DMatrix : Mat.shear2DMatrix;\n let tanx = Math.tan(s[0]);\n let tany = Math.tan(s[1]);\n\n for (let i = 0, len = pts.length; i < len; i++) {\n let p = (axis) ? pts[i].$take(axis) : pts[i];\n p.to(Mat.transform2D(p, fn(tanx, tany, anchor)));\n }\n\n return Geom;\n }\n\n\n /**\n * Reflect a Pt or a Group of Pts along a 2D line\n * @param ps a Pt or a Group of Pts\n * @param line a Group of 2 Pts that defines a line for reflection\n * @param axis optional axis such as \"yz\" to define a 2D plane of reflection\n */\n static reflect2D( ps:Pt|GroupLike, line:GroupLike, axis?:string ):Geom {\n let pts = (!Array.isArray(ps)) ? [ps] : ps;\n\n for (let i = 0, len = pts.length; i < len; i++) {\n let p = (axis) ? pts[i].$take(axis) : pts[i];\n p.to(Mat.transform2D(p, Mat.reflectAt2DMatrix(line[0], line[1])));\n }\n\n return Geom;\n }\n\n\n /**\n * Generate a sine and cosine lookup table\n * @returns an object with 2 tables (array of 360 values) and 2 functions to get sin/cos given a radian parameter. { sinTable:Float64Array, cosTable:Float64Array, sin:(rad)=>number, cos:(rad)=>number }\n */\n static cosTable() {\n let cos = new Float64Array(360);\n\n for (let i = 0; i < 360; i++) cos[i] = Math.cos(i * Math.PI / 180);\n let find = (rad:number) => cos[Math.floor(Geom.boundAngle(Geom.toDegree(rad)))];\n\n return { table: cos, cos: find };\n }\n\n /**\n * Generate a sine and cosine lookup table\n * @returns an object with 2 tables (array of 360 values) and 2 functions to get sin/cos given a radian parameter. { sinTable:Float64Array, cosTable:Float64Array, sin:(rad)=>number, cos:(rad)=>number }\n */\n static sinTable() {\n let sin = new Float64Array(360);\n\n for (let i = 0; i < 360; i++) sin[i] = Math.sin(i * Math.PI / 180);\n let find = (rad:number) => sin[Math.floor(Geom.boundAngle(Geom.toDegree(rad)))];\n\n return { table: sin, sin: find };\n }\n}\n\n\n\n/**\n * Shaping provides various shaping/easing functions to interpolate a value non-linearly.\n */\nexport class Shaping {\n\n /**\n * Linear mapping\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static linear(t:number, c:number = 1):number {\n return c * t;\n }\n\n /** \n * Quadratic in, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static quadraticIn(t:number, c:number = 1):number {\n return c * t * t;\n }\n\n /** \n * Quadratic out, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static quadraticOut(t:number, c:number = 1):number {\n return -c * t * (t - 2);\n }\n\n /** \n * Quadratic in-out, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static quadraticInOut(t:number, c:number = 1):number {\n let dt = t * 2;\n return (t < 0.5) ? c / 2 * t * t * 4 : -c / 2 * ((dt - 1) * (dt - 3) - 1);\n }\n\n /** \n * Cubic in, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static cubicIn(t:number, c:number = 1):number {\n return c * t * t * t;\n }\n\n /** \n * Cubic out, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static cubicOut(t:number, c:number = 1):number {\n let dt = t - 1;\n return c * (dt * dt * dt + 1);\n }\n\n /** \n * Cubic in-out, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static cubicInOut(t:number, c:number = 1):number {\n let dt = t * 2;\n return (t < 0.5) ? c / 2 * dt * dt * dt : c / 2 * ((dt - 2) * (dt - 2) * (dt - 2) + 2);\n }\n\n /** \n * Exponential ease In, adapted from Golan Levin's [polynomial shapers](http://www.flong.com/texts/code/shapers_poly/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n * @parma p a value between 0 to 1 to control the curve. Default is 0.25.\n */\n static exponentialIn(t:number, c:number = 1, p:number = 0.25):number {\n return c * Math.pow(t, 1 / p);\n }\n\n /** \n * Exponential ease out, adapted from Golan Levin's [polynomial shapers](http://www.flong.com/texts/code/shapers_poly/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n * @parma p a value between 0 to 1 to control the curve. Default is 0.25.\n */\n static exponentialOut(t:number, c:number = 1, p:number = 0.25):number {\n return c * Math.pow(t, p);\n }\n\n /** \n * Sinuous in, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static sineIn(t:number, c:number = 1):number {\n return -c * Math.cos(t * Const.half_pi) + c;\n }\n\n /** \n * Sinuous out, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static sineOut(t:number, c:number = 1):number {\n return c * Math.sin(t * Const.half_pi);\n }\n\n /** \n * Sinuous in-out, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static sineInOut(t:number, c:number = 1):number {\n return -c / 2 * (Math.cos(Math.PI * t) - 1);\n }\n\n /** \n * A faster way to approximate cosine ease in-out using Blinn-Wyvill Approximation. Adapated from Golan Levin's [polynomial shaping](http://www.flong.com/texts/code/shapers_poly/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static cosineApprox(t:number, c:number = 1) {\n let t2 = t * t;\n let t4 = t2 * t2;\n let t6 = t4 * t2;\n return c * (4 * t6 / 9 - 17 * t4 / 9 + 22 * t2 / 9);\n }\n\n /** \n * Circular in, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static circularIn(t:number, c:number = 1):number {\n return -c * (Math.sqrt(1 - t * t) - 1);\n }\n\n /** \n * Circular out, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static circularOut(t:number, c:number = 1):number {\n let dt = t - 1;\n return c * Math.sqrt(1 - dt * dt);\n }\n\n /** \n * Circular in-out, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static circularInOut(t:number, c:number = 1):number {\n let dt = t * 2;\n return (t < 0.5) ? -c / 2 * (Math.sqrt(1 - dt * dt) - 1) : c / 2 * (Math.sqrt(1 - (dt - 2) * (dt - 2)) + 1);\n }\n\n /** \n * Elastic in, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n * @parma p elastic parmeter between 0 to 1. The lower the number, the more elastic it will be. Default is 0.7.\n */\n static elasticIn(t:number, c:number = 1, p:number = 0.7):number {\n let dt = t - 1;\n let s = (p / Const.two_pi) * 1.5707963267948966;\n return c * (-Math.pow(2, 10 * dt) * Math.sin((dt - s) * Const.two_pi / p));\n }\n\n /** \n * Elastic out, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n * @parma p elastic parmeter between 0 to 1. The lower the number, the more elastic it will be. Default is 0.7.\n */\n static elasticOut(t:number, c:number = 1, p:number = 0.7):number {\n let s = (p / Const.two_pi) * 1.5707963267948966;\n return c * (Math.pow(2, -10 * t) * Math.sin((t - s) * Const.two_pi / p)) + c;\n }\n\n /** \n * Elastic in-out, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n * @parma p elastic parmeter between 0 to 1. The lower the number, the more elastic it will be. Default is 0.6.\n */\n static elasticInOut(t:number, c:number = 1, p:number = 0.6):number {\n let dt = t * 2;\n let s = (p / Const.two_pi) * 1.5707963267948966;\n if (t < 0.5) {\n dt -= 1;\n return c * (-0.5 * (Math.pow(2, 10 * dt) * Math.sin((dt - s) * Const.two_pi / p)));\n } else {\n dt -= 1;\n return c * (0.5 * (Math.pow(2, -10 * dt) * Math.sin((dt - s) * Const.two_pi / p))) + c;\n }\n }\n\n /** \n * Bounce in, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static bounceIn(t:number, c:number = 1):number {\n return c - Shaping.bounceOut((1 - t), c);\n }\n\n /** \n * Bounce out, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static bounceOut(t:number, c:number = 1) {\n if (t < (1 / 2.75)) {\n return c * (7.5625 * t * t);\n } else if (t < (2 / 2.75)) {\n t -= 1.5 / 2.75;\n return c * (7.5625 * t * t + 0.75);\n } else if (t < (2.5 / 2.75)) {\n t -= 2.25 / 2.75;\n return c * (7.5625 * t * t + 0.9375);\n } else {\n t -= 2.625 / 2.75;\n return c * (7.5625 * t * t + 0.984375);\n }\n }\n\n /** \n * Bounce in-out, adapted from Robert Penner's [easing functions](http://robertpenner.com/easing/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n */\n static bounceInOut(t:number, c:number = 1):number {\n return (t < 0.5) ? Shaping.bounceIn(t * 2, c) / 2 : Shaping.bounceOut(t * 2 - 1, c) / 2 + c / 2;\n }\n\n /** \n * Sigmoid curve changes its shape adapted from the input value, but always returns a value between 0 to 1.\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n * @parma p the larger the value, the \"steeper\" the curve will be. Default is 10.\n */\n static sigmoid(t:number, c:number = 1, p:number = 10):number {\n let d = p * (t - 0.5);\n return c / (1 + Math.exp(-d));\n }\n\n /** \n * The Logistic Sigmoid is a useful curve. Adapted from Golan Levin's [shaping function](http://www.flong.com/texts/code/shapers_exp/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n * @parma p a parameter between 0 to 1 to control the steepness of the curve. Higher is steeper. Default is 0.7.\n */\n static logSigmoid(t:number, c:number = 1, p:number = 0.7):number {\n p = Math.max(Const.epsilon, Math.min(1 - Const.epsilon, p));\n p = 1 / (1 - p);\n\n let A = 1 / (1 + Math.exp(((t - 0.5) * p * -2)));\n let B = 1 / (1 + Math.exp(p));\n let C = 1 / (1 + Math.exp(-p));\n return c * (A - B) / (C - B);\n }\n\n\n /** \n * An exponential seat curve. Adapted from Golan Levin's [shaping functions](http://www.flong.com/texts/code/shapers_exp/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n * @parma p a parameter between 0 to 1 to control the steepness of the curve. Higher is steeper. Default is 0.5.\n */\n static seat(t:number, c:number = 1, p:number = 0.5):number {\n if ((t < 0.5)) {\n return c * (Math.pow(2 * t, 1 - p)) / 2;\n } else {\n return c * (1 - (Math.pow(2 * (1 - t), 1 - p)) / 2);\n }\n }\n\n\n /** \n * Quadratic bezier curve. Adapted from Golan Levin's [shaping functions](http://www.flong.com/texts/code/shapers_exp/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n * @parma p1 a Pt object specifying the first control Pt, or a value specifying the control Pt's x position (its y position will default to 0.5). Default is `Pt(0.95, 0.95)\n */\n static quadraticBezier(t:number, c:number = 1, p:number|PtLike=[0.05, 0.95] ):number {\n let a:number = (typeof p != \"number\") ? p[0] : p;\n let b:number = (typeof p != \"number\") ? p[1] : 0.5;\n let om2a = 1 - 2 * a;\n if (om2a === 0) {\n om2a = Const.epsilon;\n }\n let d = (Math.sqrt(a * a + om2a * t) - a) / om2a;\n return c * ((1 - 2 * b) * (d * d) + (2 * b) * d);\n }\n\n\n /** \n * Cubic bezier curve. This reuses the bezier functions in Curve class.\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n * @parma p1` a Pt object specifying the first control Pt. Default is `Pt(0.1, 0.7).\n * @parma p2` a Pt object specifying the second control Pt. Default is `Pt(0.9, 0.2).\n */\n static cubicBezier(t:number, c:number = 1, p1:PtLike=[0.1, 0.7], p2:PtLike=[0.9, 0.2] ):number {\n let curve = new Group( new Pt(0, 0), new Pt(p1), new Pt(p2), new Pt(1, 1) );\n return c * Curve.bezierStep(new Pt(t*t*t, t*t, t, 1), Curve.controlPoints(curve)).y;\n }\n\n\n /** \n * Give a Pt, draw a quadratic curve that will pass through that Pt as closely as possible. Adapted from Golan Levin's [shaping functions](http://www.flong.com/texts/code/shapers_poly/)\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n * @parma p1` a Pt object specifying the Pt to pass through. Default is `Pt(0.2, 0.35)\n */\n static quadraticTarget(t:number, c:number = 1, p1:PtLike = [0.2, 0.35]):number {\n let a = Math.min(1 - Const.epsilon, Math.max( Const.epsilon, p1[0] ));\n let b = Math.min(1, Math.max( 0, p1[1] ));\n let A = (1 - b) / (1 - a) - (b / a);\n let B = (A * (a * a) - b) / a;\n let y = A * (t * t) - B * t;\n return c * Math.min(1, Math.max(0, y));\n }\n\n\n /** \n * Step function is a simple jump from 0 to 1 at a specific Pt in time\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n * @parma p usually a value between 0 to 1, which specify the Pt to \"jump\". Default is 0.5 which is in the middle.\n */\n static cliff(t:number, c:number = 1, p:number = 0.5):number {\n return (t > p) ? c : 0;\n }\n\n /** \n * Convert any shaping functions into a series of steps\n * @parma fn the original shaping function\n * @parma steps the number of steps\n * @parma t a value between 0 to 1\n * @parma c the value to shape, default is 1\n * @parma args optional paramters to pass to original function\n */\n static step(fn: Function, steps:number, t:number, c:number, ...args:any[]) {\n let s = 1 / steps;\n let tt = Math.floor(t / s) * s;\n return fn(tt, c, ...args);\n }\n\n}\n\n\n/**\n * Range object keeps track of a Group of n-dimensional Pts to provide its minimum, maximum, and magnitude in each dimension. \n * It also provides convenient functions such as mapping the Group to another range.\n */\nexport class Range {\n\n protected _source:Group;\n protected _max:Pt;\n protected _min:Pt;\n protected _mag:Pt;\n protected _dims:number = 0;\n\n\n /**\n * Construct a Range instance for a Group of Pts, \n * @param g a Group or an array of Pts\n */\n constructor( g:GroupLike ) {\n this._source = Group.fromPtArray( g );\n this.calc();\n }\n\n /**\n * Get this Range's maximum values per dimension\n */\n get max():Pt { return this._max.clone(); }\n \n /**\n * Get this Range's minimum values per dimension\n */\n get min():Pt { return this._min.clone(); }\n \n /**\n * Get this Range's magnitude in each dimension\n */\n get magnitude():Pt { return this._mag.clone(); }\n\n\n /**\n * Go through the group and find its min and max values.\n * Usually you don't need to call this function directly.\n */\n calc():this {\n if (!this._source) return;\n let dims = this._source[0].length;\n this._dims = dims;\n let max = new Pt( dims );\n let min = new Pt( dims );\n let mag = new Pt( dims );\n\n for (let i=0; i<dims; i++) {\n max[i] = Const.min;\n min[i] = Const.max;\n mag[i] = 0;\n\n let s = this._source.zipSlice( i );\n for (let k=0, len=s.length; k<len; k++) {\n max[i] = Math.max( max[i], s[k] );\n min[i] = Math.min( min[i], s[k] );\n mag[i] = max[i] - min[i];\n }\n }\n\n this._max = max;\n this._min = min;\n this._mag = mag;\n return this;\n }\n\n\n /**\n * Map this Range to another range of values\n * @param min target range's minimum value\n * @param max target range's maximum value\n * @param exclude Optional boolean array where `true` means excluding the conversion in that specific dimension.\n */\n mapTo( min:number, max:number, exclude?:boolean[] ):Group {\n let target = new Group();\n for (let i=0, len=this._source.length; i<len; i++) {\n let g = this._source[i];\n let n = new Pt( this._dims );\n for (let k=0; k<this._dims; k++) {\n n[k] = (exclude && exclude[k]) ? g[k] : Num.mapToRange( g[k], this._min[k], this._max[k], min, max ); \n }\n target.push( n ); \n }\n return target;\n }\n\n\n /**\n * Add more Pts to this Range and recalculate its min and max values\n * @param g a Group or an array of Pts to append to this Range\n * @param update Optional. Set the parameter to `false` if you want to append without immediately updating this Range's min and max values. Default is `true`.\n */\n append( g:GroupLike, update:boolean=true ):this {\n if (g[0].length !== this._dims) throw new Error(`Dimensions don't match. ${this._dims} dimensions in Range and ${g[0].length} provided in parameter. `);\n this._source = this._source.concat( g ) as Group;\n if (update) this.calc();\n return this;\n }\n\n\n /**\n * Create a number of evenly spaced \"ticks\" that span this Range's min and max value.\n * @param count number of subdivision. For example, 10 subdivision will return 11 tick values, which include first(min) and last(max) values.\n */\n ticks( count:number ):Group {\n let g = new Group();\n for (let i=0; i<=count; i++) {\n let p = new Pt( this._dims );\n for (let k=0, len=this._max.length; k<len; k++) {\n p[k] = Num.lerp( this._min[k], this._max[k], i/count );\n }\n g.push( p );\n }\n return g;\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/Num.ts","// Source code licensed under Apache License 2.0. \n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\n\n\nimport {Pt, PtLike, GroupLike, Group} from \"./Pt\";\nimport {Line} from \"./Op\";\n\n\n/**\n * Vec provides static function for vector operations. It's not yet optimized but good enough to use.\n */\nexport class Vec {\n\n /**\n * Add b to vector `a`\n * @returns vector `a`\n */\n static add( a:PtLike, b:PtLike|number ):PtLike {\n if (typeof b == \"number\") {\n for (let i=0, len=a.length; i<len; i++) a[i] += b;\n } else {\n for (let i=0, len=a.length; i<len; i++) a[i] += b[i] || 0;\n }\n return a;\n }\n\n /**\n * Subtract `b` from vector `a`\n * @returns vector `a`\n */\n static subtract( a:PtLike, b:PtLike|number ):PtLike {\n if (typeof b == \"number\") {\n for (let i=0, len=a.length; i<len; i++) a[i] -= b;\n } else {\n for (let i=0, len=a.length; i<len; i++) a[i] -= b[i] || 0;\n }\n return a;\n }\n\n /**\n * Multiply `b` with vector `a`\n * @returns vector `a`\n */\n static multiply( a:PtLike, b:PtLike|number ):PtLike {\n if (typeof b == \"number\") {\n for (let i=0, len=a.length; i<len; i++) a[i] *= b;\n } else {\n if (a.length != b.length) {\n throw new Error(`Cannot do element-wise multiply since the array lengths don't match: ${a.toString()} multiply-with ${b.toString()}`);\n }\n for (let i=0, len=a.length; i<len; i++) a[i] *= b[i];\n }\n return a;\n }\n\n\n /**\n * Divide `a` over `b`\n * @returns vector `a`\n */\n static divide( a:PtLike, b:PtLike|number ):PtLike {\n if (typeof b == \"number\") {\n if (b === 0) throw new Error(\"Cannot divide by zero\");\n for (let i=0, len=a.length; i<len; i++) a[i] /= b;\n } else {\n if (a.length != b.length) {\n throw new Error(`Cannot do element-wise divide since the array lengths don't match. ${a.toString()} divide-by ${b.toString()}`);\n }\n for (let i=0, len=a.length; i<len; i++) a[i] /= b[i];\n }\n return a;\n }\n\n\n /**\n * Dot product of `a` and `b`\n */\n static dot( a:PtLike, b:PtLike ):number {\n if (a.length != b.length) throw new Error(\"Array lengths don't match\");\n let d = 0;\n for (let i=0, len=a.length; i<len; i++) {\n d += a[i]*b[i];\n }\n return d;\n } \n\n \n /**\n * 2D cross product of `a` and `b`\n */\n static cross2D( a:PtLike, b:PtLike ):number {\n return a[0]*b[1] - a[1]*b[0];\n }\n\n /**\n * 3D Cross product of `a` and `b`\n */\n static cross( a:PtLike, b:PtLike ):Pt {\n return new Pt( (a[1]*b[2] - a[2]*b[1]), (a[2]*b[0] - a[0]*b[2]), (a[0]*b[1] - a[1]*b[0]) );\n }\n\n\n /**\n * Magnitude of `a`\n */\n static magnitude( a:PtLike ):number {\n return Math.sqrt( Vec.dot( a, a ) );\n }\n\n\n /**\n * Unit vector of `a`. If magnitude of `a` is already known, pass it in the second paramter to optimize calculation.\n */\n static unit( a:PtLike, magnitude:number=undefined ):PtLike {\n let m = (magnitude===undefined) ? Vec.magnitude(a) : magnitude;\n if (m===0) throw new Error(\"Cannot calculate unit vector because magnitude is 0\");\n return Vec.divide( a, m );\n }\n\n\n /**\n * Set `a` to its absolute value in each dimension\n * @returns vector `a`\n */\n static abs( a:PtLike ):PtLike {\n return Vec.map( a, Math.abs );\n }\n\n\n /**\n * Set `a` to its floor value in each dimension\n * @returns vector `a`\n */\n static floor( a:PtLike ):PtLike {\n return Vec.map( a, Math.floor );\n }\n\n\n /**\n * Set `a` to its ceiling value in each dimension\n * @returns vector `a`\n */\n static ceil( a:PtLike ):PtLike {\n return Vec.map( a, Math.ceil );\n }\n\n\n /**\n * Set `a` to its rounded value in each dimension\n * @returns vector `a`\n */\n static round( a:PtLike ):PtLike {\n return Vec.map( a, Math.round );\n }\n\n \n /**\n * Find the max value within a vector's dimensions\n * @returns an object with `value` and `index` that specifies the max value and its corresponding dimension.\n */\n static max( a:PtLike ):{value, index} {\n let m = Number.MIN_VALUE;\n let index = 0;\n for (let i=0, len=a.length; i<len; i++) {\n m = Math.max( m, a[i] );\n if (m === a[i]) index = i;\n }\n return {value: m, index: index};\n }\n\n\n /**\n * Find the min value within a vector's dimensions\n * @returns an object with `value` and `index` that specifies the min value and its corresponding dimension.\n */\n static min( a:PtLike ):{value, index} {\n let m = Number.MAX_VALUE;\n let index = 0;\n for (let i=0, len=a.length; i<len; i++) {\n m = Math.min( m, a[i] );\n if (m === a[i]) index = i;\n }\n return {value: m, index: index};\n }\n\n\n /**\n * Sum all the dimensions' values\n */\n static sum( a:PtLike ):number {\n let s = 0;\n for (let i=0, len=a.length; i<len; i++) s += a[i];\n return s;\n }\n\n\n /**\n * Given a mapping function, update `a`'s value in each dimension\n * @returns vector `a`\n */\n static map( a:PtLike, fn:(n:number, index:number, arr) => number ):PtLike {\n for (let i=0, len=a.length; i<len; i++) {\n a[i] = fn( a[i], i, a );\n }\n return a;\n }\n \n}\n\n\n/**\n * Mat provides static function for matrix operations. It's not yet optimized but good enough to use.\n */\nexport class Mat {\n\n /**\n * Matrix additions. Matrices should have the same rows and columns.\n * @param a a group of Pt\n * @param b a scalar number, an array of numeric arrays, or a group of Pt\n * @returns a group with the same rows and columns as a and b\n */\n static add( a:GroupLike, b:GroupLike|number[][]|number ):Group {\n if ( typeof b != \"number\" ) {\n if (a[0].length != b[0].length) throw new Error(\"Cannot add matrix if rows' and columns' size don't match.\");\n if (a.length != b.length) throw new Error(\"Cannot add matrix if rows' and columns' size don't match.\");\n }\n\n let g = new Group();\n let isNum = typeof b == \"number\"; \n for (let i=0, len=a.length; i<len; i++) {\n g.push( a[i].$add( (isNum) ? b : b[i] ) );\n }\n\n return g;\n }\n\n\n /**\n * Matrix multiplication\n * @param a a Group of M Pts, each with K dimensions (M-rows, K-columns)\n * @param b a scalar number, an array of numeric arrays, or a Group of K Pts, each with N dimensions (K-rows, N-columns) -- or if transposed is true, then N Pts with K dimensions\n * @param transposed (Only applicable if it's not elementwise multiplication) If true, then a and b's columns should match (ie, each Pt should have the same dimensions). Default is `false`.\n * @param elementwise if true, then the multiplication is done element-wise. Default is `false`.\n * @returns If not elementwise, this will return a group with M Pt, each with N dimensions (M-rows, N-columns).\n */\n static multiply( a:GroupLike, b:GroupLike|number[][]|number, transposed:boolean=false, elementwise:boolean=false ):Group {\n \n let g = new Group();\n\n if (typeof b != \"number\") {\n\n if (elementwise) {\n if (a.length != b.length) throw new Error(\"Cannot multiply matrix element-wise because the matrices' sizes don't match.\");\n for (let ai = 0, alen = a.length; ai < alen; ai++) {\n g.push( a[ai].$multiply( b[ai] ) );\n }\n\n } else {\n \n if (!transposed && a[0].length != b.length) throw new Error(\"Cannot multiply matrix if rows in matrix-a don't match columns in matrix-b.\");\n if (transposed && a[0].length != b[0].length) throw new Error(\"Cannot multiply matrix if transposed and the columns in both matrices don't match.\");\n\n if (!transposed) b = Mat.transpose( b );\n\n for (let ai = 0, alen = a.length; ai < alen; ai++) {\n let p = Pt.make( b.length, 0 );\n for (let bi = 0, blen = b.length; bi < blen; bi++) {\n p[bi] = Vec.dot( a[ai], b[bi] );\n }\n g.push(p);\n }\n }\n\n } else {\n for (let ai = 0, alen = a.length; ai < alen; ai++) {\n g.push( a[ai].$multiply(b) );\n }\n }\n\n return g;\n }\n\n\n /**\n * Zip one slice of an array of Pt. Imagine the Pts are organized in rows, then this function will take the values in a specific column.\n * @param g a group of Pt\n * @param idx index to zip at\n * @param defaultValue a default value to fill if index out of bound. If not provided, it will throw an error instead.\n */\n static zipSlice( g:GroupLike|number[][], index:number, defaultValue:number|boolean = false ):Pt {\n let z = [];\n for (let i=0, len=g.length; i<len; i++) {\n if (g[i].length-1 < index && defaultValue === false) throw `Index ${index} is out of bounds`;\n z.push( g[i][index] || defaultValue );\n }\n return new Pt(z);\n }\n\n\n /**\n * Zip a group of Pt. eg, [[1,2],[3,4],[5,6]] => [[1,3,5],[2,4,6]]\n * @param g a group of Pt\n * @param defaultValue a default value to fill if index out of bound. If not provided, it will throw an error instead.\n * @param useLongest If true, find the longest list of values in a Pt and use its length for zipping. Default is false, which uses the first item's length for zipping.\n */\n static zip( g:GroupLike|number[][], defaultValue:number|boolean = false, useLongest=false ):Group {\n let ps = new Group();\n let len:number = (useLongest) ? (g as Array<number[]|Pt>).reduce( (a,b) => Math.max(a, b.length), 0 ) : g[0].length;\n for (let i=0; i<len; i++) {\n ps.push( Mat.zipSlice( g, i, defaultValue ) );\n }\n return ps;\n }\n\n\n /**\n * Same as `zip` function\n */\n static transpose( g:GroupLike|number[][], defaultValue:number|boolean = false, useLongest=false ):Group {\n return Mat.zip( g, defaultValue, useLongest );\n }\n\n\n /**\n * Transform a 2D point given a 2x3 or 3x3 matrix\n * @param pt a Pt to be transformed\n * @param m 2x3 or 3x3 matrix\n * @returns a new transformed Pt\n */\n static transform2D( pt:PtLike, m:GroupLike|number[][] ):Pt {\n let x = pt[0] * m[0][0] + pt[1] * m[1][0] + m[2][0];\n let y = pt[0] * m[0][1] + pt[1] * m[1][1] + m[2][1];\n return new Pt(x, y);\n }\n\n\n /**\n * Get a scale matrix for use in `transform2D`\n */\n static scale2DMatrix( x:number, y:number ):GroupLike {\n return new Group(\n new Pt( x, 0, 0 ),\n new Pt( 0, y, 0 ),\n new Pt( 0, 0, 1 )\n );\n }\n\n\n /**\n * Get a rotate matrix for use in `transform2D`\n */\n static rotate2DMatrix( cosA:number, sinA:number ):GroupLike {\n return new Group(\n new Pt( cosA, sinA, 0 ),\n new Pt( -sinA, cosA, 0, ),\n new Pt( 0, 0, 1 )\n );\n }\n\n\n /**\n * Get a shear matrix for use in `transform2D`\n */\n static shear2DMatrix( tanX:number, tanY:number ):GroupLike {\n return new Group(\n new Pt( 1, tanX, 0 ),\n new Pt( tanY, 1, 0 ),\n new Pt( 0, 0, 1 )\n );\n }\n\n\n /**\n * Get a translate matrix for use in `transform2D`\n */\n static translate2DMatrix( x:number, y:number ):GroupLike {\n return new Group(\n new Pt( 1, 0, 0 ),\n new Pt( 0, 1, 0 ),\n new Pt( x, y, 1 )\n );\n }\n\n\n /**\n * Get a matrix to scale a point from an origin point. For use in `transform2D`\n */\n static scaleAt2DMatrix( sx:number, sy:number, at:PtLike ):GroupLike {\n let m = Mat.scale2DMatrix(sx, sy);\n m[2][0] = -at[0]*sx + at[0];\n m[2][1] = -at[1]*sy + at[1];\n return m;\n }\n\n\n /**\n * Get a matrix to rotate a point from an origin point. For use in `transform2D`\n */\n static rotateAt2DMatrix( cosA:number, sinA:number, at:PtLike ):GroupLike {\n let m = Mat.rotate2DMatrix(cosA, sinA);\n m[2][0] = at[0]*(1-cosA) + at[1]*sinA;\n m[2][1] = at[1]*(1-cosA) - at[0]*sinA;\n return m;\n }\n\n\n /**\n * Get a matrix to shear a point from an origin point. For use in `transform2D`\n */\n static shearAt2DMatrix( tanX:number, tanY:number, at:PtLike ):GroupLike {\n let m = Mat.shear2DMatrix(tanX, tanY);\n m[2][0] = -at[1]*tanY;\n m[2][1] = -at[0]*tanX;\n return m;\n }\n\n\n /**\n * Get a matrix to reflect a point along a line. For use in `transform2D`\n * @param p1 first end point to define the reflection line\n * @param p1 second end point to define the reflection line\n */\n static reflectAt2DMatrix( p1:PtLike, p2:PtLike ) {\n let intercept = Line.intercept( p1, p2 );\n \n if (intercept == undefined) {\n return [\n new Pt( [-1, 0, 0] ),\n new Pt( [0, 1, 0] ),\n new Pt( [p1[0]+p2[0], 0, 1] ) \n ];\n } else {\n\n let yi = intercept.yi;\n let ang2 = Math.atan( intercept.slope ) * 2;\n let cosA = Math.cos( ang2 );\n let sinA = Math.sin( ang2 );\n \n return [\n new Pt( [cosA, sinA, 0] ),\n new Pt( [sinA, -cosA, 0] ),\n new Pt( [-yi*sinA, yi + yi*cosA, 1] )\n ];\n }\n }\n\n \n}\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/LinearAlgebra.ts","// Source code licensed under Apache License 2.0. \r\n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\r\n\r\n\r\nimport {Pt, IPt, Group, GroupLike} from \"./Pt\";\r\n\r\n/**\r\n * Bound is a subclass of Group that represents a rectangular boundary.\r\n * It includes some convenient properties such as `x`, `y`, bottomRight`, `center`, and `size`. \r\n */\r\nexport class Bound extends Group implements IPt {\r\n\r\n protected _center:Pt = new Pt();\r\n protected _size:Pt = new Pt();\r\n protected _topLeft:Pt = new Pt();\r\n protected _bottomRight:Pt = new Pt();\r\n protected _inited = false;\r\n\r\n \r\n /**\r\n * Create a Bound. This is similar to the Group constructor.\r\n * @param args a list of Pt as parameters\r\n */\r\n constructor( ...args:Pt[] ) {\r\n super(...args);\r\n this.init();\r\n }\r\n\r\n\r\n /**\r\n * Create a Bound from a [ClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect) object.\r\n * @param rect an object has top/left/bottom/right/width/height properties\r\n * @returns a Bound object\r\n */\r\n static fromBoundingRect( rect:ClientRect ):Bound {\r\n let b = new Bound( new Pt( rect.left||0, rect.top||0 ), new Pt( rect.right||0, rect.bottom||0 ) );\r\n if (rect.width && rect.height) b.size = new Pt(rect.width, rect.height);\r\n return b;\r\n }\r\n\r\n static fromGroup( g:GroupLike ):Bound {\r\n if (g.length < 2) throw new Error( \"Cannot create a Bound from a group that has less than 2 Pt\" );\r\n return new Bound( g[0], g[g.length-1] );\r\n }\r\n\r\n\r\n /**\r\n * Initiate the bound's properties.\r\n */\r\n protected init() {\r\n if (this.p1) {\r\n this._size = this.p1.clone();\r\n this._inited = true;\r\n } \r\n if (this.p1 && this.p2) {\r\n let a = this.p1;\r\n let b = this.p2;\r\n this.topLeft = a.$min(b);\r\n this._bottomRight = a.$max(b);\r\n this._updateSize();\r\n this._inited = true;\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Clone this bound and return a new one\r\n */\r\n clone():Bound {\r\n return new Bound( this._topLeft.clone(), this._bottomRight.clone() );\r\n }\r\n\r\n \r\n /**\r\n * Recalculte size and center\r\n */\r\n protected _updateSize() {\r\n this._size = this._bottomRight.$subtract( this._topLeft ).abs();\r\n this._updateCenter();\r\n }\r\n\r\n\r\n /**\r\n * Recalculate center\r\n */\r\n protected _updateCenter() {\r\n this._center = this._size.$multiply(0.5).add( this._topLeft );\r\n }\r\n\r\n\r\n /**\r\n * Recalculate based on top-left position and size\r\n */\r\n protected _updatePosFromTop() {\r\n this._bottomRight = this._topLeft.$add( this._size );\r\n this._updateCenter();\r\n }\r\n\r\n\r\n /**\r\n * Recalculate based on bottom-right position and size\r\n */\r\n protected _updatePosFromBottom() {\r\n this._topLeft = this._bottomRight.$subtract( this._size );\r\n this._updateCenter();\r\n }\r\n\r\n\r\n /**\r\n * Recalculate based on center position and size\r\n */\r\n protected _updatePosFromCenter() {\r\n let half = this._size.$multiply(0.5);\r\n this._topLeft = this._center.$subtract( half );\r\n this._bottomRight = this._center.$add( half );\r\n }\r\n\r\n\r\n get size():Pt { return new Pt(this._size); }\r\n set size(p: Pt) { \r\n this._size = new Pt(p); \r\n this._updatePosFromTop();\r\n }\r\n \r\n\r\n get center():Pt { return new Pt(this._center); }\r\n set center( p:Pt ) {\r\n this._center = new Pt(p);\r\n this._updatePosFromCenter();\r\n }\r\n\r\n\r\n get topLeft():Pt { return new Pt(this._topLeft); }\r\n set topLeft( p:Pt ) {\r\n this._topLeft = new Pt(p);\r\n this[0] = this._topLeft;\r\n this._updateSize();\r\n }\r\n\r\n\r\n get bottomRight():Pt { return new Pt(this._bottomRight); }\r\n set bottomRight( p:Pt ) {\r\n this._bottomRight = new Pt(p);\r\n this[1] = this._bottomRight;\r\n this._updateSize();\r\n }\r\n\r\n\r\n get width():number { return (this._size.length > 0) ? this._size.x : 0; }\r\n set width( w:number ) {\r\n this._size.x = w;\r\n this._updatePosFromTop();\r\n }\r\n\r\n\r\n get height():number { return (this._size.length > 1) ? this._size.y : 0; }\r\n set height( h:number ) {\r\n this._size.y = h;\r\n this._updatePosFromTop();\r\n }\r\n\r\n\r\n get depth():number { return (this._size.length > 2) ? this._size.z : 0; }\r\n set depth( d:number ) {\r\n this._size.z = d;\r\n this._updatePosFromTop();\r\n }\r\n \r\n\r\n get x():number { return this.topLeft.x; }\r\n get y():number { return this.topLeft.y; }\r\n get z():number { return this.topLeft.z; }\r\n\r\n\r\n get inited():boolean { return this._inited; }\r\n\r\n /**\r\n * If the Group elements are changed, call this function to update the Bound's properties.\r\n * It's preferable to change the topLeft/bottomRight etc properties instead of changing the Group array directly.\r\n */\r\n update() {\r\n this._topLeft = this[0];\r\n this._bottomRight = this[1];\r\n this._updateSize();\r\n return this;\r\n }\r\n\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/Bound.ts","// Source code licensed under Apache License 2.0. \r\n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\r\n\r\n\r\nimport {Pt, PtLike, GroupLike} from \"./Pt\";\r\nimport {Util} from \"./Util\";\r\n\r\n\r\n/**\r\n* Form is an abstract class that represents a form that's used in a Space for expressions.\r\n*/\r\nexport abstract class Form {\r\n \r\n protected _ready:boolean = false;\r\n \r\n /**\r\n * get whether the Form has received the Space's rendering context\r\n */\r\n get ready():boolean { return this._ready; }\r\n\r\n\r\n /**\r\n * Check number of items in a Group against a required number\r\n * @param pts \r\n */\r\n static _checkSize( pts:GroupLike|number[][], required:number=2 ):boolean {\r\n if (pts.length < required) {\r\n Util.warn( \"Requires 2 or more Pts in this Group.\" );\r\n return false;\r\n } \r\n return true;\r\n }\r\n}\r\n\r\n\r\n\r\n\r\n/**\r\n* VisualForm is an abstract class that represents a form that can be used to express Pts visually.\r\n* For example, CanvasForm is an implementation of VisualForm that draws on CanvasSpace which represents a html canvas.\r\n*/\r\nexport abstract class VisualForm extends Form {\r\n \r\n \r\n protected _filled = true;\r\n get filled():boolean { return this._filled; }\r\n set filled( b:boolean ) { this._filled = b; }\r\n \r\n protected _stroked = true;\r\n get stroked():boolean { return this._stroked; }\r\n set stroked( b:boolean ) { this._stroked = b; }\r\n \r\n protected _font:Font = new Font( 14, \"sans-serif\");\r\n get currentFont():Font { return this._font; }\r\n \r\n \r\n protected _multiple( groups:GroupLike[], shape:string, ...rest ):this {\r\n if (!groups) return this;\r\n for (let i=0, len=groups.length; i<len; i++) {\r\n this[shape]( groups[i], ...rest );\r\n }\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Abstract reset style\r\n */\r\n abstract reset(): this;\r\n \r\n \r\n /**\r\n * Set fill color (not implemented)\r\n */\r\n fill( c:string|boolean ):this {\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Set current fill style and without stroke.\r\n * @example `form.fillOnly(\"#F90\")`, `form.fillOnly(\"rgba(0,0,0,.5\")`\r\n * @param c fill color which can be as color, gradient, or pattern. (See [canvas documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle))\r\n */\r\n fillOnly( c:string|boolean ):this {\r\n this.stroke( false );\r\n return this.fill( c );\r\n }\r\n \r\n \r\n /**\r\n * Set stroke style (not implemented)\r\n */\r\n stroke( c:string|boolean, width?:number, linejoin?:string, linecap?:string ):this {\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Set current stroke style and without fill.\r\n * @example `form.strokeOnly(\"#F90\")`, `form.strokeOnly(\"#000\", 0.5, 'round', 'square')`\r\n * @param c stroke color which can be as color, gradient, or pattern. (See [canvas documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle)\r\n */\r\n strokeOnly( c:string|boolean, width?:number, linejoin?:string, linecap?:string ):this {\r\n this.fill( false );\r\n return this.stroke( c, width, linejoin, linecap );\r\n }\r\n \r\n /**\r\n * Abstract point drawing\r\n * @param p a Pt object\r\n * @param radius radius of the point. Default is 5.\r\n * @param shape The shape of the point. Defaults to \"square\", but it can be \"circle\" or a custom shape function in your own implementation.\r\n * @example `form.point( p )`, `form.point( p, 10, \"circle\" )`\r\n */\r\n abstract point( p:PtLike, radius:number, shape:string ):this;\r\n \r\n \r\n /**\r\n * Draw multiple points at once\r\n * @param pts an array of Pt or an array of number arrays\r\n * @param radius radius of the point. Default is 5.\r\n * @param shape The shape of the point. Defaults to \"square\", but it can be \"circle\" or a custom shape function in your own implementation.\r\n */\r\n points( pts:GroupLike|number[][], radius:number, shape:string ): this {\r\n if (!pts) return;\r\n for (let i=0, len=pts.length; i<len; i++) {\r\n this.point( pts[i], radius, shape );\r\n }\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Abstract circle drawing\r\n * @param pts usually a Group of 2 Pts, but it can also take an array of two numeric arrays [ [position], [size] ]\r\n * @see [`Circle.fromCenter`](./_op_.circle.html#frompt)\r\n */\r\n abstract circle( pts:GroupLike|number[][] ):this;\r\n \r\n \r\n \r\n /**\r\n * Draw multiple circles at once\r\n * @param groups an array of Groups that defines multiple circles\r\n */\r\n circles( groups:GroupLike[] ):this {\r\n return this._multiple( groups, \"circle\" );\r\n }\r\n \r\n \r\n /**\r\n * Draw multiple squares at once\r\n * @param groups an array of Groups that defines multiple circles\r\n */\r\n squares( groups:GroupLike[] ):this {\r\n return this._multiple( groups, \"square\" );\r\n }\r\n \r\n \r\n /**\r\n * Abstract arc drawing\r\n * @param pt center position\r\n * @param radius radius of the arc circle\r\n * @param startAngle start angle of the arc\r\n * @param endAngle end angle of the arc\r\n * @param cc an optional boolean value to specify if it should be drawn clockwise (`false`) or counter-clockwise (`true`). Default is clockwise.\r\n */\r\n abstract arc( pt:PtLike, radius:number, startAngle:number, endAngle:number, cc?:boolean ):this;\r\n \r\n \r\n /**\r\n * Abstract a line or polyline drawing\r\n * @param pts a Group of multiple Pts, or an array of multiple numeric arrays\r\n */\r\n abstract line( pts:GroupLike|number[][] ):this;\r\n \r\n \r\n /**\r\n * Draw multiple lines at once\r\n * @param groups An array of Groups of Pts\r\n */\r\n lines( groups:GroupLike[] ):this {\r\n return this._multiple( groups, \"line\" );\r\n }\r\n \r\n \r\n /**\r\n * Abstract polygon drawing\r\n * @param pts a Group of multiple Pts, or an array of multiple numeric arrays\r\n */\r\n abstract polygon( pts:GroupLike|number[][] ):this;\r\n \r\n \r\n /**\r\n * Draw multiple polygons at once\r\n * @param groups An array of Groups of Pts\r\n */\r\n polygons( groups:GroupLike[] ):this {\r\n return this._multiple( groups, \"polygon\" );\r\n }\r\n \r\n \r\n \r\n /**\r\n * Abstract rectangle drawing\r\n * @param pts usually a Group of 2 Pts specifying the top-left and bottom-right positions. Alternatively it can be an array of numeric arrays.\r\n */\r\n abstract rect( pts:number[][]|Pt[] ):this;\r\n \r\n \r\n /**\r\n * Draw multiple rectangles at once\r\n * @param groups An array of Groups of Pts\r\n */\r\n rects( groups:GroupLike[] ):this {\r\n return this._multiple( groups, \"rect\" );\r\n }\r\n \r\n \r\n /**\r\n * Abstract text rendering\r\n * @param `pt` a Pt or numeric array to specify the anchor point\r\n * @param `txt` text\r\n * @param `maxWidth` specify a maximum width per line\r\n */\r\n abstract text( pt:PtLike, txt:string, maxWidth?:number): this;\r\n \r\n \r\n /**\r\n * Abstract font setting\r\n * @param sizeOrFont either a number to specify font-size, or a `Font` object to specify all font properties\r\n * @param weight Optional font-weight string such as \"bold\"\r\n * @param style Optional font-style string such as \"italic\"\r\n * @param lineHeight Optional line-height number suchas 1.5\r\n * @param family Optional font-family such as \"Helvetica, sans-serif\"\r\n * @see `Font` class\r\n * @example `form.font( myFont )`, `form.font(14, \"bold\")`\r\n */\r\n abstract font( sizeOrFont:number|Font, weight?:string, style?:string, lineHeight?:number, family?:string ):this;\r\n}\r\n\r\n\r\n\r\n/**\r\n* Font class lets you create a specific font style with properties for its size and style\r\n*/\r\nexport class Font {\r\n public size:number;\r\n public lineHeight:number;\r\n public face:string;\r\n public style:string;\r\n public weight:string;\r\n \r\n /**\r\n * Create a font style\r\n * @param size font size. Defaults is 12px.\r\n * @param face Optional font-family, use css-like string such as \"Helvetica\" or \"Helvetica, sans-serif\". Default is \"sans-serif\".\r\n * @param weight Optional font weight such as \"bold\". Default is \"\" (none).\r\n * @param style Optional font style such as \"italic\". Default is \"\" (none).\r\n * @param lineHeight Optional line height. Default is 1.5.\r\n * @example `new Font(12, \"Frutiger, sans-serif\", \"bold\", \"underline\", 1.5)`\r\n */\r\n constructor( size:number=12, face:string=\"sans-serif\", weight:string=\"\", style:string=\"\", lineHeight:number=1.5 ) {\r\n this.size = size;\r\n this.face = face;\r\n this.style = style;\r\n this.weight = weight;\r\n this.lineHeight = lineHeight;\r\n }\r\n \r\n /**\r\n * Get a string representing the font style, in css-like string such as \"italic bold 12px/1.5 sans-serif\"\r\n */\r\n get value():string { return `${this.style} ${this.weight} ${this.size}px/${this.lineHeight} ${this.face}`; }\r\n \r\n \r\n /**\r\n * Get a string representing the font style, in css-like string such as \"italic bold 12px/1.5 sans-serif\"\r\n */\r\n toString():string { return this.value; }\r\n \r\n}\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/Form.ts","// Source code licensed under Apache License 2.0. \r\n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\r\n\r\n\r\nimport {Bound} from \"./Bound\";\r\nimport {Pt, IPt} from \"./Pt\";\r\nimport {Form} from \"./Form\";\r\nimport {UIPointerActions as UIA} from \"./UI\";\r\n\r\nexport type AnimateFunction = ( time?:number, frameTime?:number, currentSpace?:any ) => void;\r\n\r\n\r\n/**\r\n* Interface of a \"player\" object that can be added into a Space\r\n*/\r\nexport interface IPlayer {\r\n animateID?: string;\r\n animate?:AnimateFunction;\r\n resize?( size:IPt, evt?:Event ): undefined;\r\n action?( type:string, px:number, py:number, evt:Event );\r\n start?( bound:Bound, space:Space );\r\n}\r\n\r\nexport interface ISpacePlayers { \r\n [key: string]: IPlayer;\r\n}\r\n\r\nexport interface ITimer {\r\n prev: number;\r\n diff: number;\r\n end: number;\r\n}\r\n\r\n\r\n/**\r\n* Space is an abstract class that represents a general context for expressing Pts.\r\n* See [Space guide](../../guide/Space-0500.html) for details.\r\n*/\r\nexport abstract class Space {\r\n \r\n id: string = \"space\";\r\n protected bound: Bound = new Bound();\r\n \r\n protected _time: ITimer = { prev: 0, diff: 0, end: -1 };\r\n protected players:ISpacePlayers = {};\r\n protected playerCount = 0;\r\n protected _ctx:any;\r\n \r\n private _animID:number = -1;\r\n \r\n private _pause:boolean = false;\r\n private _refresh:boolean = undefined;\r\n private _renderFunc: (context:any, self:Space) => null;\r\n \r\n protected _pointer:Pt = new Pt();\r\n\r\n protected _isReady = false;\r\n protected _playing = false;\r\n \r\n \r\n /**\r\n * Set whether the rendering should be repainted on each frame\r\n * @param b a boolean value to set whether to repaint each frame\r\n */\r\n refresh( b:boolean ):this {\r\n this._refresh = b;\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Add an IPlayer to this space. An IPlayer can define the following callback functions: \r\n * - `animate( time, ftime, space )`\r\n * - `start(bound, space)` \r\n * - `resize( size, event )`\r\n * - `action( type, x, y, event )` \r\n * Subclasses of Space may define other callback functions.\r\n * @param player an IPlayer object with animate function, or simply a function(time, ftime){}\r\n */\r\n add( p:IPlayer|AnimateFunction ):this {\r\n let player:IPlayer = (typeof p == \"function\") ? { animate: p } : p;\r\n \r\n let k = this.playerCount++;\r\n let pid = this.id + k;\r\n \r\n this.players[pid] = player;\r\n player.animateID = pid;\r\n if (player.resize && this.bound.inited) player.resize( this.bound ); \r\n \r\n // if _refresh is not set, set it to true\r\n if (this._refresh === undefined) this._refresh = true;\r\n \r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Remove a player from this Space\r\n * @param player an IPlayer that has an `animateID` property\r\n */\r\n remove( player:IPlayer ):this {\r\n delete this.players[ player.animateID ];\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Remove all players from this Space\r\n */\r\n removeAll():this {\r\n this.players = {};\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Main play loop. This implements window.requestAnimationFrame and calls it recursively. \r\n * Override this `play()` function to implemenet your own animation loop.\r\n * @param time current time\r\n */\r\n play( time=0 ):this {\r\n \r\n this._animID = requestAnimationFrame( this.play.bind(this) );\r\n if (this._pause) return this;\r\n \r\n this._time.diff = time - this._time.prev;\r\n this._time.prev = time;\r\n \r\n try {\r\n this.playItems( time );\r\n } catch (err) {\r\n cancelAnimationFrame( this._animID );\r\n this._playing = false;\r\n throw err;\r\n }\r\n \r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Replay the animation after `stop()`. This resets the end-time counter.\r\n * You may also use `pause()` and `resume()` for temporary pause.\r\n */\r\n replay() {\r\n this._time.end = -1;\r\n this.play();\r\n }\r\n \r\n \r\n /**\r\n * Main animate function. This calls all the items to perform\r\n * @param time current time\r\n */\r\n protected playItems( time: number ) {\r\n\r\n this._playing = true;\r\n \r\n // clear before draw if refresh is true\r\n if (this._refresh) this.clear();\r\n \r\n // animate all players\r\n if (this._isReady) {\r\n for (let k in this.players) {\r\n if (this.players[k].animate) this.players[k].animate( time, this._time.diff, this );\r\n }\r\n }\r\n \r\n // stop if time ended\r\n if (this._time.end >= 0 && time > this._time.end) {\r\n cancelAnimationFrame( this._animID );\r\n this._playing = false;\r\n }\r\n }\r\n \r\n \r\n /**\r\n * Pause the animation\r\n * @param toggle a boolean value to set if this function call should be a toggle (between pause and resume)\r\n */\r\n pause( toggle=false ):this {\r\n this._pause = (toggle) ? !this._pause : true;\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Resume the pause animation\r\n */\r\n resume():this {\r\n this._pause = false;\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Specify when the animation should stop: immediately, after a time period, or never stops.\r\n * @param t a value in millisecond to specify a time period to play before stopping, or `-1` to play forever, or `0` to end immediately. Default is 0 which will stop the animation immediately.\r\n */\r\n stop( t=0 ):this {\r\n this._time.end = t;\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Play animation loop, and then stop after `duration` time has passed.\r\n * @param duration a value in millisecond to specify a time period to play before stopping, or `-1` to play forever\r\n */\r\n playOnce( duration=5000 ):this {\r\n this.play();\r\n this.stop( duration );\r\n return this;\r\n }\r\n \r\n /**\r\n * Custom rendering\r\n * @param context rendering context\r\n */\r\n protected render( context:any ):this {\r\n if (this._renderFunc) this._renderFunc( context, this );\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Set a custom rendering `function(graphics_context, canvas_space)` if needed\r\n */\r\n set customRendering( f:(context:any, self:Space) => null ) { this._renderFunc = f; }\r\n get customRendering():(context:any, self:Space) => null { return this._renderFunc; }\r\n \r\n\r\n /**\r\n * Get a boolean to indicate whether the animation is playing\r\n */\r\n get isPlaying():boolean { return this._playing; }\r\n\r\n\r\n /**\r\n * Get this space's bounding box\r\n */\r\n get outerBound():Bound { return this.bound.clone(); }\r\n \r\n \r\n /**\r\n * The bounding box of the canvas\r\n */\r\n public get innerBound():Bound { return new Bound( Pt.make( this.size.length, 0 ), this.size.clone() ); }\r\n \r\n \r\n /**\r\n * Get the size of this bounding box as a Pt\r\n */\r\n get size():Pt { return this.bound.size.clone(); }\r\n \r\n \r\n /**\r\n * Get the size of this bounding box as a Pt\r\n */\r\n get center():Pt { return this.size.divide(2); }\r\n \r\n \r\n /**\r\n * Get width of canvas\r\n */\r\n get width():number { return this.bound.width; }\r\n \r\n \r\n /**\r\n * Get height of canvas\r\n */\r\n get height():number { return this.bound.height; }\r\n \r\n \r\n /**\r\n * Resize the space\r\n * @param w `width or an IPt object\r\n * @param h height\r\n */\r\n abstract resize( b:IPt, evt?:Event ):this;\r\n \r\n \r\n /**\r\n * clear all contents in the space\r\n */\r\n abstract clear( ):this;\r\n \r\n \r\n /**\r\n * Get a default form for drawing in this space\r\n */\r\n abstract getForm():Form;\r\n \r\n}\r\n\r\nexport type TouchPointsKey = \"touches\" | \"changedTouches\" | \"targetTouches\";\r\n\r\nexport interface MultiTouchElement {\r\n addEventListener( evt:any, callback:Function );\r\n removeEventListener( evt:any, callback:Function );\r\n}\r\n\r\nexport abstract class MultiTouchSpace extends Space {\r\n \r\n // track mouse dragging\r\n protected _pressed = false;\r\n protected _dragged = false;\r\n \r\n protected _hasMouse = false;\r\n protected _hasTouch = false;\r\n \r\n // accept subclasses that implements addEventListener, removeEventListener, dispatchEvent\r\n protected _canvas:EventTarget;\r\n \r\n /**\r\n * Get the mouse or touch pointer that stores the last action\r\n */\r\n public get pointer():Pt {\r\n let p = this._pointer.clone();\r\n p.id = this._pointer.id;\r\n return p;\r\n }\r\n \r\n /**\r\n * Bind event listener in canvas element. You can also use `bindMouse` or `bindTouch` to bind mouse or touch events conveniently.\r\n * @param evt an event string such as \"mousedown\"\r\n * @param callback callback function for this event\r\n */\r\n bindCanvas(evt:string, callback:EventListener) {\r\n this._canvas.addEventListener( evt, callback );\r\n }\r\n \r\n \r\n /**\r\n * Unbind a callback from the event listener\r\n * @param evt an event string such as \"mousedown\"\r\n * @param callback callback function to unbind\r\n */\r\n unbindCanvas(evt:string, callback:EventListener) {\r\n this._canvas.removeEventListener( evt, callback );\r\n }\r\n \r\n \r\n /**\r\n * A convenient method to bind (or unbind) all mouse events in canvas element. All \"players\" added to this space that implements an `action` callback property will receive mouse event callbacks. The types of mouse actions are defined by UIPointerActions constants: \"up\", \"down\", \"move\", \"drag\", \"drop\", \"over\", and \"out\". See `Space`'s `add()` function for more details.\r\n * @param _bind a boolean value to bind mouse events if set to `true`. If `false`, all mouse events will be unbound. Default is true.\r\n * @see Space`'s [`add`](./_space_.space.html#add) function\r\n */\r\n bindMouse( _bind:boolean=true ):this {\r\n if ( _bind) {\r\n this.bindCanvas( \"mousedown\", this._mouseDown.bind(this) );\r\n this.bindCanvas( \"mouseup\", this._mouseUp.bind(this) );\r\n this.bindCanvas( \"mouseover\", this._mouseOver.bind(this) );\r\n this.bindCanvas( \"mouseout\", this._mouseOut.bind(this) );\r\n this.bindCanvas( \"mousemove\", this._mouseMove.bind(this) );\r\n this._hasMouse = true;\r\n } else {\r\n this.unbindCanvas( \"mousedown\", this._mouseDown.bind(this) );\r\n this.unbindCanvas( \"mouseup\", this._mouseUp.bind(this) );\r\n this.unbindCanvas( \"mouseover\", this._mouseOver.bind(this) );\r\n this.unbindCanvas( \"mouseout\", this._mouseOut.bind(this) );\r\n this.unbindCanvas( \"mousemove\", this._mouseMove.bind(this) );\r\n this._hasMouse = false;\r\n }\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * A convenient method to bind (or unbind) all touch events in canvas element. All \"players\" added to this space that implements an `action` callback property will receive mouse event callbacks. The types of mouse actions are: \"up\", \"down\", \"move\", \"drag\", \"drop\", \"over\", and \"out\". \r\n * @param _bind a boolean value to bind touch events if set to `true`. If `false`, all mouse events will be unbound. Default is true.\r\n * @see Space`'s [`add`](./_space_.space.html#add) function\r\n */\r\n bindTouch( _bind:boolean=true ):this {\r\n if (_bind) {\r\n this.bindCanvas( \"touchstart\", this._mouseDown.bind(this) );\r\n this.bindCanvas( \"touchend\", this._mouseUp.bind(this) );\r\n this.bindCanvas( \"touchmove\", this._touchMove.bind(this) );\r\n this.bindCanvas( \"touchcancel\", this._mouseOut.bind(this) );\r\n this._hasTouch = true;\r\n } else {\r\n this.unbindCanvas( \"touchstart\", this._mouseDown.bind(this) );\r\n this.unbindCanvas( \"touchend\", this._mouseUp.bind(this) );\r\n this.unbindCanvas( \"touchmove\", this._touchMove.bind(this) );\r\n this.unbindCanvas( \"touchcancel\", this._mouseOut.bind(this) );\r\n this._hasTouch = false;\r\n }\r\n return this;\r\n }\r\n \r\n \r\n \r\n \r\n /**\r\n * A convenient method to convert the touch points in a touch event to an array of `Pt`.\r\n * @param evt a touch event which contains touches, changedTouches, and targetTouches list\r\n * @param which a string to select a touches list: \"touches\", \"changedTouches\", or \"targetTouches\". Default is \"touches\"\r\n * @return an array of Pt, whose origin position (0,0) is offset to the top-left of this space\r\n */\r\n touchesToPoints( evt:TouchEvent, which:TouchPointsKey=\"touches\" ): Pt[] {\r\n if (!evt || !evt[which]) return [];\r\n let ts = [];\r\n for (var i=0; i<evt[which].length; i++) {\r\n let t = evt[which].item(i);\r\n ts.push( new Pt( t.pageX - this.bound.topLeft.x, t.pageY - this.bound.topLeft.y ) );\r\n }\r\n return ts;\r\n }\r\n \r\n \r\n /**\r\n * Go through all the `players` and call its `action` callback function\r\n * @param type an UIPointerActions constant or string: \"up\", \"down\", \"move\", \"drag\", \"drop\", \"over\", and \"out\"\r\n * @param evt mouse or touch event\r\n */\r\n protected _mouseAction( type:string, evt:MouseEvent|TouchEvent ) {\r\n let px = 0, py = 0;\r\n \r\n if (evt instanceof MouseEvent) {\r\n for (let k in this.players) {\r\n if (this.players.hasOwnProperty(k)) {\r\n let v = this.players[k];\r\n px = evt.pageX - this.outerBound.x;\r\n py = evt.pageY - this.outerBound.y;\r\n if (v.action) v.action( type, px, py, evt );\r\n }\r\n }\r\n } else {\r\n for (let k in this.players) {\r\n if (this.players.hasOwnProperty(k)) {\r\n let v = this.players[k];\r\n let c = evt.changedTouches && evt.changedTouches.length > 0;\r\n let touch = evt.changedTouches.item(0);\r\n px = (c) ? touch.pageX - this.outerBound.x : 0;\r\n py = (c) ? touch.pageY - this.outerBound.y : 0;\r\n if (v.action) v.action( type, px, py, evt );\r\n }\r\n }\r\n }\r\n if (type) {\r\n this._pointer.to( px, py );\r\n this._pointer.id = type;\r\n }\r\n }\r\n \r\n \r\n /**\r\n * MouseDown handler\r\n * @param evt \r\n */\r\n protected _mouseDown( evt:MouseEvent|TouchEvent ) {\r\n this._mouseAction( UIA.down, evt );\r\n this._pressed = true;\r\n return false;\r\n }\r\n \r\n \r\n /**\r\n * MouseUp handler\r\n * @param evt \r\n */\r\n protected _mouseUp( evt:MouseEvent|TouchEvent ) {\r\n this._mouseAction( UIA.up, evt );\r\n if (this._dragged) this._mouseAction( UIA.down, evt );\r\n this._pressed = false;\r\n this._dragged = false;\r\n return false;\r\n }\r\n \r\n \r\n /**\r\n * MouseMove handler\r\n * @param evt \r\n */\r\n protected _mouseMove( evt:MouseEvent|TouchEvent ) {\r\n this._mouseAction( UIA.move, evt );\r\n if (this._pressed) {\r\n this._dragged = true;\r\n this._mouseAction( UIA.drag, evt );\r\n }\r\n return false;\r\n }\r\n \r\n \r\n /**\r\n * MouseOver handler\r\n * @param evt \r\n */\r\n protected _mouseOver( evt:MouseEvent|TouchEvent ) {\r\n this._mouseAction( UIA.over, evt );\r\n return false;\r\n }\r\n \r\n \r\n /**\r\n * MouseOut handler\r\n * @param evt \r\n */\r\n protected _mouseOut( evt:MouseEvent|TouchEvent ) {\r\n this._mouseAction( UIA.out, evt );\r\n if (this._dragged) this._mouseAction( UIA.drop, evt );\r\n this._dragged = false;\r\n return false;\r\n }\r\n \r\n \r\n /**\r\n * TouchMove handler\r\n * @param evt \r\n */\r\n protected _touchMove( evt:TouchEvent) {\r\n this._mouseMove(evt);\r\n evt.preventDefault();\r\n return false;\r\n }\r\n \r\n}\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/Space.ts","// Source code licensed under Apache License 2.0. \n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\n\n\nimport {MultiTouchSpace, IPlayer} from './Space';\nimport {Form, VisualForm, Font} from \"./Form\";\nimport {Bound} from './Bound';\nimport {Util} from './Util';\nimport {Pt, PtLike, GroupLike} from './Pt';\n\n\n/**\n * A type that represents the current context for an DOMForm\n */\nexport type DOMFormContext = {\n group:Element, groupID:string, groupCount:number,\n currentID:string,\n currentClass?:string,\n style:object,\n font:string, fontSize:number, fontFamily:string\n};\n\n\n/**\n * A Space for DOM elements\n */\nexport class DOMSpace extends MultiTouchSpace {\n \n protected _canvas:HTMLElement|SVGElement;\n protected _container:Element;\n \n id: string = \"domspace\";\n protected _autoResize = true;\n protected _bgcolor = \"#e1e9f0\";\n protected _css = {};\n \n \n /**\n * Create a DOMSpace which represents a Space for DOM elements\n * @param elem Specify an element by its \"id\" attribute as string, or by the element object itself. Use css to customize its appearance if needed.\n * @param callback an optional callback `function(boundingBox, spaceElement)` to be called when canvas is appended and ready. Alternatively, a \"ready\" event will also be fired from the element when it's appended, which can be traced with `spaceInstance.canvas.addEventListener(\"ready\")`\n * @example `new DOMSpace( \"#myElementID\" )`\n */\n constructor( elem:string|Element, callback?:Function) {\n super();\n \n var _selector:Element = null;\n var _existed = false;\n this.id = \"pts\";\n \n // check element or element id string\n if ( elem instanceof Element ) {\n _selector = elem;\n this.id = \"pts_existing_space\";\n } else {\n _selector = document.querySelector( <string>elem );\n _existed = true;\n this.id = elem.substr(1);\n }\n \n // if selector is not defined, create a canvas\n if (!_selector) { \n this._container = DOMSpace.createElement( \"div\", \"pts_container\" );\n this._canvas = DOMSpace.createElement( \"div\", \"pts_element\" ) as HTMLElement;\n this._container.appendChild( this._canvas );\n document.body.appendChild( this._container );\n _existed = false;\n \n } else {\n this._canvas = _selector as HTMLElement;\n this._container = _selector.parentElement;\n }\n \n // no mutation observer, so we set a timeout for ready event\n setTimeout( this._ready.bind( this, callback ), 50 );\n\n }\n \n \n /**\n * Helper function to create a DOM element\n * @param elem element tag name\n * @param id element id attribute\n * @param appendTo Optional, if specified, the created element will be appended to this element\n */\n static createElement( elem:string=\"div\", id:string, appendTo?:Element ):Element {\n let d = document.createElement( elem );\n if (id) d.setAttribute( \"id\", id );\n if (appendTo && appendTo.appendChild) appendTo.appendChild( d );\n return d;\n \n }\n \n \n /**\n * Handle callbacks after element is mounted in DOM\n * @param callback \n */\n private _ready( callback:Function ) {\n if (!this._container) throw new Error(`Cannot initiate #${this.id} element`);\n \n this._isReady = true;\n \n this._resizeHandler( null );\n this.clear( this._bgcolor );\n this._canvas.dispatchEvent( new Event(\"ready\") );\n \n \n for (let k in this.players) {\n if (this.players.hasOwnProperty(k)) {\n if (this.players[k].start) this.players[k].start( this.bound.clone(), this );\n }\n }\n \n this._pointer = this.center;\n\n this.refresh(false); // No need to clear and redraw for every frame in DOM\n \n if (callback) callback( this.bound, this._canvas );\n }\n \n \n /**\n * Set up various options for DOMSpace. The `opt` parameter is an object with the following fields. This is usually set during instantiation, eg `new DOMSpace(...).setup( { opt } )`\n * @param opt an object with optional settings, as follows.\n * @param opt.bgcolor a hex or rgba string to set initial background color of the canvas, or use `false` or \"transparent\" to set a transparent background. You may also change it later with `clear()` \n * @param opt.resize a boolean to set whether `<canvas>` size should auto resize to match its container's size. You can also set it manually with `autoSize()` \n * @example `space.setup({ bgcolor: \"#f00\", resize: true })`\n */\n setup( opt:{bgcolor?:string, resize?:boolean} ):this {\n if (opt.bgcolor) {\n this._bgcolor = opt.bgcolor;\n }\n \n this.autoResize = (opt.resize != undefined) ? opt.resize : false;\n \n return this;\n }\n \n\n /**\n * Not implemented. See SVGSpace and HTMLSpace for implementation\n */\n getForm():Form {\n return null;\n }\n \n /**\n * Set whether the canvas element should resize when its container is resized. \n * @param auto a boolean value indicating if auto size is set\n */\n set autoResize( auto:boolean ) {\n this._autoResize = auto;\n if (auto) {\n window.addEventListener( 'resize', this._resizeHandler.bind(this) );\n } else {\n delete this._css['width'];\n delete this._css['height'];\n window.removeEventListener( 'resize', this._resizeHandler.bind(this) );\n }\n }\n get autoResize(): boolean { return this._autoResize; }\n \n \n /**\n * This overrides Space's `resize` function. It's used as a callback function for window's resize event and not usually called directly. You can keep track of resize events with `resize: (bound ,evt)` callback in your player objects (See `Space`'s `add()` function). \n * @param b a Bound object to resize to\n * @param evt Optionally pass a resize event\n */\n resize( b:Bound, evt?:Event):this {\n \n this.bound = b;\n this.styles( {width: `${b.width}px`, height: `${b.height}px`}, true );\n\n for (let k in this.players) {\n if (this.players.hasOwnProperty(k)) {\n let p = this.players[k];\n if (p.resize) p.resize( this.bound, evt);\n }\n };\n \n return this;\n }\n \n \n /**\n * Window resize handling\n * @param evt \n */\n protected _resizeHandler( evt:Event ) {\n \n let b = Bound.fromBoundingRect( this._container.getBoundingClientRect() );\n\n if (this._autoResize) {\n this.styles( {width: \"100%\", height: \"100%\"}, true );\n } else {\n this.styles( {width: `${b.width}px`, height: `${b.height}px`}, true );\n }\n\n this.resize( b, evt );\n \n }\n \n \n /**\n * Get this DOM element\n */\n get element():Element {\n return this._canvas;\n }\n \n \n /**\n * Get the parent DOM element that contains this DOM element\n */\n get parent():Element {\n return this._container;\n }\n \n \n /**\n * A property to indicate if the Space is ready\n */\n get ready():boolean { return this._isReady; }\n \n \n /**\n * Clear the element's contents, and ptionally set a new backgrounc color. Overrides Space's `clear` function.\n * @param bg Optionally specify a custom background color in hex or rgba string, or \"transparent\". If not defined, it will use its `bgcolor` property as background color to clear the canvas.\n */\n clear( bg?:string ):this {\n if (bg) this.background = bg;\n this._canvas.innerHTML = \"\";\n return this;\n } \n \n \n /**\n * Set a background color on the container element\n @param bg background color as hex or rgba string\n */\n set background( bg:string ) {\n this._bgcolor = bg;\n (this._container as HTMLElement).style.backgroundColor = this._bgcolor;\n }\n get background():string { return this._bgcolor; }\n \n \n /**\n * Add or update a style definition, and optionally update that style in the Element\n * @param key style name\n * @param val style value\n * @param update a boolean to update the element's style immediately if set to `true`. Default is `false`.\n */\n style( key:string, val:string, update:boolean=false ):this {\n this._css[key] = val;\n if (update) this._canvas.style[key] = val;\n return this;\n }\n \n \n /**\n * Add of update a list of style definitions, and optionally update those styles in the Element\n * @param styles a key-value objects of style definitions \n * @param update a boolean to update the element's style immediately if set to `true`. Default is `false`.\n * @return this\n */\n styles( styles:object, update:boolean=false ):this {\n for (let k in styles) {\n if ( styles.hasOwnProperty(k) ) this.style( k, styles[k], update );\n }\n return this;\n }\n \n \n /**\n * A static helper function to add or update Element attributes\n * @param elem Element to update\n * @param data an object with key-value pairs\n * @returns this DOM element \n */\n static setAttr( elem:Element, data:object ):Element {\n for (let k in data) {\n if (data.hasOwnProperty(k)) {\n elem.setAttribute( k, data[k] );\n }\n }\n return elem;\n }\n \n \n /**\n * A static helper function to compose an inline style string from a object of styles\n * @param elem Element to update\n * @param data an object with key-value pairs\n * @exmaple DOMSpace.getInlineStyles( {width: \"100px\", \"font-size\": \"10px\"} ); // returns \"width: 100px; font-size: 10px\"\n */\n static getInlineStyles( data:object ):string {\n let str = \"\";\n for (let k in data) {\n if (data.hasOwnProperty(k)) {\n if (data[k]) str += `${k}: ${data[k]}; `;\n }\n }\n return str;\n }\n \n}\n\n\n/**\n * HTMLSpace. Note that this is currently experimental and may change in future.\n */\nexport class HTMLSpace extends DOMSpace {\n\n /**\n * Get a new `HTMLForm` for drawing\n * @see `HTMLForm`\n */\n getForm():Form {\n return new HTMLForm( this );\n }\n\n /**\n * A static function to add a DOM element inside a node. Usually you don't need to use this directly. See methods in `DOMForm` instead.\n * @param parent the parent element, or `null` to use current `<svg>` as parent.\n * @param name a string of element name, such as `rect` or `circle`\n * @param id id attribute of the new element\n * @param autoClass add a class based on the id (from char 0 to index of \"-\"). Default is true.\n */\n static htmlElement( parent:Element, name:string, id?:string, autoClass:boolean=true ):HTMLElement {\n \n if (!parent || !parent.appendChild ) throw new Error( \"parent is not a valid DOM element\" );\n \n let elem = document.querySelector(`#${id}`);\n if (!elem) {\n elem = document.createElement( name );\n elem.setAttribute( \"id\", id );\n \n if (autoClass) elem.setAttribute( \"class\",id.substring(0, id.indexOf(\"-\")) );\n parent.appendChild( elem );\n }\n return elem as HTMLElement;\n }\n\n\n /**\n * Remove an item from this Space\n * @param item a player item with an auto-assigned `animateID` property\n */\n remove( player:IPlayer ):this {\n let temp = this._container.querySelectorAll( \".\"+HTMLForm.scopeID( player ) );\n \n temp.forEach( (el:Element) => { \n el.parentNode.removeChild( el );\n });\n \n return super.remove( player );\n }\n \n \n /**\n * Remove all items from this Space\n */\n removeAll():this {\n this._container.innerHTML = \"\";\n return super.removeAll();\n }\n}\n\n\n/**\n * Form for HTMLSpace. Note that this is currently experimental and may change in future.\n */\nexport class HTMLForm extends VisualForm {\n\n protected _ctx:DOMFormContext = {\n group: null,\n groupID: \"pts\",\n groupCount: 0,\n currentID: \"pts0\",\n currentClass: \"\",\n style: {\n \"filled\": true,\n \"stroked\": true,\n \"background\": \"#f03\",\n \"border-color\": \"#fff\",\n \"color\": \"#000\",\n \"border-width\": \"1px\",\n \"border-radius\": \"0\",\n \"border-style\": \"solid\",\n \"position\": \"absolute\",\n \"top\": 0,\n \"left\": 0,\n \"width\": 0,\n \"height\": 0\n },\n font: \"11px sans-serif\",\n fontSize: 11,\n fontFamily: \"sans-serif\"\n };\n\n static groupID:number = 0;\n static domID:number = 0;\n \n protected _space:HTMLSpace;\n protected _ready:boolean = false;\n \n constructor( space:HTMLSpace ) {\n super();\n this._space = space;\n \n this._space.add( { start: () => {\n this._ctx.group = this._space.element;\n this._ctx.groupID = \"pts_dom_\"+(HTMLForm.groupID++);\n this._ready = true;\n }} );\n }\n \n get space():HTMLSpace { return this._space; }\n\n\n /**\n * Update a style in _ctx context or throw an Erorr if the style doesn't exist\n * @param k style key\n * @param v style value\n * @param unit Optional unit like 'px' to append to value\n */\n protected styleTo( k, v, unit:string='' ) { \n if (this._ctx.style[k] === undefined) throw new Error(`${k} style property doesn't exist`);\n this._ctx.style[k] = `${v}${unit}`; \n }\n\n\n /**\n * Set current fill style. Provide a valid color string or `false` to specify no fill color.\n * @example `form.fill(\"#F90\")`, `form.fill(\"rgba(0,0,0,.5\")`, `form.fill(false)`\n * @param c fill color\n */\n fill( c:string|boolean ):this {\n if (typeof c == \"boolean\") {\n this.styleTo( \"filled\", c );\n if (!c) this.styleTo( \"background\", \"transparent\" );\n } else {\n this.styleTo( \"filled\", true );\n this.styleTo( \"background\", c );\n }\n return this;\n }\n\n /**\n * Set current stroke style. Provide a valid color string or `false` to specify no stroke color.\n * @example `form.stroke(\"#F90\")`, `form.stroke(\"rgba(0,0,0,.5\")`, `form.stroke(false)`, `form.stroke(\"#000\", 0.5, 'round', 'square')`\n * @param c stroke color which can be as color, gradient, or pattern. (See [canvas documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle))\n * @param width Optional value (can be floating point) to set line width\n * @param linejoin not implemented in HTMLForm\n * @param linecap not implemented in HTMLForm\n */\n stroke( c:string|boolean, width?:number, linejoin?:string, linecap?:string ):this {\n if (typeof c == \"boolean\") {\n this.styleTo( \"stroked\", c );\n if (!c) this.styleTo(\"border-width\", 0);\n } else {\n this.styleTo( \"stroked\", true );\n this.styleTo( \"border-color\", c );\n this.styleTo( \"border-width\", (width || 1)+\"px\" );\n }\n return this;\n }\n\n\n /**\n * Set current text color style. Provide a valid color string.\n * @example `form.fill(\"#F90\")`, `form.fill(\"rgba(0,0,0,.5\")`, `form.fill(false)`\n * @param c fill color\n */\n fillText( c:string ):this {\n this.styleTo( \"color\", c );\n return this;\n }\n\n\n /**\n * Add custom class to the created element\n * @param c custom class name or `false` to reset it\n * @example `form.fill(\"#f00\").cls(\"myClass\").rects(r)` `form.cls(false).circles(c)`\n */\n cls( c:string|boolean ) {\n if (typeof c == \"boolean\") {\n this._ctx.currentClass = \"\";\n } else {\n this._ctx.currentClass = c;\n }\n return this;\n }\n \n\n /**\n * Set the current font \n * @param sizeOrFont either a number to specify font-size, or a `Font` object to specify all font properties\n * @param weight Optional font-weight string such as \"bold\"\n * @param style Optional font-style string such as \"italic\"\n * @param lineHeight Optional line-height number suchas 1.5\n * @param family Optional font-family such as \"Helvetica, sans-serif\"\n * @example `form.font( myFont )`, `form.font(14, \"bold\")`\n */\n font( sizeOrFont:number|Font, weight?:string, style?:string, lineHeight?:number, family?:string ):this {\n if (typeof sizeOrFont == \"number\") {\n \n this._font.size = sizeOrFont;\n if (family) this._font.face = family;\n if (weight) this._font.weight = weight;\n if (style) this._font.style = style;\n if (lineHeight) this._font.lineHeight = lineHeight;\n this._ctx.font = this._font.value;\n \n } else {\n this._font = sizeOrFont;\n }\n return this;\n }\n\n /**\n * Reset the context's common styles to this form's styles. This supports using multiple forms on the same canvas context.\n */\n reset():this {\n this._ctx.style = {\n \"filled\": true, \"stroked\": true,\n \"background\": \"#f03\", \"border-color\": \"#fff\",\n \"border-width\": \"1px\"\n };\n\n this._font = new Font( 14, \"sans-serif\");\n this._ctx.font = this._font.value;\n\n return this;\n }\n\n /**\n * Set this form's group scope by an ID, and optionally define the group's parent element. A group scope keeps track of elements by their generated IDs, and updates their properties as needed. See also `scope()`.\n * @param group_id a string to use as prefix for the group's id. For example, group_id \"hello\" will create elements with id like \"hello-1\", \"hello-2\", etc\n * @param group Optional DOM element to define this group's parent element\n * @returns this form's context\n */\n updateScope( group_id:string, group?:Element ):object {\n this._ctx.group = group;\n this._ctx.groupID = group_id;\n this._ctx.groupCount = 0;\n this.nextID();\n return this._ctx;\n }\n \n\n /**\n * Set the current group scope to an item added into space, in order to keep track of any point, circle, etc created within it. The item must have an `animateID` property, so that elements created within the item will have generated IDs like \"item-{animateID}-{count}\".\n * @param item a \"player\" item that's added to space (see `space.add(...)`) and has an `animateID` property\n * @returns this form's context\n */\n scope( item:IPlayer ) {\n if (!item || item.animateID == null ) throw new Error(\"item not defined or not yet added to Space\");\n return this.updateScope( HTMLForm.scopeID( item ), this.space.element );\n }\n \n \n /**\n * Get next available id in the current group\n * @returns an id string\n */\n nextID():string {\n this._ctx.groupCount++;\n this._ctx.currentID = `${this._ctx.groupID}-${this._ctx.groupCount}`;\n return this._ctx.currentID;\n }\n \n\n /**\n * A static function to generate an ID string based on a context object\n * @param ctx a context object for an HTMLForm\n */\n static getID( ctx ):string {\n return ctx.currentID || `p-${HTMLForm.domID++}`;\n }\n\n\n /**\n * A static function to generate an ID string for a scope, based on a \"player\" item in the Space\n * @param item a \"player\" item that's added to space (see `space.add(...)`) and has an `animateID` property\n */\n static scopeID( item:IPlayer ):string {\n return `item-${item.animateID}`;\n }\n \n \n /**\n * A static function to help adding style object to an element. This put all styles into `style` attribute instead of individual attributes, so that the styles can be parsed by Adobe Illustrator.\n * @param elem A DOM element to add to\n * @param styles an object of style properties\n * @example `HTMLForm.style(elem, {fill: \"#f90\", stroke: false})`\n * @returns DOM element \n */\n static style( elem:Element, styles:object):Element {\n let st = [];\n\n if ( !styles[\"filled\"] ) st.push( \"background: none\");\n if ( !styles[\"stroked\"] ) st.push( \"border: none\");\n \n for (let k in styles) {\n if ( styles.hasOwnProperty(k) && k != \"filled\" && k != \"stroked\" ) {\n let v = styles[k];\n if (v) {\n if ( !styles[\"filled\"] && k.indexOf('background') === 0 ) {\n continue;\n } else if ( !styles[\"stroked\"] && k.indexOf('border-width') === 0 ) {\n continue;\n } else {\n st.push( `${k}: ${v}` );\n }\n }\n }\n }\n \n return HTMLSpace.setAttr( elem, {style: st.join(\";\")} );\n }\n\n /**\n * A helper function to set top, left, width, height of DOM element\n * @param x left position\n * @param y top position\n * @param w width\n * @param h height\n */\n static rectStyle( ctx:DOMFormContext, pt:PtLike, size:PtLike ):DOMFormContext {\n ctx.style[\"left\"] = pt[0]+\"px\"; \n ctx.style[\"top\"] = pt[1]+\"px\"; \n ctx.style[\"width\"] = size[0]+\"px\"; \n ctx.style[\"height\"] = size[1]+\"px\"; \n return ctx;\n }\n \n /**\n * Draws a point\n * @param ctx a context object of HTMLForm\n * @param pt a Pt object or numeric array\n * @param radius radius of the point. Default is 5.\n * @param shape The shape of the point. Defaults to \"square\", but it can be \"circle\" or a custom shape function in your own implementation.\n * @example `HTMLForm.point( p )`, `HTMLForm.point( p, 10, \"circle\" )`\n */\n static point( ctx:DOMFormContext, pt:PtLike, radius:number=5, shape:string=\"square\" ):Element {\n if (shape === \"circle\") {\n return HTMLForm.circle( ctx, pt, radius );\n } else {\n return HTMLForm.square( ctx, pt, radius );\n }\n }\n\n\n /**\n * Draws a point\n * @param p a Pt object\n * @param radius radius of the point. Default is 5.\n * @param shape The shape of the point. Defaults to \"square\", but it can be \"circle\" or a custom shape function in your own implementation.\n * @example `form.point( p )`, `form.point( p, 10, \"circle\" )`\n */\n point( pt:PtLike, radius:number=5, shape:string=\"square\" ):this {\n this.nextID();\n if (shape == \"circle\") this.styleTo(\"border-radius\", \"100%\");\n HTMLForm.point( this._ctx, pt, radius, shape );\n return this;\n }\n\n \n /**\n * A static function to draw a circle\n * @param ctx a context object of HTMLForm\n * @param pt center position of the circle\n * @param radius radius of the circle\n */\n static circle( ctx:DOMFormContext, pt:PtLike, radius:number=10 ):Element {\n let elem = HTMLSpace.htmlElement( ctx.group, \"div\", HTMLForm.getID(ctx) );\n HTMLSpace.setAttr( elem, {class: `pts-form pts-circle ${ctx.currentClass}` });\n HTMLForm.rectStyle( ctx, new Pt(pt).$subtract( radius ), new Pt(radius*2, radius*2) );\n HTMLForm.style( elem, ctx.style );\n return elem;\n } \n\n\n /**\n * Draw a circle\n * @param pts usually a Group of 2 Pts, but it can also take an array of two numeric arrays [ [position], [size] ]\n * @see [`Circle.fromCenter`](./_op_.circle.html#frompt)\n */\n circle( pts:GroupLike|number[][] ):this {\n this.nextID();\n this.styleTo(\"border-radius\", \"100%\");\n HTMLForm.circle( this._ctx, pts[0], pts[1][0] );\n return this;\n }\n\n\n /**\n * A static function to draw a square \n * @param ctx a context object of HTMLForm\n * @param pt center position of the square\n * @param halfsize half size of the square\n */\n static square( ctx:DOMFormContext, pt:PtLike, halfsize:number ) {\n let elem = HTMLSpace.htmlElement( ctx.group, \"div\", HTMLForm.getID(ctx) );\n HTMLSpace.setAttr( elem, {class: `pts-form pts-square ${ctx.currentClass}` });\n HTMLForm.rectStyle( ctx, new Pt(pt).$subtract( halfsize ), new Pt(halfsize*2, halfsize*2) );\n HTMLForm.style( elem, ctx.style );\n return elem;\n }\n \n\n /**\n * Draw a square, given a center and its half-size\n * @param pt center Pt\n * @param halfsize half-size\n */\n square( pt:PtLike, halfsize:number ):this {\n this.nextID();\n HTMLForm.square( this._ctx, pt, halfsize );\n return this;\n } \n\n\n /**\n * A static function to draw a rectangle\n * @param ctx a context object of HTMLForm\n * @param pts usually a Group of 2 Pts specifying the top-left and bottom-right positions. Alternatively it can be an array of numeric arrays.\n */\n static rect( ctx:DOMFormContext, pts:GroupLike|number[][] ):Element {\n if (!this._checkSize( pts)) return;\n\n let elem = HTMLSpace.htmlElement( ctx.group, \"div\", HTMLForm.getID(ctx) ); \n HTMLSpace.setAttr( elem, { class: `pts-form pts-rect ${ctx.currentClass}` });\n HTMLForm.rectStyle( ctx, pts[0], pts[1] );\n HTMLForm.style( elem, ctx.style );\n return elem;\n }\n\n\n /**\n * Draw a rectangle\n * @param pts usually a Group of 2 Pts specifying the top-left and bottom-right positions. Alternatively it can be an array of numeric arrays.\n */\n rect( pts:number[][]|Pt[] ):this {\n this.nextID();\n this.styleTo( \"border-radius\", \"0\" );\n HTMLForm.rect( this._ctx, pts );\n return this;\n }\n\n\n /**\n * A static function to draw text\n * @param ctx a context object of HTMLForm\n * @param `pt` a Point object to specify the anchor point\n * @param `txt` a string of text to draw\n * @param `maxWidth` specify a maximum width per line\n */\n static text( ctx:DOMFormContext, pt:PtLike, txt:string ):Element {\n let elem = HTMLSpace.htmlElement( ctx.group, \"div\", HTMLForm.getID(ctx) );\n \n HTMLSpace.setAttr( elem, {\n position: 'absolute',\n class: `pts-form pts-text ${ctx.currentClass}`,\n left: pt[0],\n top: pt[1],\n });\n \n elem.textContent = txt;\n HTMLForm.style( elem, ctx.style );\n \n return elem;\n }\n\n /**\n * Draw text on canvas\n * @param `pt` a Pt or numeric array to specify the anchor point\n * @param `txt` text\n * @param `maxWidth` specify a maximum width per line\n */\n text( pt:PtLike, txt:string ): this {\n this.nextID();\n HTMLForm.text( this._ctx, pt, txt );\n return this;\n }\n \n\n /**\n * A convenient way to draw some text on canvas for logging or debugging. It'll be draw on the top-left of the canvas as an overlay.\n * @param txt text\n */\n log( txt ):this {\n this.fill(\"#000\").stroke(\"#fff\", 0.5).text( [10,14], txt ); \n return this;\n }\n \n\n /**\n * Arc is not implemented in HTMLForm\n */\n arc( pt:PtLike, radius:number, startAngle:number, endAngle:number, cc?:boolean ):this {\n Util.warn( \"arc is not implemented in HTMLForm\" );\n return this;\n }\n\n\n /**\n * Line is not implemented in HTMLForm\n */\n line( pts:GroupLike|number[][] ):this {\n Util.warn( \"line is not implemented in HTMLForm\" );\n return this;\n }\n\n\n /**\n * Polygon is not implemented in HTMLForm\n * @param pts \n */\n polygon( pts:GroupLike|number[][] ):this {\n Util.warn( \"polygon is not implemented in HTMLForm\" );\n return this;\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/Dom.ts","// Source code licensed under Apache License 2.0.\n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\n\n\nimport {Pt, GroupLike} from \"./Pt\";\n\n/** Various functions to support typography */\nexport class Typography {\n\n /**\n * Create a heuristic text width estimate function. It will be less accurate but faster.\n * @param fn a reference function that can measure text width accurately\n * @param samples a list of string samples. Default is [\"M\", \"n\", \".\"]\n * @param distribution a list of the samples' probability distribution. Default is [0.06, 0.8, 0.14].\n * @return a function that can estimate text width\n */\n static textWidthEstimator( fn:(string) => number, samples:string[] = [\"M\", \"n\", \".\"], distribution:number[] = [0.06, 0.8, 0.14] ):(string) => number {\n let m = samples.map( fn );\n let avg = new Pt(distribution).dot( m );\n return (str:string) => str.length * avg;\n }\n\n\n /**\n * Truncate text to fit width\n * @param fn a function that can measure text width\n * @param str text to truncate\n * @param width width to fit\n * @param tail text to indicate overflow such as \"...\". Default is empty \"\".\n */\n static truncate( fn:(string) => number, str:string, width:number, tail:string=\"\" ):[string, number] {\n let trim = Math.floor( str.length * Math.min( 1, width / (fn(str)*1.1) ) );\n if (trim < str.length) {\n trim = Math.max( 0, trim - tail.length );\n return [str.substr(0, trim) + tail, trim];\n } else {\n return [str, str.length];\n }\n }\n\n\n /**\n * Get a function to scale font size proportionally to text box size changes.\n * @param box Initial box as a Group\n * @param ratio font-size change ratio. Default is 1.\n * @returns a function where input parameter is a new box, and returns the new font size value\n */\n static fontSizeToBox( box:GroupLike, ratio:number=1 ) {\n let h = (box[1][1] - box[0][1]);\n let f = ratio * h;\n return function( b:GroupLike ) {\n let nh = (b[1][1] - b[0][1]) / h;\n return f * nh;\n };\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/Typography.ts","// Source code licensed under Apache License 2.0. \r\n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\r\n\r\n\r\nimport {MultiTouchSpace} from './Space';\r\nimport {VisualForm, Font} from \"./Form\";\r\nimport {Bound} from './Bound';\r\nimport {Pt, PtLike, GroupLike, Group} from \"./Pt\";\r\nimport {Const} from \"./Util\";\r\nimport {Typography as Typo} from \"./Typography\";\r\nimport { Rectangle } from './Op';\r\n\r\n\r\nexport interface PtsCanvasRenderingContext2D extends CanvasRenderingContext2D {\r\n webkitBackingStorePixelRatio?:number;\r\n mozBackingStorePixelRatio?:number;\r\n msBackingStorePixelRatio?:number;\r\n oBackingStorePixelRatio?:number;\r\n backingStorePixelRatio?:number;\r\n}\r\n\r\n\r\n/**\r\n* CanvasSpace is an implementation of the abstract class Space. It represents a space for HTML Canvas.\r\n* Learn more about the concept of Space in [this guide](..guide/Space-0500.html)\r\n*/\r\nexport class CanvasSpace extends MultiTouchSpace {\r\n \r\n protected _canvas:HTMLCanvasElement;\r\n protected _container:Element;\r\n\r\n protected _pixelScale = 1;\r\n protected _autoResize = true;\r\n protected _bgcolor = \"#e1e9f0\";\r\n protected _ctx:PtsCanvasRenderingContext2D;\r\n \r\n protected _offscreen = false;\r\n protected _offCanvas:HTMLCanvasElement;\r\n protected _offCtx:PtsCanvasRenderingContext2D;\r\n\r\n protected _initialResize = false;\r\n \r\n\r\n \r\n /**\r\n * Create a CanvasSpace which represents a HTML Canvas Space\r\n * @param elem Specify an element by its \"id\" attribute as string, or by the element object itself. An element can be an existing `<canvas>`, or a `<div>` container in which a new `<canvas>` will be created. If left empty, a `<div id=\"pt_container\"><canvas id=\"pt\" /></div>` will be added to DOM. Use css to customize its appearance if needed.\r\n * @param callback an optional callback `function(boundingBox, spaceElement)` to be called when canvas is appended and ready. Alternatively, a \"ready\" event will also be fired from the `<canvas>` element when it's appended, which can be traced with `spaceInstance.canvas.addEventListener(\"ready\")`\r\n * @example `new CanvasSpace( \"#myElementID\" )`\r\n */\r\n constructor( elem:string|Element, callback?:Function) {\r\n super();\r\n \r\n var _selector:Element = null;\r\n var _existed = false;\r\n this.id = \"pt\";\r\n \r\n // check element or element id string\r\n if ( elem instanceof Element ) {\r\n _selector = elem;\r\n this.id = \"pts_existing_space\";\r\n } else {;\r\n _selector = document.querySelector( <string>elem );\r\n _existed = true;\r\n this.id = elem;\r\n }\r\n \r\n // if selector is not defined, create a canvas\r\n if (!_selector) { \r\n this._container = this._createElement( \"div\", this.id+\"_container\" );\r\n this._canvas = this._createElement( \"canvas\", this.id ) as HTMLCanvasElement;\r\n this._container.appendChild( this._canvas );\r\n document.body.appendChild( this._container );\r\n _existed = false;\r\n \r\n // if selector is element but not canvas, create a canvas inside it\r\n } else if (_selector.nodeName.toLowerCase() != \"canvas\") { \r\n this._container = _selector;\r\n this._canvas = this._createElement( \"canvas\", this.id+\"_canvas\" ) as HTMLCanvasElement;\r\n this._container.appendChild( this._canvas );\r\n this._initialResize = true;\r\n \r\n // if selector is an existing canvas\r\n } else {\r\n this._canvas = _selector as HTMLCanvasElement;\r\n this._container = _selector.parentElement;\r\n this._autoResize = false;\r\n }\r\n \r\n // if size is known then set it immediately\r\n // if (_existed) {\r\n // let b = this._container.getBoundingClientRect();\r\n // this.resize( Bound.fromBoundingRect(b) );\r\n // }\r\n \r\n // no mutation observer, so we set a timeout for ready event\r\n setTimeout( this._ready.bind( this, callback ), 100 );\r\n \r\n // store canvas 2d rendering context\r\n this._ctx = this._canvas.getContext('2d');\r\n \r\n }\r\n \r\n \r\n /**\r\n * Helper function to create a DOM element\r\n * @param elem element tag name\r\n * @param id element id attribute\r\n */\r\n protected _createElement( elem=\"div\", id ) {\r\n let d = document.createElement( elem );\r\n d.setAttribute(\"id\", id);\r\n return d;\r\n }\r\n \r\n \r\n /**\r\n * Handle callbacks after element is mounted in DOM\r\n * @param callback \r\n */\r\n private _ready( callback:Function ) {\r\n if (!this._container) throw new Error(`Cannot initiate #${this.id} element`);\r\n \r\n this._isReady = true;\r\n \r\n this._resizeHandler( null );\r\n\r\n this.clear( this._bgcolor );\r\n this._canvas.dispatchEvent( new Event(\"ready\") );\r\n \r\n for (let k in this.players) {\r\n if (this.players.hasOwnProperty(k)) {\r\n if (this.players[k].start) this.players[k].start( this.bound.clone(), this );\r\n }\r\n }\r\n \r\n this._pointer = this.center;\r\n this._initialResize = false; // unset\r\n \r\n if (callback) callback( this.bound, this._canvas );\r\n }\r\n \r\n \r\n /**\r\n * Set up various options for CanvasSpace. The `opt` parameter is an object with the following fields. This is usually set during instantiation, eg `new CanvasSpace(...).setup( { opt } )`\r\n * @param opt an object with optional settings, as follows.\r\n * @param opt.bgcolor a hex or rgba string to set initial background color of the canvas, or use `false` or \"transparent\" to set a transparent background. You may also change it later with `clear()` \r\n * @param opt.resize a boolean to set whether `<canvas>` size should auto resize to match its container's size. You can also set it manually with `autoSize()` \r\n * @param opt.retina a boolean to set if device pixel scaling should be used. This may make drawings on retina displays look sharper but may reduce performance slightly. Default is `true`. \r\n * @param opt.offscreen a boolean to set if a duplicate canvas should be created for offscreen rendering. Default is `false`. \r\n * @example `space.setup({ bgcolor: \"#f00\", retina: true, resize: true })`\r\n */\r\n setup( opt:{bgcolor?:string, resize?:boolean, retina?:boolean, offscreen?:boolean} ):this {\r\n if (opt.bgcolor) this._bgcolor = opt.bgcolor;\r\n \r\n this.autoResize = (opt.resize != undefined) ? opt.resize : false;\r\n \r\n if (opt.retina !== false) {\r\n let r1 = window.devicePixelRatio || 1;\r\n let r2 = this._ctx.webkitBackingStorePixelRatio || this._ctx.mozBackingStorePixelRatio || this._ctx.msBackingStorePixelRatio || this._ctx.oBackingStorePixelRatio || this._ctx.backingStorePixelRatio || 1; \r\n this._pixelScale = r1/r2;\r\n }\r\n \r\n if (opt.offscreen) {\r\n this._offscreen = true;\r\n this._offCanvas = this._createElement( \"canvas\", this.id+\"_offscreen\" ) as HTMLCanvasElement;\r\n this._offCtx = this._offCanvas.getContext('2d');\r\n } else {\r\n this._offscreen = false;\r\n }\r\n \r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Set whether the canvas element should resize when its container is resized. \r\n * @param auto a boolean value indicating if auto size is set\r\n */\r\n set autoResize( auto ) {\r\n this._autoResize = auto;\r\n if (auto) {\r\n window.addEventListener( 'resize', this._resizeHandler.bind(this) );\r\n } else {\r\n window.removeEventListener( 'resize', this._resizeHandler.bind(this) );\r\n }\r\n }\r\n get autoResize(): boolean { return this._autoResize; }\r\n \r\n \r\n /**\r\n * This overrides Space's `resize` function. It's used as a callback function for window's resize event and not usually called directly. You can keep track of resize events with `resize: (bound ,evt)` callback in your player objects (See `Space`'s `add()` function). \r\n * @param b a Bound object to resize to\r\n * @param evt Optionally pass a resize event\r\n */\r\n resize( b:Bound, evt?:Event):this {\r\n \r\n this.bound = b;\r\n\r\n this._canvas.width = this.bound.size.x * this._pixelScale;\r\n this._canvas.height = this.bound.size.y * this._pixelScale;\r\n this._canvas.style.width = Math.floor(this.bound.size.x) + \"px\";\r\n this._canvas.style.height = Math.floor(this.bound.size.y) + \"px\";\r\n \r\n if (this._offscreen) {\r\n this._offCanvas.width = this.bound.size.x * this._pixelScale;\r\n this._offCanvas.height = this.bound.size.y * this._pixelScale;\r\n // this._offCanvas.style.width = Math.floor(this.bound.size.x) + \"px\";\r\n // this._offCanvas.style.height = Math.floor(this.bound.size.y) + \"px\";\r\n }\r\n \r\n if (this._pixelScale != 1) {\r\n this._ctx.scale( this._pixelScale, this._pixelScale );\r\n this._ctx.translate( 0.5, 0.5);\r\n \r\n if (this._offscreen) {\r\n this._offCtx.scale( this._pixelScale, this._pixelScale );\r\n this._offCtx.translate( 0.5, 0.5); \r\n }\r\n }\r\n \r\n for (let k in this.players) {\r\n if (this.players.hasOwnProperty(k)) {\r\n let p = this.players[k];\r\n if (p.resize) p.resize( this.bound, evt);\r\n }\r\n };\r\n \r\n this.render( this._ctx );\r\n\r\n // if it's a valid resize event and space is not playing, repaint the canvas once\r\n if (evt && !this.isPlaying) this.playOnce( 0 ); \r\n \r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Window resize handling\r\n * @param evt \r\n */\r\n protected _resizeHandler( evt:Event ) {\r\n let b = (this._autoResize || this._initialResize) ? this._container.getBoundingClientRect() : this._canvas.getBoundingClientRect();\r\n\r\n if (b) {\r\n let box = Bound.fromBoundingRect(b);\r\n \r\n // Need to compute offset from window scroll. See outerBound calculation in Space's _mouseAction \r\n box.center = box.center.add( window.pageXOffset, window.pageYOffset ); \r\n this.resize( box, evt );\r\n }\r\n }\r\n \r\n\r\n /**\r\n * Set a background color for this canvas. Alternatively, you may use `clear()` function.\r\n @param bg background color as hex or rgba string\r\n */\r\n set background( bg:string ) { this._bgcolor = bg; }\r\n get background():string { return this._bgcolor; }\r\n\r\n \r\n /**\r\n * `pixelScale` property returns a number that let you determine if the screen is \"retina\" (when value >= 2)\r\n */\r\n public get pixelScale():number {\r\n return this._pixelScale;\r\n }\r\n \r\n \r\n /**\r\n * Check if an offscreen canvas is created\r\n */\r\n public get hasOffscreen():boolean {\r\n return this._offscreen;\r\n }\r\n \r\n \r\n /**\r\n * Get the rendering context of offscreen canvas (if created via `setup()`)\r\n */\r\n public get offscreenCtx():PtsCanvasRenderingContext2D { return this._offCtx; }\r\n \r\n \r\n /**\r\n * Get the offscreen canvas element\r\n */\r\n public get offscreenCanvas():HTMLCanvasElement { return this._offCanvas; }\r\n \r\n \r\n\r\n \r\n /**\r\n * Get a new `CanvasForm` for drawing\r\n * @see `CanvasForm`\r\n */\r\n public getForm():CanvasForm { return new CanvasForm(this); }\r\n \r\n \r\n /**\r\n * Get the html canvas element\r\n */\r\n get element():HTMLCanvasElement {\r\n return this._canvas;\r\n }\r\n \r\n \r\n /**\r\n * Get the parent element that contains the canvas element\r\n */\r\n get parent():Element {\r\n return this._container;\r\n }\r\n\r\n\r\n /**\r\n * A property to indicate if the Space is ready\r\n */\r\n get ready():boolean { \r\n return this._isReady; \r\n }\r\n \r\n \r\n /**\r\n * Get the rendering context of canvas\r\n */\r\n public get ctx():PtsCanvasRenderingContext2D { return this._ctx; }\r\n \r\n \r\n \r\n /**\r\n * Clear the canvas with its background color. Overrides Space's `clear` function.\r\n * @param bg Optionally specify a custom background color in hex or rgba string, or \"transparent\". If not defined, it will use its `bgcolor` property as background color to clear the canvas.\r\n */\r\n clear( bg?:string ):this {\r\n \r\n if (bg) this._bgcolor = bg;\r\n let lastColor = this._ctx.fillStyle;\r\n \r\n if (this._bgcolor && this._bgcolor != \"transparent\") {\r\n this._ctx.fillStyle = this._bgcolor;\r\n this._ctx.fillRect( -1, -1, this._canvas.width+1, this._canvas.height+1 );\r\n } else {\r\n this._ctx.clearRect( -1, -1, this._canvas.width+1, this._canvas.height+1 );\r\n }\r\n \r\n this._ctx.fillStyle = lastColor;\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Similiar to `clear()` but clear the offscreen canvas instead\r\n * @param bg Optionally specify a custom background color in hex or rgba string, or \"transparent\". If not defined, it will use its `bgcolor` property as background color to clear the canvas.\r\n */\r\n clearOffscreen( bg?:string ):this {\r\n if (this._offscreen) {\r\n if (bg) {\r\n this._offCtx.fillStyle = bg;\r\n this._offCtx.fillRect( -1, -1, this._canvas.width+1, this._canvas.height+1 );\r\n } else {\r\n this._offCtx.clearRect( -1, -1, this._offCanvas.width+1, this._offCanvas.height+1 );\r\n }\r\n }\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Main animation function. Call `Space.playItems`.\r\n * @param time current time\r\n */\r\n protected playItems( time: number ) {\r\n if (this._isReady) {\r\n this._ctx.save();\r\n if (this._offscreen) this._offCtx.save();\r\n super.playItems( time );\r\n this._ctx.restore();\r\n if (this._offscreen) this._offCtx.restore();\r\n this.render( this._ctx );\r\n }\r\n }\r\n \r\n \r\n\r\n}\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n* CanvasForm is an implementation of abstract class VisualForm. It provide methods to express Pts on CanvasSpace. \r\n* You may extend CanvasForm to implement your own expressions for CanvasSpace.\r\n*/\r\nexport class CanvasForm extends VisualForm {\r\n \r\n protected _space:CanvasSpace;\r\n protected _ctx:CanvasRenderingContext2D; \r\n protected _estimateTextWidth:(string) => number;\r\n\r\n /** \r\n * store common styles so that they can be restored to canvas context when using multiple forms. See `reset()`.\r\n */\r\n protected _style = {\r\n fillStyle: \"#f03\", strokeStyle:\"#fff\", \r\n lineWidth: 1, lineJoin: \"bevel\", lineCap: \"butt\",\r\n };\r\n \r\n \r\n /**\r\n * Create a new CanvasForm. You may also use `space.getForm()` to get the default form.\r\n * @param space an instance of CanvasSpace\r\n */\r\n constructor( space:CanvasSpace ) {\r\n super();\r\n this._space = space;\r\n \r\n this._space.add( { start: () => {\r\n this._ctx = this._space.ctx;\r\n this._ctx.fillStyle = this._style.fillStyle;\r\n this._ctx.strokeStyle = this._style.strokeStyle; \r\n this._ctx.lineJoin = \"bevel\";\r\n this._ctx.font = this._font.value;\r\n this._ready = true;\r\n }} );\r\n }\r\n \r\n \r\n /**\r\n * get the CanvasSpace instance that this form is associated with\r\n */\r\n get space():CanvasSpace { return this._space; }\r\n \r\n\r\n /**\r\n * Toggle whether to draw on offscreen canvas (if offscreen is set in CanvasSpace)\r\n * @param off if `true`, draw on offscreen canvas instead of the visible canvas. Default is `true`\r\n * @param clear optionally provide a valid color string to fill a bg color. see CanvasSpace's `clearOffscreen` function.\r\n */\r\n useOffscreen( off:boolean=true, clear:boolean|string=false ) {\r\n if (clear) this._space.clearOffscreen( (typeof clear == \"string\") ? clear : null );\r\n this._ctx = (this._space.hasOffscreen && off) ? this._space.offscreenCtx : this._space.ctx;\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * Render the offscreen canvas's content on the visible canvas\r\n * @param offset Optional offset on the top-left position when drawing on the visible canvas\r\n */\r\n renderOffscreen( offset:PtLike=[0,0] ) {\r\n if (this._space.hasOffscreen) {\r\n this._space.ctx.drawImage( \r\n this._space.offscreenCanvas, offset[0], offset[1], this._space.width, this._space.height );\r\n }\r\n }\r\n \r\n \r\n /**\r\n * Set current fill style. Provide a valid color string or `false` to specify no fill color.\r\n * @example `form.fill(\"#F90\")`, `form.fill(\"rgba(0,0,0,.5\")`, `form.fill(false)`\r\n * @param c fill color which can be as color, gradient, or pattern. (See [canvas documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle))\r\n */\r\n fill( c:string|boolean ):this {\r\n if (typeof c == \"boolean\") {\r\n this.filled = c;\r\n } else {\r\n this.filled = true;\r\n this._style.fillStyle = c;\r\n this._ctx.fillStyle = c;\r\n }\r\n return this;\r\n }\r\n \r\n \r\n \r\n /**\r\n * Set current stroke style. Provide a valid color string or `false` to specify no stroke color.\r\n * @example `form.stroke(\"#F90\")`, `form.stroke(\"rgba(0,0,0,.5\")`, `form.stroke(false)`, `form.stroke(\"#000\", 0.5, 'round', 'square')`\r\n * @param c stroke color which can be as color, gradient, or pattern. (See [canvas documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle))\r\n * @param width Optional value (can be floating point) to set line width\r\n * @param linejoin Optional string to set line joint style. Can be \"miter\", \"bevel\", or \"round\".\r\n * @param linecap Optional string to set line cap style. Can be \"butt\", \"round\", or \"square\".\r\n */\r\n stroke( c:string|boolean, width?:number, linejoin?:string, linecap?:string ):this {\r\n if (typeof c == \"boolean\") {\r\n this.stroked = c;\r\n } else {\r\n this.stroked = true;\r\n this._style.strokeStyle = c;\r\n this._ctx.strokeStyle = c;\r\n if (width) {\r\n this._ctx.lineWidth = width;\r\n this._style.lineWidth = width;\r\n }\r\n if (linejoin) {\r\n this._ctx.lineJoin = linejoin;\r\n this._style.lineJoin = linejoin;\r\n }\r\n if (linecap) {\r\n this._ctx.lineCap = linecap;\r\n this._style.lineCap = linecap;\r\n }\r\n }\r\n return this;\r\n }\r\n \r\n \r\n \r\n /**\r\n * Set the current font \r\n * @param sizeOrFont either a number to specify font-size, or a `Font` object to specify all font properties\r\n * @param weight Optional font-weight string such as \"bold\"\r\n * @param style Optional font-style string such as \"italic\"\r\n * @param lineHeight Optional line-height number suchas 1.5\r\n * @param family Optional font-family such as \"Helvetica, sans-serif\"\r\n * @example `form.font( myFont )`, `form.font(14, \"bold\")`\r\n */\r\n font( sizeOrFont:number|Font, weight?:string, style?:string, lineHeight?:number, family?:string ):this {\r\n if (typeof sizeOrFont == \"number\") {\r\n \r\n this._font.size = sizeOrFont;\r\n if (family) this._font.face = family;\r\n if (weight) this._font.weight = weight;\r\n if (style) this._font.style = style;\r\n if (lineHeight) this._font.lineHeight = lineHeight;\r\n this._ctx.font = this._font.value;\r\n \r\n } else {\r\n this._font = sizeOrFont;\r\n }\r\n\r\n // If using estimate, reapply it when font changes.\r\n if (this._estimateTextWidth) this.fontWidthEstimate( true );\r\n\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Set whether to use ctx.measureText or a faster but less accurate heuristic function.\r\n * @param estimate `true` to use heuristic function, or `false` to use ctx.measureText\r\n */\r\n fontWidthEstimate( estimate:boolean=true ):this {\r\n this._estimateTextWidth = (estimate) ? Typo.textWidthEstimator( ((c:string) => this._ctx.measureText(c).width) ) : undefined;\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Get the width of this text. It will return an actual measurement or an estimate based on `fontWidthEstimate` setting. Default is an actual measurement using canvas context's measureText.\r\n * @param c a string of text contents\r\n */\r\n getTextWidth(c:string):number {\r\n return (!this._estimateTextWidth) ? this._ctx.measureText(c).width : this._estimateTextWidth( c );\r\n }\r\n\r\n\r\n /**\r\n * Truncate text to fit width\r\n * @param str text to truncate\r\n * @param width width to fit\r\n * @param tail text to indicate overflow such as \"...\". Default is empty \"\".\r\n */\r\n protected _textTruncate( str:string, width:number, tail:string=\"\" ):[string, number] {\r\n return Typo.truncate( this.getTextWidth.bind(this), str, width, tail );\r\n }\r\n\r\n\r\n /**\r\n * Align text within a rectangle box\r\n * @param box a Group that defines a rectangular box\r\n * @param vertical a string that specifies the vertical alignment in the box: \"top\", \"bottom\", \"middle\", \"start\", \"end\"\r\n * @param offset Optional offset from the edge (like padding)\r\n * @param center Optional center position \r\n */\r\n protected _textAlign( box:GroupLike, vertical:string, offset?:PtLike, center?:Pt ):Pt {\r\n if (!center) center = Rectangle.center( box );\r\n var px = box[0][0];\r\n if (this._ctx.textAlign == \"end\" || this._ctx.textAlign == \"right\") {\r\n px = box[1][0];\r\n } else if (this._ctx.textAlign == \"center\" || this._ctx.textAlign == \"middle\") {\r\n px = center[0];\r\n }\r\n\r\n var py = center[1];\r\n if (vertical == \"top\" || vertical == \"start\") {\r\n py = box[0][1];\r\n } else if (vertical == \"end\" || vertical == \"bottom\") {\r\n py = box[1][1];\r\n }\r\n\r\n return (offset) ? new Pt( px+offset[0], py+offset[1] ) : new Pt(px, py);\r\n }\r\n \r\n \r\n /**\r\n * Reset the rendering context's common styles to this form's styles. This supports using multiple forms on the same canvas context.\r\n */\r\n reset():this {\r\n for (let k in this._style) {\r\n if (this._style.hasOwnProperty(k)) {\r\n this._ctx[k] = this._style[k];\r\n }\r\n }\r\n this._font = new Font();\r\n this._ctx.font = this._font.value;\r\n return this;\r\n }\r\n \r\n \r\n protected _paint() {\r\n if (this._filled) this._ctx.fill();\r\n if (this._stroked) this._ctx.stroke();\r\n }\r\n \r\n \r\n /**\r\n * Draws a point\r\n * @param p a Pt object\r\n * @param radius radius of the point. Default is 5.\r\n * @param shape The shape of the point. Defaults to \"square\", but it can be \"circle\" or a custom shape function in your own implementation.\r\n * @example `form.point( p )`, `form.point( p, 10, \"circle\" )`\r\n */\r\n point( p:PtLike, radius:number=5, shape:string=\"square\" ):this {\r\n if (!p) return;\r\n if (!CanvasForm[shape]) throw new Error(`${shape} is not a static function of CanvasForm`);\r\n \r\n CanvasForm[shape]( this._ctx, p, radius );\r\n this._paint();\r\n \r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * A static function to draw a circle\r\n * @param ctx canvas rendering context\r\n * @param pt center position of the circle\r\n * @param radius radius of the circle\r\n */\r\n static circle( ctx:CanvasRenderingContext2D, pt:PtLike, radius:number=10 ) {\r\n if (!pt) return;\r\n ctx.beginPath();\r\n ctx.arc( pt[0], pt[1], radius, 0, Const.two_pi, false );\r\n ctx.closePath();\r\n }\r\n \r\n \r\n /**\r\n * Draw a circle\r\n * @param pts usually a Group of 2 Pts, but it can also take an array of two numeric arrays [ [position], [size] ]\r\n * @see [`Circle.fromCenter`](./_op_.circle.html#frompt)\r\n */\r\n circle( pts:GroupLike|number[][] ):this {\r\n CanvasForm.circle( this._ctx, pts[0], pts[1][0] );\r\n this._paint();\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * A static function to draw an arc.\r\n * @param ctx canvas rendering context\r\n * @param pt center position \r\n * @param radius radius of the arc circle\r\n * @param startAngle start angle of the arc\r\n * @param endAngle end angle of the arc\r\n * @param cc an optional boolean value to specify if it should be drawn clockwise (`false`) or counter-clockwise (`true`). Default is clockwise.\r\n */\r\n static arc( ctx:CanvasRenderingContext2D, pt:PtLike, radius:number, startAngle:number, endAngle:number, cc?:boolean ) {\r\n if (!pt) return;\r\n ctx.beginPath();\r\n ctx.arc( pt[0], pt[1], radius, startAngle, endAngle, cc );\r\n }\r\n \r\n \r\n /**\r\n * Draw an arc.\r\n * @param pt center position\r\n * @param radius radius of the arc circle\r\n * @param startAngle start angle of the arc\r\n * @param endAngle end angle of the arc\r\n * @param cc an optional boolean value to specify if it should be drawn clockwise (`false`) or counter-clockwise (`true`). Default is clockwise.\r\n */\r\n arc( pt:PtLike, radius:number, startAngle:number, endAngle:number, cc?:boolean ):this {\r\n CanvasForm.arc( this._ctx, pt, radius, startAngle, endAngle, cc );\r\n this._paint();\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * A static function to draw a square \r\n * @param ctx canvas rendering context\r\n * @param pt center position of the square\r\n * @param halfsize half size of the square\r\n */\r\n static square( ctx:CanvasRenderingContext2D, pt:PtLike, halfsize:number ) {\r\n if (!pt) return;\r\n let x1 = pt[0]-halfsize;\r\n let y1 = pt[1]-halfsize;\r\n let x2 = pt[0]+halfsize;\r\n let y2 = pt[1]+halfsize;\r\n \r\n // faster than using `rect`\r\n ctx.beginPath();\r\n ctx.moveTo( x1, y1 );\r\n ctx.lineTo( x1, y2 );\r\n ctx.lineTo( x2, y2 );\r\n ctx.lineTo( x2, y1 );\r\n ctx.closePath();\r\n }\r\n \r\n \r\n /**\r\n * Draw a square, given a center and its half-size\r\n * @param pt center Pt\r\n * @param halfsize half-size\r\n */\r\n square( pt:PtLike, halfsize:number ) {\r\n CanvasForm.square( this._ctx, pt, halfsize );\r\n this._paint();\r\n return this;\r\n }\r\n\r\n \r\n /**\r\n * A static function to draw a line\r\n * @param ctx canvas rendering context\r\n * @param pts a Group of multiple Pts, or an array of multiple numeric arrays\r\n */\r\n static line( ctx:CanvasRenderingContext2D, pts:GroupLike|number[][] ) {\r\n if (pts.length<2) return;\r\n ctx.beginPath();\r\n ctx.moveTo( pts[0][0], pts[0][1] );\r\n for (let i=1, len=pts.length; i<len; i++) {\r\n if (pts[i]) ctx.lineTo( pts[i][0], pts[i][1] );\r\n }\r\n }\r\n \r\n \r\n /**\r\n * Draw a line or polyline\r\n * @param pts a Group of multiple Pts, or an array of multiple numeric arrays\r\n */\r\n line( pts:GroupLike|number[][] ):this {\r\n CanvasForm.line( this._ctx, pts );\r\n this._paint();\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * A static function to draw polygon\r\n * @param ctx canvas rendering context\r\n * @param pts a Group of multiple Pts, or an array of multiple numeric arrays\r\n */\r\n static polygon( ctx:CanvasRenderingContext2D, pts:GroupLike|number[][] ) {\r\n if (pts.length<2) return;\r\n ctx.beginPath();\r\n ctx.moveTo( pts[0][0], pts[0][1] );\r\n for (let i=1, len=pts.length; i<len; i++) {\r\n if (pts[i]) ctx.lineTo( pts[i][0], pts[i][1] );\r\n }\r\n ctx.closePath();\r\n }\r\n \r\n \r\n /**\r\n * Draw a polygon\r\n * @param pts a Group of multiple Pts, or an array of multiple numeric arrays\r\n */\r\n polygon( pts:GroupLike|number[][] ):this {\r\n CanvasForm.polygon( this._ctx, pts );\r\n this._paint();\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * A static function to draw a rectangle\r\n * @param ctx canvas rendering context\r\n * @param pts usually a Group of 2 Pts specifying the top-left and bottom-right positions. Alternatively it can be an array of numeric arrays.\r\n */\r\n static rect( ctx:CanvasRenderingContext2D, pts:GroupLike|number[][] ) {\r\n if (pts.length<2) return;\r\n ctx.beginPath();\r\n ctx.moveTo( pts[0][0], pts[0][1] );\r\n ctx.lineTo( pts[0][0], pts[1][1] );\r\n ctx.lineTo( pts[1][0], pts[1][1] );\r\n ctx.lineTo( pts[1][0], pts[0][1] );\r\n ctx.closePath();\r\n }\r\n \r\n \r\n /**\r\n * Draw a rectangle\r\n * @param pts usually a Group of 2 Pts specifying the top-left and bottom-right positions. Alternatively it can be an array of numeric arrays.\r\n */\r\n rect( pts:number[][]|Pt[] ):this {\r\n CanvasForm.rect( this._ctx, pts );\r\n this._paint();\r\n return this;\r\n }\r\n \r\n \r\n /**\r\n * A static function to draw text\r\n * @param ctx canvas rendering context\r\n * @param `pt` a Point object to specify the anchor point\r\n * @param `txt` a string of text to draw\r\n * @param `maxWidth` specify a maximum width per line\r\n */\r\n static text( ctx:CanvasRenderingContext2D, pt:PtLike, txt:string, maxWidth?:number ) {\r\n if (!pt) return;\r\n ctx.fillText( txt, pt[0], pt[1], maxWidth );\r\n }\r\n \r\n \r\n /**\r\n * Draw text on canvas\r\n * @param `pt` a Pt or numeric array to specify the anchor point\r\n * @param `txt` text\r\n * @param `maxWidth` specify a maximum width per line\r\n */\r\n text( pt:PtLike, txt:string, maxWidth?:number): this {\r\n CanvasForm.text( this._ctx, pt, txt, maxWidth );\r\n return this;\r\n }\r\n \r\n\r\n /**\r\n * Fit a single-line text in a rectangular box\r\n * @param box a rectangle box defined by a Group\r\n * @param txt string of text\r\n * @param tail text to indicate overflow such as \"...\". Default is empty \"\".\r\n * @param verticalAlign \"top\", \"middle\", or \"bottom\" to specify vertical alignment inside the box\r\n * @param overrideBaseline If `true`, use the corresponding baseline as verticalAlign. If `false`, use the current canvas context's textBaseline setting. Default is `true`.\r\n */\r\n textBox( box:GroupLike, txt:string, verticalAlign:string=\"middle\", tail:string=\"\", overrideBaseline:boolean=true): this {\r\n if (overrideBaseline) this._ctx.textBaseline = verticalAlign;\r\n let size = Rectangle.size( box );\r\n let t = this._textTruncate( txt, size[0], tail );\r\n this.text( this._textAlign( box, verticalAlign ), t[0] );\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Fit multi-line text in a rectangular box. Note that this will also set canvas context's textBaseline to \"top\".\r\n * @param box a rectangle box defined by a Group\r\n * @param txt string of text\r\n * @param lineHeight line height as a ratio of font size. Default is 1.2.\r\n * @param verticalAlign \"top\", \"middle\", or \"bottom\" to specify vertical alignment inside the box\r\n * @param crop a boolean to specify whether to crop text when overflowing\r\n */\r\n paragraphBox( box:GroupLike, txt:string, lineHeight:number=1.2, verticalAlign:string=\"top\", crop:boolean=true ):this {\r\n let size = Rectangle.size( box );\r\n this._ctx.textBaseline = \"top\"; // override textBaseline\r\n \r\n let lstep = this._font.size * lineHeight;\r\n\r\n // find next lines recursively\r\n let nextLine = (sub:string, buffer:string[]=[], cc:number=0 ) => {\r\n if (!sub) return buffer;\r\n if (crop && cc*lstep > size[1]-lstep*2) return buffer;\r\n if (cc>10000) throw new Error(\"max recursion reached (10000)\");\r\n\r\n let t = this._textTruncate( sub, size[0], \"\" );\r\n\r\n // new line\r\n let newln = t[0].indexOf(\"\\n\");\r\n if (newln >= 0) {\r\n buffer.push( t[0].substr(0, newln) );\r\n return nextLine( sub.substr( newln+1 ), buffer, cc+1 ); \r\n }\r\n\r\n // word wrap\r\n let dt = t[0].lastIndexOf( \" \" ) + 1;\r\n if ( dt <= 0 || t[1] === sub.length ) dt = undefined;\r\n let line = t[0].substr(0, dt );\r\n buffer.push( line );\r\n\r\n return (t[1] <= 0 || t[1] === sub.length) ? buffer : nextLine( sub.substr( (dt || t[1]) ), buffer, cc+1 );\r\n };\r\n\r\n let lines = nextLine( txt ); // go through all lines\r\n let lsize = lines.length * lstep; // total height\r\n let lbox = box;\r\n \r\n\r\n if (verticalAlign == \"middle\" || verticalAlign == \"center\") {\r\n let lpad = (size[1] - lsize) / 2; \r\n if (crop) lpad = Math.max( 0, lpad ); \r\n lbox = new Group( box[0].$add(0, lpad), box[1].$subtract(0, lpad) );\r\n } else if (verticalAlign == \"bottom\") {\r\n lbox = new Group( box[0].$add( 0, size[1]-lsize ), box[1] );\r\n } else {\r\n lbox = new Group( box[0], box[0].$add(size[0], lsize) );\r\n }\r\n\r\n let center = Rectangle.center( lbox );\r\n for (let i=0, len=lines.length; i<len; i++) {\r\n this.text( this._textAlign( lbox, \"top\", [0, i*lstep], center ), lines[i] );\r\n }\r\n\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Set text alignment and baseline (eg, vertical-align)\r\n * @param alignment Canvas' textAlign option: \"left\", \"right\", \"center\", \"start\", or \"end\"\r\n * @param baseline Canvas' textBaseline option: \"top\", \"hanging\", \"middle\", \"alphabetic\", \"ideographic\", \"bottom\". For convenience, you can also use \"center\" (same as \"middle\"), and \"baseline\" (same as \"alphabetic\")\r\n */\r\n alignText( alignment:string=\"left\", baseline:string=\"alphabetic\") {\r\n if (baseline == \"center\") baseline = \"middle\";\r\n if (baseline == \"baseline\") baseline = \"alphabetic\";\r\n this._ctx.textAlign = alignment;\r\n this._ctx.textBaseline = baseline;\r\n return this;\r\n }\r\n\r\n \r\n /**\r\n * A convenient way to draw some text on canvas for logging or debugging. It'll be draw on the top-left of the canvas as an overlay.\r\n * @param txt text\r\n */\r\n log( txt ):this {\r\n let w = this._ctx.measureText( txt ).width + 20;\r\n this.stroke(false).fill(\"rgba(0,0,0,.4)\").rect( [[0,0], [w, 20]] );\r\n this.fill(\"#fff\").text( [10,14], txt ); \r\n return this;\r\n }\r\n \r\n }\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/Canvas.ts","// Source code licensed under Apache License 2.0. \n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\n\n\nimport {Pt, Group, PtLike} from \"./Pt\";\nimport {Util} from \"./Util\";\nimport {Num, Geom} from \"./Num\";\n\nexport type ColorType = \"rgb\"|\"hsl\"|\"hsb\"|\"lab\"|\"lch\"|\"luv\"|\"xyz\";\n\n\n/**\n * Color is a subclass of Pt. You can think of a color as a point in a color space. The Color class provides support for many color spaces.\n */\nexport class Color extends Pt {\n\n // XYZ property for Standard Observer 2deg, Daylight/sRGB illuminant D65\n private static D65:PtLike = new Pt(95.047, 100, 108.883, 1);\n\n protected _mode:ColorType = \"rgb\";\n private _isNorm:boolean = false;\n\n /**\n * Value range for each color space\n */\n static ranges:{ [name: string]: Group } = {\n rgb: new Group( new Pt(0,255), new Pt(0,255), new Pt(0,255) ),\n hsl: new Group( new Pt(0,360), new Pt(0,1), new Pt(0,1) ),\n hsb: new Group( new Pt(0,360), new Pt(0,1), new Pt(0,1) ),\n lab: new Group( new Pt(0,100), new Pt(-128,127), new Pt(-128, 127) ),\n lch: new Group( new Pt(0,100), new Pt(0,100), new Pt(0,360) ),\n luv: new Group( new Pt(0,100), new Pt(-134,220), new Pt(-140,122) ),\n xyz: new Group( new Pt(0,100), new Pt(0,100), new Pt(0,100) )\n };\n\n /**\n * Create a Color. Same as creating a Pt.\n * @param args Pt-like parameters which can be a list of numeric parameters, an array of numbers, or an object with {x,y,z,w} properties\n */\n constructor( ...args ) {\n super( ...args );\n }\n\n\n /**\n * Create a Color object with defaults to 4 dimensions\n * @param args Pt-like parameters which can be a list of numeric parameters, an array of numbers, or an object with {x,y,z,w} properties\n */\n static from( ...args ):Color {\n let p = [1,1,1,1];\n let c = Util.getArgs( args );\n for (let i=0, len=p.length; i<len; i++) {\n if (i < c.length) p[i] = c[i];\n }\n return new Color( p );\n }\n\n\n /**\n * Convert a rgb hex string like #FF0000 or #F00 to a Color object\n * @param hex a hex string, with optional '#' prefix\n */\n static fromHex( hex:string ):Color {\n\n if (hex[0] == \"#\") hex = hex.substr(1); // remove '#' if needed\n if (hex.length <= 3) {\n let fn = (i) => hex[i]||\"F\";\n hex = `${fn(0)}${fn(0)}${fn(1)}${fn(1)}${fn(2)}${fn(2)}`;\n }\n\n let alpha = 1;\n if (hex.length === 8) {\n alpha = hex.substr(6) && 0xFF / 255;\n hex = hex.substring( 0, 6 );\n }\n\n let hexVal = parseInt( hex, 16 );\n return new Color( hexVal >> 16, hexVal >> 8 & 0xFF, hexVal & 0xFF, alpha );\n\n }\n\n\n /**\n * Create RGB Color\n * @param args Pt-like parameters which can be a list of numeric parameters, an array of numbers, or an object with {x,y,z,w} properties.\n */\n static rgb( ...args ):Color { return Color.from( ...args ).toMode( \"rgb\" ); }\n \n /**\n * Create HSL Color\n * @param args Pt-like parameters which can be a list of numeric parameters, an array of numbers, or an object with {x,y,z,w} properties.\n */\n static hsl( ...args ):Color { return Color.from( ...args ).toMode( \"hsl\" ); }\n\n /**\n * Create HSB Color\n * @param args Pt-like parameters which can be a list of numeric parameters, an array of numbers, or an object with {x,y,z,w} properties.\n */\n static hsb( ...args ):Color { return Color.from( ...args ).toMode( \"hsb\" ); }\n \n /**\n * Create LAB Color\n * @param args Pt-like parameters which can be a list of numeric parameters, an array of numbers, or an object with {x,y,z,w} properties.\n */\n static lab( ...args ):Color { return Color.from( ...args ).toMode( \"lab\" ); }\n\n /**\n * Create LCH Color\n * @param args Pt-like parameters which can be a list of numeric parameters, an array of numbers, or an object with {x,y,z,w} properties.\n */\n static lch( ...args ):Color { return Color.from( ...args ).toMode( \"lch\" ); }\n\n /**\n * Create LUV Color\n * @param args Pt-like parameters which can be a list of numeric parameters, an array of numbers, or an object with {x,y,z,w} properties.\n */\n static luv( ...args ):Color { return Color.from( ...args ).toMode( \"luv\" ); }\n\n /**\n * Create XYZ Color\n * @param args Pt-like parameters which can be a list of numeric parameters, an array of numbers, or an object with {x,y,z,w} properties.\n */\n static xyz( ...args ):Color { return Color.from( ...args ).toMode( \"xyz\" ); }\n\n\n /**\n * Get a Color object whose values are the maximum of its mode\n * @param mode a mode string such as \"rgb\" or \"lab\"\n * @example Color.maxValue(\"rgb\") will return a rgb Color object with values (255,255,255)\n */\n static maxValues( mode:string ):Pt { return Color.ranges[mode].zipSlice(1).$take([0,1,2]); }\n\n\n /**\n * Get a hex string such as \"#FF0000\". Same as `toString(\"hex\")`\n */\n public get hex():string { return this.toString(\"hex\"); }\n \n /**\n * Get a rgb string such as \"rgb(255,0,0)\". Same as `toString(\"rgb\")`\n */\n public get rgb():string { return this.toString(\"rgb\"); }\n\n /**\n * Get a rgba string such as \"rgb(255,0,0,0.5)\". Same as `toString(\"rgba\")`\n */\n public get rgba():string { return this.toString(\"rgba\"); }\n \n\n /**\n * Clone this Color\n */\n clone():Color {\n let c = new Color( this );\n c.toMode( this._mode );\n return c;\n }\n\n /**\n * Convert this color from current color space to another color space\n * @param mode a ColorType string: \"rgb\" \"hsl\" \"hsb\" \"lab\" \"lch\" \"luv\" \"xyz\";\n * @param convert if `true`, convert this Color to the new color space specified in `mode`. Default is `false`, which only sets the color mode without converting color values.\n */\n toMode( mode:ColorType, convert:boolean=false ):this { \n \n if (convert) {\n let fname = this._mode.toUpperCase()+\"to\"+mode.toUpperCase(); \n if (Color[fname]) {\n this.to( Color[fname]( this, this._isNorm, this._isNorm ) );\n } else {\n throw new Error( \"Cannot convert color with \"+fname);\n }\n }\n\n this._mode = mode; \n return this;\n }\n\n\n /**\n * Get this Color's mode\n */\n get mode():ColorType { return this._mode; }\n\n\n // rgb\n get r():number { return this[0]; }\n set r( n:number ) { this[0] = n; }\n\n get g():number { return this[1]; }\n set g( n:number ) { this[1] = n; }\n\n get b():number { return this[1]; }\n set b( n:number ) { this[2] = n; }\n\n // hsl, hsb\n get h():number { return (this._mode == \"lch\") ? this[2] : this[0]; }\n set h( n:number ) { \n let i = (this._mode == \"lch\") ? 2 : 0; \n this[i] = n;\n }\n\n get s():number { return this[1]; }\n set s( n:number ) { this[1] = n; }\n\n get l():number { return (this._mode == \"hsl\") ? this[2] : this[0]; }\n set l( n:number ) { \n let i = (this._mode == \"hsl\") ? 2 : 0; \n this[i] = n;\n }\n\n // lab, lch, luv\n get a():number { return this[1]; }\n set a( n:number ) { this[1] = n; }\n\n get c():number { return this[1]; }\n set c( n:number ) { this[1] = n; }\n\n get u():number { return this[1]; }\n set u( n:number ) { this[1] = n; }\n\n get v():number { return this[1]; }\n set v( n:number ) { this[2] = n; }\n\n\n /**\n * Get alpha value\n */\n get alpha():number { return (this.length > 3) ? this[3] : 1; }\n\n\n /**\n * Normalize the color values to between 0 to 1, or revert it back to the min/max values in current color mode\n * @param toNorm a boolean value specifying whether to normalize (`true`) or revert (`false`)\n */\n normalize( toNorm:boolean=true ):Color {\n if (this._isNorm == toNorm) return this;\n\n let ranges = Color.ranges[ this._mode ];\n \n for (let i=0; i<3; i++) {\n this[i] = (!toNorm) \n ? Num.mapToRange( this[i], 0, 1, ranges[i][0], ranges[i][1] ) \n : Num.mapToRange( this[i], ranges[i][0], ranges[i][1], 0, 1 );\n }\n \n this._isNorm = toNorm;\n\n return this;\n }\n\n\n /**\n * Like `normalize()` but returns as a new Color\n * @param toNorm a boolean value specifying whether to normalize (`true`) or revert (`false`)\n * @returns new Color\n */\n $normalize( toNorm:boolean=true ):Color { return this.clone().normalize( toNorm ); }\n\n\n /**\n * Convert this Color to a string. It can be used to get a hex or rgb string for use in rendering\n * @param format \"hex\", \"rgb\", \"rgba\", or \"mode\" which means using current color mode label. Default is \"mode\".\n */\n toString( format:(\"hex\"|\"rgb\"|\"rgba\"|\"mode\")=\"mode\" ):string {\n if (format == \"hex\") {\n let _hex = (n:number) => {\n let s = Math.floor(n).toString(16);\n return (s.length < 2) ? '0'+s : s;\n };\n return `#${_hex(this[0])}${_hex(this[1])}${_hex(this[2])}`;\n\n } else if (format == \"rgba\") {\n return `rgba(${Math.floor(this[0])},${Math.floor(this[1])},${Math.floor(this[2])},${this.alpha}`;\n\n } else if (format == \"rgb\") { \n return `rgb(${Math.floor(this[0])},${Math.floor(this[1])},${Math.floor(this[2])}`;\n\n } else {\n return `${this._mode}(${this[0]},${this[1]},${this[2]},${this.alpha})`;\n }\n }\n\n\n /**\n * Convert RGB to HSL\n * @param rgb a RGB Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new HSL Color\n */\n static RGBtoHSL( rgb:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let [r,g,b] = (!normalizedInput) ? rgb.$normalize() : rgb;\n\n let max = Math.max( r, g, b );\n let min = Math.min( r, g, b );\n let h = (max+min)/2;\n let s = h;\n let l = h;\n\n if (max == min) {\n h = 0;\n s = 0; // achromatic\n } else {\n let d = max - min;\n s = (l > 0.5) ? d / (2 - max - min) : d / (max + min);\n\n h = 0;\n if (max === r) {\n h = (g - b) / d + ( (g < b) ? 6 : 0 );\n } else if (max === g) {\n h = (b - r) / d + 2;\n } else if (max === b) {\n h = (r - g) / d + 4;\n }\n }\n\n return Color.hsl( ((normalizedOutput) ? h/60 : h*60), s, l, rgb.alpha );\n }\n\n /**\n * Convert HSL to RGB\n * @param hsl a HSL Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new RGB Color\n */\n static HSLtoRGB( hsl:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let [h, s, l] = hsl;\n if (!normalizedInput) h = h/360;\n \n if (s == 0) return Color.rgb( l*255, l*255, l*255, hsl.alpha );\n\n let q = (l <= 0.5) ? l * (1 + s) : l + s - (l * s);\n let p = 2 * l - q;\n\n let convert = (t) => {\n t = (t < 0) ? t + 1 : (t > 1) ? t - 1 : t;\n if (t * 6 < 1) {\n return p + (q - p) * t * 6;\n } else if (t * 2 < 1) {\n return q;\n } else if (t * 3 < 2) {\n return p + (q - p) * ((2 / 3) - t) * 6;\n } else {\n return p;\n }\n };\n\n let sc = (normalizedOutput) ? 1 : 255; \n \n return Color.rgb( \n sc * convert( ( h + 1/3 ) ),\n sc * convert( h ),\n sc * convert( ( h - 1/3 ) ),\n hsl.alpha\n );\n\n }\n \n /**\n * Convert RGB to HSB\n * @param rgb a RGB Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new HSB Color\n */\n static RGBtoHSB( rgb:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let [r,g,b] = (!normalizedInput) ? rgb.$normalize() : rgb;\n\n let max = Math.max( r, g, b );\n let min = Math.min( r, g, b );\n let d = max - min;\n let h = 0;\n let s = (max === 0) ? 0 : d/max;\n let v = max;\n\n if (max != min) {\n if (max === r) {\n h = (g - b) / d + ( (g < b) ? 6 : 0 );\n } else if (max === g) {\n h = (b - r) / d + 2;\n } else if (max === b) {\n h = (r - g) / d + 4;\n }\n }\n\n return Color.hsb( ((normalizedOutput) ? h/60 : h*60), s, v, rgb.alpha );\n }\n\n\n /**\n * Convert HSB to RGB\n * @param hsb a HSB Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new RGB Color\n */\n static HSBtoRGB( hsb:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let [h, s, v] = hsb;\n if (!normalizedInput) h = h/360;\n\n let i = Math.floor( h * 6 );\n let f = h * 6 - i;\n let p = v * (1 - s);\n let q = v * (1 - f * s);\n let t = v * (1 - (1 - f) * s);\n \n let pick = [\n [v, t, p], [q, v, p], [p, v, t],\n [p, q, v], [t, p, v], [v, p, q] \n ];\n let c = pick[ i%6 ];\n \n let sc = (normalizedOutput) ? 1 : 255; \n\n return Color.rgb( \n sc * c[0],\n sc * c[1],\n sc * c[2],\n hsb.alpha\n );\n }\n\n /**\n * Convert RGB to LAB\n * @param rgb a RGB Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new LAB Color\n */\n static RGBtoLAB( rgb:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let c = (normalizedInput) ? rgb.$normalize( false ) : rgb;\n return Color.XYZtoLAB( Color.RGBtoXYZ(c), false, normalizedOutput );\n }\n\n\n /**\n * Convert LAB to RGB\n * @param lab a LAB Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new RGB Color\n */\n static LABtoRGB( lab:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let c = (normalizedInput) ? lab.$normalize( false ) : lab;\n return Color.XYZtoRGB( Color.LABtoXYZ( c ), false, normalizedOutput );\n }\n\n\n /**\n * Convert RGB to LCH\n * @param rgb a RGB Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new LCH Color\n */\n static RGBtoLCH( rgb:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let c = (normalizedInput) ? rgb.$normalize( false ) : rgb;\n return Color.LABtoLCH( Color.RGBtoLAB(c), false, normalizedOutput );\n }\n \n\n /**\n * Convert LCH to RGB\n * @param lch a LCH Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new RGB Color\n */\n static LCHtoRGB( lch:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let c = (normalizedInput) ? lch.$normalize( false ) : lch;\n return Color.LABtoRGB( Color.LCHtoLAB(c), false, normalizedOutput );\n }\n\n\n /**\n * Convert RGB to LUV\n * @param rgb a RGB Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new LUV Color\n */\n static RGBtoLUV( rgb:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let c = (normalizedInput) ? rgb.$normalize( false ) : rgb;\n return Color.XYZtoLUV( Color.RGBtoXYZ(c), false, normalizedOutput );\n }\n\n\n /**\n * Convert LUV to RGB\n * @param rgb a RGB Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new RGB Color\n */\n static LUVtoRGB( luv:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let c = (normalizedInput) ? luv.$normalize( false ) : luv;\n return Color.XYZtoRGB( Color.LUVtoXYZ( c ), false, normalizedOutput );\n }\n\n\n /**\n * Convert RGB to XYZ\n * @param rgb a RGB Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new XYZ Color\n */\n static RGBtoXYZ( rgb:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let c = (!normalizedInput) ? rgb.$normalize() : rgb.clone();\n\n for (let i=0; i<3; i++) {\n c[i] = ( c[i] > 0.04045 ) ? Math.pow( (c[i]+0.055)/1.055, 2.4 ) : c[i]/12.92;\n if (!normalizedOutput) c[i] = c[i] * 100;\n }\n\n let cc = Color.xyz(\n c[0] * 0.4124564 + c[1] * 0.3575761 + c[2] * 0.1804375,\n c[0] * 0.2126729 + c[1] * 0.7151522 + c[2] * 0.0721750,\n c[0] * 0.0193339 + c[1] * 0.1191920 + c[2] * 0.9503041,\n rgb.alpha\n );\n\n return (normalizedOutput) ? cc.normalize() : cc;\n }\n\n\n /**\n * Convert XYZ to RGB\n * @param xyz a XYZ Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new RGB Color\n */\n static XYZtoRGB( xyz:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let [x,y,z] = (!normalizedInput) ? xyz.$normalize() : xyz;\n\n let rgb = [\n x * 3.2404542 + y * -1.5371385 + z * -0.4985314,\n x * -0.9692660 + y * 1.8760108 + z * 0.0415560,\n x * 0.0556434 + y * -0.2040259 + z * 1.0572252\n ];\n\n // convert xyz to rgb. Note that not all colors are visible in rgb, so here we bound rgb between 0 to 1\n for (let i=0; i<3; i++) {\n rgb[i] = (rgb[i]<0) ? 0 : ( rgb[i] > 0.0031308 ) ? (1.055 * Math.pow(rgb[i], 1/2.4) - 0.055) : (12.92 * rgb[i]);\n rgb[i] = Math.max( 0, Math.min( 1, rgb[i] ));\n if (!normalizedOutput) rgb[i] = Math.round( rgb[i] * 255 );\n }\n\n let cc = Color.rgb( rgb[0], rgb[1], rgb[2], xyz.alpha );\n return (normalizedOutput) ? cc.normalize() : cc;\n }\n\n\n /**\n * Convert XYZ to LAB\n * @param xyz a XYZ Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new LAB Color\n */\n static XYZtoLAB( xyz:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let c = (normalizedInput) ? xyz.$normalize(false) : xyz.clone();\n\n // adjust for D65 \n c.divide( Color.D65 );\n\n let fn = (n)=> ( n > 0.008856 ) ? Math.pow(n, 1/3) : (7.787 * n) + 16/116;\n let cy = fn( c[1] );\n\n let cc = Color.lab(\n (116 * cy) - 16,\n 500 * (fn(c[0]) - cy),\n 200 * (cy - fn(c[2])),\n xyz.alpha\n );\n return (normalizedOutput) ? cc.normalize() : cc;\n }\n\n /**\n * Convert LAB to XYZ\n * @param lab a LAB Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new XYZ Color\n */\n static LABtoXYZ( lab:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let c = (normalizedInput) ? lab.$normalize(false) : lab;\n let y = (c[0] + 16) / 116;\n let x = (c[1] / 500) + y;\n let z = y - c[2]/200;\n\n let fn = (n) => {\n let nnn = n*n*n;\n return ( nnn > 0.008856 ) ? nnn : ( n - 16 / 116 ) / 7.787;\n };\n\n let d = Color.D65;\n\n // adjusted\n let cc = Color.xyz(\n // Math.max(0, Math.min( 100, d[0] * fn(x) )),\n // Math.max(0, Math.min( 100, d[1] * fn(y) )),\n // Math.max(0, Math.min( 100, d[2] * fn(z) )),\n Math.max( 0, d[0] * fn(x) ),\n Math.max( 0, d[1] * fn(y) ),\n Math.max( 0, d[2] * fn(z) ),\n lab.alpha\n );\n\n return (normalizedOutput) ? cc.normalize() : cc;\n }\n\n\n /**\n * Convert XYZ to LUV\n * @param xyz a XYZ Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new LUV Color\n */\n static XYZtoLUV( xyz:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let [x,y,z] = (normalizedInput) ? xyz.$normalize(false) : xyz;\n let u = (4 * x) / (x + (15 * y) + (3 * z));\n let v = (9 * y) / (x + (15 * y) + (3 * z));\n\n y = y / 100;\n y = ( y > 0.008856 ) ? Math.pow( y, 1/3 ) : ( 7.787 * y + 16 / 116 );\n\n let refU = (4 * Color.D65[0]) / (Color.D65[0] + (15 * Color.D65[1]) + ( 3 * Color.D65[2]));\n let refV = (9 * Color.D65[1]) / (Color.D65[0] + (15 * Color.D65[1]) + ( 3 * Color.D65[2]));\n\n let L = (116 * y) - 16;\n return Color.luv(\n L, 13*L*(u - refU), 13*L*(v - refV), xyz.alpha\n );\n }\n\n\n /**\n * Convert LUV to XYZ\n * @param luv a LUV Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new XYZ Color\n */\n static LUVtoXYZ( luv:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let [l,u,v] = (normalizedInput) ? luv.$normalize(false) : luv;\n let y = ( l + 16 ) / 116;\n let cubeY = y*y*y;\n y = (cubeY > 0.008856) ? cubeY : (y - 16/116) / 7.787;\n\n let refU = (4 * Color.D65[0]) / ( Color.D65[0] + (15 * Color.D65[1]) + (3 * Color.D65[2]) );\n let refV = (9 * Color.D65[1]) / ( Color.D65[0] + (15 * Color.D65[1]) + (3 * Color.D65[2]) );\n\n u = u / (13 * l) + refU;\n v = v / (13 * l) + refV;\n\n y = y * 100;\n let x = -1*(9 * y * u)/((u-4)*v - u*v);\n let z = (9 * y - (15 * v * y) - (v * x))/(3 * v);\n\n return Color.xyz( x, y, z, luv.alpha );\n }\n\n\n /**\n * Convert LAB to LCH\n * @param lab a LAB Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new LCH Color\n */\n static LABtoLCH( lab:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let c = (normalizedInput) ? lab.$normalize(false) : lab;\n let h = Geom.toDegree( Geom.boundRadian( Math.atan2( c[2], c[1] ) ) ); // 0 to 360 degrees\n return Color.lch(\n c[0], Math.sqrt( c[1]*c[1]+c[2]*c[2] ), h, lab.alpha\n );\n }\n\n\n /**\n * Convert LCH to LAB\n * @param lch a LCH Color\n * @param normalizedInput a boolean specifying whether input color is normalized. Default is not normalized: `false`.\n * @param normalizedOutput a boolean specifying whether output color shoud be normalized. Default is not normalized: `false`.\n * @returns a new LAB Color\n */\n static LCHtoLAB( lch:Color, normalizedInput:boolean=false, normalizedOutput:boolean=false):Color {\n let c = (normalizedInput) ? lch.$normalize(false) : lch;\n let rad = Geom.toRadian( c[2] );\n return Color.lab(\n c[0], Math.cos( rad ) * c[1], Math.sin( rad ) * c[1], lch.alpha\n );\n }\n\n\n}\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/Color.ts","// Source code licensed under Apache License 2.0. \r\n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\r\n\r\n\r\nimport {Pt, Group, PtLike, GroupLike} from \"./Pt\";\r\nimport {Line, Triangle} from \"./Op\";\r\nimport {Bound} from \"./Bound\";\r\nimport {Const} from \"./Util\";\r\nimport {Num, Geom} from \"./Num\";\r\nimport {Vec} from \"./LinearAlgebra\";\r\n\r\n\r\n/**\r\n * The `Create` class provides various convenient functions to create structures or shapes. \r\n */\r\nexport class Create {\r\n \r\n\r\n /**\r\n * Create a set of random points inside a bounday\r\n * @param bound the rectangular boundary\r\n * @param count number of random points to create\r\n * @param dimensions number of dimensions in each point\r\n */\r\n static distributeRandom( bound:Bound, count:number, dimensions:number=2 ):Group {\r\n let pts = new Group();\r\n for (let i=0; i<count; i++) {\r\n let p = [ bound.x + Math.random()*bound.width ];\r\n if (dimensions>1) p.push( bound.y + Math.random()*bound.height, );\r\n if (dimensions>2) p.push( bound.z + Math.random()*bound.depth );\r\n pts.push( new Pt( p ) );\r\n }\r\n return pts;\r\n }\r\n\r\n\r\n /**\r\n * Create a set of points that distribute evenly on a line\r\n * @param line a Group representing a line\r\n * @param count number of points to create\r\n */\r\n static distributeLinear( line:GroupLike, count:number ):Group {\r\n let ln = Line.subpoints( line, count-2 );\r\n ln.unshift( line[0] );\r\n ln.push( line[line.length-1] );\r\n return ln;\r\n }\r\n \r\n\r\n /**\r\n * Create an evenly distributed set of points (like a grid of points) inside a boundary.\r\n * @param bound the rectangular boundary\r\n * @param columns number of columns\r\n * @param rows number of rows\r\n * @param orientation a Pt or number array to specify where the point should be inside a cell. Default is [0.5, 0.5] which places the point in the middle.\r\n * @returns a Group of Pts\r\n */\r\n static gridPts( bound:Bound, columns:number, rows:number, orientation:PtLike=[0.5, 0.5] ):Group {\r\n if (columns === 0 || rows === 0) throw new Error(\"grid columns and rows cannot be 0\");\r\n let unit = bound.size.$subtract(1).$divide( columns, rows );\r\n let offset = unit.$multiply( orientation );\r\n let g = new Group();\r\n for (let r=0; r<rows; r++) {\r\n for (let c=0; c<columns; c++) {\r\n g.push( bound.topLeft.$add( unit.$multiply(c, r) ).add( offset ) );\r\n }\r\n }\r\n return g;\r\n \r\n }\r\n\r\n /**\r\n * Create a grid inside a boundary\r\n * @param bound the rectangular boundary\r\n * @param columns number of columns\r\n * @param rows number of rows\r\n * @returns an array of Groups, where each group represents a rectangular cell\r\n */\r\n static gridCells( bound:Bound, columns:number, rows:number ):Group[] {\r\n if (columns === 0 || rows === 0) throw new Error(\"grid columns and rows cannot be 0\");\r\n let unit = bound.size.$subtract(1).divide( columns, rows ); // subtract 1 to fill whole border of rectangles\r\n let g = [];\r\n for (let r=0; r<rows; r++) {\r\n for (let c=0; c<columns; c++) {\r\n g.push( new Group(\r\n bound.topLeft.$add( unit.$multiply(c, r) ),\r\n bound.topLeft.$add( unit.$multiply(c, r).add( unit ) )\r\n ));\r\n }\r\n }\r\n return g;\r\n }\r\n\r\n\r\n /**\r\n * Create a set of Pts around a circular path\r\n * @param center circle center\r\n * @param radius circle radius\r\n * @param count number of Pts to create\r\n */\r\n static radialPts( center:PtLike, radius:number, count:number ):Group {\r\n let g = new Group();\r\n let a = Const.two_pi/count;\r\n for (let i=0; i<count; i++) {\r\n g.push( new Pt(center).toAngle( a*i - Const.half_pi, radius, true ) );\r\n }\r\n return g;\r\n }\r\n\r\n\r\n /**\r\n * Given a group of Pts, return a new group of `Noise` Pts.\r\n * @param pts a Group or an array of Pts\r\n * @param dx small increment value in x dimension\r\n * @param dy small increment value in y dimension\r\n * @param rows Optional row count to generate 2D noise\r\n * @param columns Optional column count to generate 2D noise\r\n */\r\n static noisePts( pts:GroupLike, dx=0.01, dy=0.01, rows=0, columns=0 ):Group {\r\n let seed = Math.random();\r\n let g = new Group();\r\n for (let i=0, len=pts.length; i<len; i++) {\r\n let np = new Noise( pts[i] );\r\n let r = (rows && rows > 0) ? Math.floor(i/rows) : i;\r\n let c = (columns && columns > 0) ? i%columns : i;\r\n np.initNoise( dx*c, dy*r );\r\n np.seed( seed );\r\n g.push( np );\r\n }\r\n return g;\r\n }\r\n\r\n\r\n /**\r\n * Create a Delaunay Group. Use the `.delaunay()` and `.voronoi()` functions in the returned group to generate tessellations.\r\n * @param pts a Group or an array of Pts\r\n * @returns an instance of the Delaunay class\r\n */\r\n static delaunay( pts:GroupLike ):Delaunay {\r\n return Delaunay.from( pts ) as Delaunay;\r\n }\r\n \r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * Perlin noise gradient indices\r\n */\r\nconst grad3 = [\r\n [1,1, 0], [-1,1, 0], [1,-1,0], [-1,-1,0],\r\n [1,0, 1], [-1, 0, 1], [1,0,-1], [-1,0,-1],\r\n [0, 1,1], [ 0,-1,1], [0,1,-1], [ 0,-1,-1]\r\n];\r\n\r\n\r\n/**\r\n * Perlin noise permutation table\r\n */ \r\nconst permTable = [151,160,137,91,90,15,\r\n 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,\r\n 190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,\r\n 88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,\r\n 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,\r\n 102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,\r\n 135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,\r\n 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,\r\n 223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,\r\n 129,22,39,253,9,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,\r\n 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107,\r\n 49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,\r\n 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180\r\n];\r\n\r\n\r\n/**\r\n * A class to generate Perlin noise. Currently it implements a basic 2D noise. More to follow.\r\n * Based on https://gist.github.com/banksean/304522\r\n */\r\nexport class Noise extends Pt {\r\n\r\n protected perm:number[] = [];\r\n private _n:Pt = new Pt(0.01, 0.01);\r\n\r\n /**\r\n * Create a Noise Pt that's capable of generating noise\r\n * @param args a list of numeric parameters, an array of numbers, or an object with {x,y,z,w} properties\r\n */\r\n constructor(...args) {\r\n super( ...args );\r\n\r\n // For easier index wrapping, double the permutation table length\r\n this.perm = permTable.concat( permTable );\r\n }\r\n\r\n\r\n /**\r\n * Set the initial noise values\r\n * @param args a list of numeric parameters, an array of numbers, or an object with {x,y,z,w} properties\r\n * @example `noise.initNoise( 0.01, 0.1 )`\r\n */\r\n initNoise( ...args ) {\r\n this._n = new Pt( ...args );\r\n }\r\n\r\n\r\n /**\r\n * Add a small increment to the noise values\r\n * @param x step in x dimension\r\n * @param y step in y dimension\r\n */\r\n step( x=0, y=0 ) {\r\n this._n.add( x, y );\r\n }\r\n\r\n /**\r\n * Specify a seed for this Noise\r\n * @param s seed value\r\n */\r\n seed( s ) {\r\n if (s > 0 && s < 1) s *= 65536;\r\n \r\n s = Math.floor(s);\r\n if (s < 256)s |= s << 8;\r\n\r\n for (let i=0; i<255; i++) {\r\n let v = (i & 1) ? permTable[i] ^ (s & 255) : permTable[i] ^ ((s>>8) & 255);\r\n this.perm[i] = this.perm[i + 256] = v;\r\n }\r\n }\r\n \r\n \r\n /**\r\n * Generate a 2D Perlin noise value\r\n */\r\n noise2D() {\r\n \r\n let i = Math.floor( this._n[0] ) % 255;\r\n let j = Math.floor( this._n[1] ) % 255;\r\n let x = (this._n[0] % 255) - i;\r\n let y = (this._n[1] % 255) - j;\r\n\r\n let n00 = Vec.dot(grad3[ (i+this.perm[j]) % 12 ], [x, y, 0] );\r\n let n01 = Vec.dot(grad3[ (i+this.perm[j+1]) % 12 ], [x, y-1, 0] );\r\n let n10 = Vec.dot(grad3[ (i+1+this.perm[j]) % 12 ], [x-1, y, 0] );\r\n let n11 = Vec.dot(grad3[ (i+1+this.perm[j+1]) % 12 ], [x-1, y-1, 0] );\r\n\r\n let _fade = (f) => f*f*f*(f*(f*6-15)+10);\r\n let tx = _fade(x);\r\n return Num.lerp( Num.lerp(n00, n10, tx), Num.lerp(n01, n11, tx), _fade(y) );\r\n }\r\n \r\n\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * A DelaunayShape is an object with 3 indices, a Triangle Group and a Circle Group.\r\n */\r\nexport type DelaunayShape = {i:number, j:number, k:number, triangle:GroupLike, circle:Group };\r\nexport type DelaunayMesh = {[key:string]:DelaunayShape}[];\r\n\r\n\r\n/**\r\n * Delaunay is a Group of Pts that can generate Delaunay and Voronoi tessellations. The triangulation algorithm is ported from [Pt](https://github.com/williamngan/pt)\r\n * This implementation is based on [Paul Bourke's algorithm](http://paulbourke.net/papers/triangulate/)\r\n * with reference to its [javascript implementation by ironwallaby](https://github.com/ironwallaby/delaunay)\r\n */\r\nexport class Delaunay extends Group {\r\n\r\n private _mesh:DelaunayMesh = [];\r\n\r\n /**\r\n * Generate Delaunay triangles. This function also caches the mesh that is used to generate Voronoi tessellation in `voronoi()`.\r\n * @param triangleOnly if true, returns an array of triangles in Groups, otherwise return the whole DelaunayShape\r\n * @returns an array of Groups or an array of DelaunayShapes `{i, j, k, triangle, circle}` which records the indices of the vertices, and the calculated triangles and circumcircles\r\n */\r\n delaunay( triangleOnly:boolean=true ):GroupLike[]|DelaunayShape[] {\r\n if (this.length < 3) return [];\r\n\r\n this._mesh = [];\r\n\r\n let n = this.length;\r\n\r\n // sort the points and store the sorted index\r\n let indices:number[] = [];\r\n for (let i=0; i<n; i++) indices[i] = i;\r\n indices.sort( (i,j) => this[j][0] - this[i][0] );\r\n\r\n // duplicate the points list and add super triangle's points to it\r\n let pts = this.slice();\r\n let st = this._superTriangle();\r\n pts = pts.concat( st );\r\n\r\n // arrays to store edge buffer and opened triangles\r\n let opened:DelaunayShape[] = [ this._circum( n, n+1, n+2, st) ];\r\n let closed:DelaunayShape[] = [];\r\n let tris:GroupLike[] = [];\r\n\r\n // Go through each point using the sorted indices\r\n for (let i=0, len=indices.length; i<len; i++) {\r\n let c = indices[i];\r\n let edges:number[] = [];\r\n let j = opened.length;\r\n if (!this._mesh[c]) this._mesh[c] = {};\r\n\r\n // Go through each opened triangles\r\n while (j--) {\r\n let circum:DelaunayShape = opened[j];\r\n let radius = circum.circle[1][0];\r\n let d = pts[c].$subtract( circum.circle[0] );\r\n\r\n // if point is to the right of circumcircle, add it to closed list and don't check again\r\n if (d[0] > 0 && d[0]*d[0] > radius*radius) {\r\n closed.push( circum );\r\n tris.push( circum.triangle );\r\n opened.splice(j, 1);\r\n continue;\r\n }\r\n\r\n // if it's outside the circumcircle, skip\r\n if ( d[0]*d[0] + d[1]*d[1] - radius*radius > Const.epsilon) {\r\n continue;\r\n }\r\n\r\n // otherwise it's inside the circumcircle, so we add to edge buffer and remove it from the opened list\r\n edges.push( circum.i, circum.j, circum.j, circum.k, circum.k, circum.i );\r\n opened.splice(j, 1);\r\n }\r\n\r\n // dedup edges\r\n Delaunay._dedupe( edges );\r\n\r\n // Go through the edge buffer and create a triangle for each edge\r\n j = edges.length;\r\n while (j > 1) {\r\n opened.push( this._circum( edges[--j], edges[--j], c, false, pts) );\r\n }\r\n\r\n }\r\n\r\n for (let i=0, len=opened.length; i<len; i++) {\r\n let o = opened[i];\r\n if (o.i < n && o.j < n && o.k < n) {\r\n closed.push( o );\r\n tris.push( o.triangle );\r\n this._cache( o );\r\n }\r\n }\r\n\r\n return (triangleOnly) ? tris : closed;\r\n }\r\n\r\n\r\n /**\r\n * Generate Voronoi cells. `delaunay()` must be called before calling this function.\r\n * @returns an array of Groups, each of which represents a Voronoi cell\r\n */\r\n voronoi():Group[] {\r\n let vs = [];\r\n let n = this._mesh;\r\n for (let i=0, len=n.length; i<len; i++) {\r\n vs.push( this.neighborPts( i, true ) );\r\n }\r\n return vs;\r\n }\r\n\r\n\r\n /**\r\n * Get the cached mesh. The mesh is an array of objects, each of which representing the enclosing triangles around a Pt in this Delaunay group\r\n * @return an array of objects that store a series of DelaunayShapes\r\n */\r\n mesh():DelaunayMesh {\r\n return this._mesh;\r\n }\r\n\r\n\r\n /**\r\n * Given an index of a Pt in this Delaunay Group, returns its neighboring Pts in the network\r\n * @param i index of a Pt\r\n * @param sort if true, sort the neighbors so that their edges will form a polygon\r\n * @returns an array of Pts\r\n */\r\n neighborPts( i:number, sort=false ):GroupLike {\r\n let cs = new Group();\r\n let n = this._mesh;\r\n for (let k in n[i]) {\r\n if (n[i].hasOwnProperty(k)) cs.push( n[i][k].circle[0] );\r\n }\r\n return (sort) ? Geom.sortEdges( cs ) : cs;\r\n }\r\n\r\n\r\n /**\r\n * Given an index of a Pt in this Delaunay Group, returns its neighboring DelaunayShapes\r\n * @param i index of a Pt\r\n * @returns an array of DelaunayShapes `{i, j, k, triangle, circle}`\r\n */\r\n neighbors( i:number ):DelaunayShape[] {\r\n let cs = [];\r\n let n = this._mesh;\r\n for (let k in n[i]) {\r\n if (n[i].hasOwnProperty(k)) cs.push( n[i][k] );\r\n }\r\n return cs;\r\n }\r\n\r\n\r\n /**\r\n * Record a DelaunayShape in the mesh\r\n * @param o DelaunayShape instance\r\n */\r\n protected _cache( o ):void {\r\n this._mesh[o.i][`${Math.min(o.j,o.k)}-${Math.max(o.j,o.k)}`] = o;\r\n this._mesh[o.j][`${Math.min(o.i,o.k)}-${Math.max(o.i,o.k)}`] = o;\r\n this._mesh[o.k][`${Math.min(o.i,o.j)}-${Math.max(o.i,o.j)}`] = o;\r\n }\r\n\r\n\r\n /**\r\n * Get the initial \"super triangle\" that contains all the points in this set\r\n * @returns a Group representing a triangle\r\n */\r\n protected _superTriangle():Group {\r\n let minPt = this[0];\r\n let maxPt = this[0];\r\n for (let i=1, len=this.length; i<len; i++) {\r\n minPt = minPt.$min( this[i] );\r\n maxPt = maxPt.$max( this[i] );\r\n }\r\n\r\n let d = maxPt.$subtract( minPt );\r\n let mid = minPt.$add( maxPt ).divide(2);\r\n let dmax = Math.max( d[0], d[1] );\r\n\r\n return new Group( mid.$subtract(20*dmax, dmax), mid.$add( 0, 20*dmax), mid.$add(20*dmax, -dmax) );\r\n }\r\n\r\n\r\n /**\r\n * Get a triangle from 3 points in a list of points\r\n * @param i index 1\r\n * @param j index 2\r\n * @param k index 3\r\n * @param pts a Group of Pts\r\n */\r\n protected _triangle( i:number, j:number, k:number, pts:GroupLike=this):Group {\r\n return new Group( pts[i], pts[j], pts[k] );\r\n }\r\n\r\n\r\n /**\r\n * Get a circumcircle and triangle from 3 points in a list of points\r\n * @param i index 1\r\n * @param j index 2\r\n * @param k index 3\r\n * @param tri a Group representing a triangle, or `false` to create it from indices\r\n * @param pts a Group of Pts\r\n */\r\n protected _circum(i:number, j:number, k:number, tri:GroupLike|false, pts:GroupLike=this):DelaunayShape {\r\n let t = tri || this._triangle( i, j, k, pts );\r\n return {\r\n i: i,\r\n j: j,\r\n k: k,\r\n triangle: t,\r\n circle: Triangle.circumcircle( t )\r\n };\r\n }\r\n\r\n\r\n /**\r\n * Dedupe the edges array\r\n * @param edges \r\n */\r\n protected static _dedupe( edges:number[] ):number[] {\r\n let j = edges.length;\r\n\r\n while (j > 1) {\r\n let b = edges[--j];\r\n let a = edges[--j];\r\n let i=j;\r\n\r\n while (i > 1) {\r\n let n = edges[--i];\r\n let m = edges[--i];\r\n\r\n if ((a == m && b == n) || (a == n && b == m)) {\r\n edges.splice(j, 2);\r\n edges.splice(i, 2);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return edges;\r\n }\r\n\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/Create.ts","// Source code licensed under Apache License 2.0. \n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\n\n\nimport {IPlayer} from './Space';\nimport {VisualForm, Font} from \"./Form\";\nimport {Bound} from './Bound';\nimport {Geom} from './Num';\nimport {Const} from './Util';\nimport {Pt, PtLike, GroupLike, Group} from './Pt';\nimport {Rectangle} from \"./Op\";\nimport {DOMSpace, DOMFormContext} from \"./Dom\";\n\n\n\n/**\n * A Space for SVG elements\n */\nexport class SVGSpace extends DOMSpace {\n \n id: string = \"svgspace\";\n protected _bgcolor:string = \"#999\";\n \n\n /**\n * Create a SVGSpace which represents a Space for SVG elements\n * @param elem Specify an element by its \"id\" attribute as string, or by the element object itself. An element can be an existing `<svg>`, or a `<div>` container in which a new `<svg>` will be created. If left empty, a `<div id=\"pt_container\"><svg id=\"pt\" /></div>` will be added to DOM. Use css to customize its appearance if needed.\n * @param callback an optional callback `function(boundingBox, spaceElement)` to be called when canvas is appended and ready. Alternatively, a \"ready\" event will also be fired from the `<svg>` element when it's appended, which can be traced with `spaceInstance.canvas.addEventListener(\"ready\")`\n * @example `new SVGSpace( \"#myElementID\" )`\n */\n constructor( elem:string|Element, callback?:Function ) {\n super( elem, callback );\n \n if (this._canvas.nodeName.toLowerCase() != \"svg\") {\n let s = SVGSpace.svgElement( this._canvas, \"svg\", `${this.id}_svg` );\n this._container = this._canvas;\n this._canvas = s as SVGElement;\n }\n }\n \n\n /**\n * Get a new `SVGForm` for drawing\n * @see `SVGForm`\n */\n getForm():SVGForm { return new SVGForm( this ); }\n \n\n /**\n * Get the html element\n */\n get element():Element {\n return this._canvas;\n }\n\n /**\n * This overrides Space's `resize` function. It's used as a callback function for window's resize event and not usually called directly. You can keep track of resize events with `resize: (bound ,evt)` callback in your player objects (See `Space`'s `add()` function). \n * @param b a Bound object to resize to\n * @param evt Optionally pass a resize event\n */\n resize( b:Bound, evt?:Event):this {\n super.resize( b, evt );\n SVGSpace.setAttr( this.element, {\n \"viewBox\": `0 0 ${this.bound.width} ${this.bound.height}`,\n \"width\": `${this.bound.width}`,\n \"height\": `${this.bound.height}`,\n \"xmlns\": \"http://www.w3.org/2000/svg\",\n \"version\": \"1.1\"\n });\n return this;\n }\n \n\n /**\n * A static function to add a svg element inside a node. Usually you don't need to use this directly. See methods in `SVGForm` instead.\n * @param parent the parent element, or `null` to use current `<svg>` as parent.\n * @param name a string of element name, such as `rect` or `circle`\n * @param id id attribute of the new element\n */\n static svgElement( parent:Element, name:string, id?:string ):SVGElement {\n if (!parent || !parent.appendChild ) throw new Error( \"parent is not a valid DOM element\" );\n \n let elem = document.querySelector(`#${id}`);\n\n if (!elem) {\n elem = document.createElementNS( \"http://www.w3.org/2000/svg\", name );\n elem.setAttribute( \"id\", id );\n \n parent.appendChild( elem );\n }\n return elem as SVGElement;\n }\n \n \n \n /**\n * Remove an item from this Space\n * @param item a player item with an auto-assigned `animateID` property\n */\n remove( player:IPlayer ):this {\n let temp = this._container.querySelectorAll( \".\"+SVGForm.scopeID( player ) );\n \n temp.forEach( (el:Element) => { \n el.parentNode.removeChild( el );\n });\n \n return super.remove( player );\n }\n \n \n /**\n * Remove all items from this Space\n */\n removeAll():this {\n this._container.innerHTML = \"\";\n return super.removeAll();\n }\n \n}\n\n\n/**\n* SVGForm is an implementation of abstract class VisualForm. It provide methods to express Pts on SVGSpace. \n* You may extend SVGForm to implement your own expressions for SVGSpace.\n*/\nexport class SVGForm extends VisualForm {\n \n protected _ctx:DOMFormContext = {\n group: null,\n groupID: \"pts\",\n groupCount: 0,\n currentID: \"pts0\",\n currentClass: \"\",\n style: {\n \"filled\": true,\n \"stroked\": true,\n \"fill\": \"#f03\",\n \"stroke\": \"#fff\",\n \"stroke-width\": 1,\n \"stroke-linejoin\": \"bevel\",\n \"stroke-linecap\": \"sqaure\"\n },\n font: \"11px sans-serif\",\n fontSize: 11,\n fontFamily: \"sans-serif\"\n };\n \n static groupID:number = 0;\n static domID:number = 0;\n \n protected _space:SVGSpace;\n protected _ready:boolean = false;\n \n\n /**\n * Create a new SVGForm. You may also use `space.getForm()` to get the default form.\n * @param space an instance of SVGSpace\n */\n constructor( space:SVGSpace ) {\n super();\n this._space = space;\n \n this._space.add( { start: () => {\n this._ctx.group = this._space.element;\n this._ctx.groupID = \"pts_svg_\"+(SVGForm.groupID++);\n this._ready = true;\n }} );\n }\n \n\n /**\n * get the SVGSpace instance that this form is associated with\n */\n get space():SVGSpace { return this._space; }\n \n \n /**\n * Update a style in _ctx context or throw an Erorr if the style doesn't exist\n * @param k style key\n * @param v style value\n */\n protected styleTo( k, v ) { \n if (this._ctx.style[k] === undefined) throw new Error(`${k} style property doesn't exist`);\n this._ctx.style[k] = v; \n }\n \n\n /**\n * Set current fill style. Provide a valid color string or `false` to specify no fill color.\n * @example `form.fill(\"#F90\")`, `form.fill(\"rgba(0,0,0,.5\")`, `form.fill(false)`\n * @param c fill color\n */\n fill( c:string|boolean ):this {\n if (typeof c == \"boolean\") {\n this.styleTo( \"filled\", c );\n } else {\n this.styleTo( \"filled\", true );\n this.styleTo( \"fill\", c );\n }\n return this;\n }\n \n\n /**\n * Set current stroke style. Provide a valid color string or `false` to specify no stroke color.\n * @example `form.stroke(\"#F90\")`, `form.stroke(\"rgba(0,0,0,.5\")`, `form.stroke(false)`, `form.stroke(\"#000\", 0.5, 'round', 'square')`\n * @param c stroke color which can be as color, gradient, or pattern. (See [canvas documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle))\n * @param width Optional value (can be floating point) to set line width\n * @param linejoin Optional string to set line joint style. Can be \"miter\", \"bevel\", or \"round\".\n * @param linecap Optional string to set line cap style. Can be \"butt\", \"round\", or \"square\".\n */\n stroke( c:string|boolean, width?:number, linejoin?:string, linecap?:string ):this {\n if (typeof c == \"boolean\") {\n this.styleTo( \"stroked\", c );\n } else {\n this.styleTo( \"stroked\", true );\n this.styleTo( \"stroke\", c );\n if (width) this.styleTo( \"stroke-width\", width );\n if (linejoin) this.styleTo( \"stroke-linejoin\", linejoin );\n if (linecap) this.styleTo( \"stroke-linecap\", linecap );\n }\n return this;\n }\n\n\n /**\n * Add custom class to the created element\n * @param c custom class name or `false` to reset it\n * @example `form.fill(\"#f00\").cls(\"myClass\").rects(r)` `form.cls(false).circles(c)`\n */\n cls( c:string|boolean ) {\n if (typeof c == \"boolean\") {\n this._ctx.currentClass = \"\";\n } else {\n this._ctx.currentClass = c;\n }\n return this;\n }\n \n \n /**\n * Set the current font \n * @param sizeOrFont either a number to specify font-size, or a `Font` object to specify all font properties\n * @param weight Optional font-weight string such as \"bold\"\n * @param style Optional font-style string such as \"italic\"\n * @param lineHeight Optional line-height number suchas 1.5\n * @param family Optional font-family such as \"Helvetica, sans-serif\"\n * @example `form.font( myFont )`, `form.font(14, \"bold\")`\n */\n font( sizeOrFont:number|Font, weight?:string, style?:string, lineHeight?:number, family?:string ):this {\n if (typeof sizeOrFont == \"number\") {\n \n this._font.size = sizeOrFont;\n if (family) this._font.face = family;\n if (weight) this._font.weight = weight;\n if (style) this._font.style = style;\n if (lineHeight) this._font.lineHeight = lineHeight;\n this._ctx.font = this._font.value;\n \n } else {\n this._font = sizeOrFont;\n }\n return this;\n }\n \n\n /**\n * Reset the context's common styles to this form's styles. This supports using multiple forms on the same canvas context.\n */\n reset():this {\n this._ctx.style = {\n \"filled\": true, \"stroked\": true,\n \"fill\": \"#f03\", \"stroke\": \"#fff\",\n \"stroke-width\": 1,\n \"stroke-linejoin\": \"bevel\",\n \"stroke-linecap\": \"sqaure\"\n };\n\n this._font = new Font( 14, \"sans-serif\");\n this._ctx.font = this._font.value;\n\n return this;\n }\n\n \n /**\n * Set this form's group scope by an ID, and optionally define the group's parent element. A group scope keeps track of elements by their generated IDs, and updates their properties as needed. See also `scope()`.\n * @param group_id a string to use as prefix for the group's id. For example, group_id \"hello\" will create elements with id like \"hello-1\", \"hello-2\", etc\n * @param group Optional DOM or SVG element to define this group's parent element\n * @returns this form's context\n */\n updateScope( group_id:string, group?:Element ):object {\n this._ctx.group = group;\n this._ctx.groupID = group_id;\n this._ctx.groupCount = 0;\n this.nextID();\n return this._ctx;\n }\n \n\n /**\n * Set the current group scope to an item added into space, in order to keep track of any point, circle, etc created within it. The item must have an `animateID` property, so that elements created within the item will have generated IDs like \"item-{animateID}-{count}\".\n * @param item a \"player\" item that's added to space (see `space.add(...)`) and has an `animateID` property\n * @returns this form's context\n */\n scope( item:IPlayer ) {\n if (!item || item.animateID == null ) throw new Error(\"item not defined or not yet added to Space\");\n return this.updateScope( SVGForm.scopeID( item ), this.space.element );\n }\n \n \n /**\n * Get next available id in the current group\n * @returns an id string\n */\n nextID():string {\n this._ctx.groupCount++;\n this._ctx.currentID = `${this._ctx.groupID}-${this._ctx.groupCount}`;\n return this._ctx.currentID;\n }\n \n\n /**\n * A static function to generate an ID string based on a context object\n * @param ctx a context object for an SVGForm\n */\n static getID( ctx ):string {\n return ctx.currentID || `p-${SVGForm.domID++}`;\n }\n\n\n /**\n * A static function to generate an ID string for a scope, based on a \"player\" item in the Space\n * @param item a \"player\" item that's added to space (see `space.add(...)`) and has an `animateID` property\n */\n static scopeID( item:IPlayer ):string {\n return `item-${item.animateID}`;\n }\n \n\n /**\n * A static function to help adding style object to an element. This put all styles into `style` attribute instead of individual attributes, so that the styles can be parsed by Adobe Illustrator.\n * @param elem A DOM element to add to\n * @param styles an object of style properties\n * @example `SVGForm.style(elem, {fill: \"#f90\", stroke: false})`\n * @returns this DOM element \n */\n static style( elem:SVGElement, styles:object) {\n let st = [];\n\n if ( !styles[\"filled\"] ) st.push( \"fill: none\");\n if ( !styles[\"stroked\"] ) st.push( \"stroke: none\");\n \n for (let k in styles) {\n if ( styles.hasOwnProperty(k) && k != \"filled\" && k != \"stroked\" ) {\n let v = styles[k];\n if (v) {\n if ( !styles[\"filled\"] && k.indexOf('fill') === 0 ) {\n continue;\n } else if ( !styles[\"stroked\"] && k.indexOf('stroke') === 0 ) {\n continue;\n } else {\n st.push( `${k}: ${v}` );\n }\n }\n }\n }\n \n return DOMSpace.setAttr( elem, {style: st.join(\";\")} );\n }\n \n \n /**\n * Draws a point\n * @param ctx a context object of SVGForm\n * @param pt a Pt object or numeric array\n * @param radius radius of the point. Default is 5.\n * @param shape The shape of the point. Defaults to \"square\", but it can be \"circle\" or a custom shape function in your own implementation.\n * @example `SVGForm.point( p )`, `SVGForm.point( p, 10, \"circle\" )`\n */\n static point( ctx:DOMFormContext, pt:PtLike, radius:number=5, shape:string=\"square\" ):SVGElement {\n if (shape === \"circle\") {\n return SVGForm.circle( ctx, pt, radius );\n } else {\n return SVGForm.square( ctx, pt, radius );\n }\n }\n \n \n /**\n * Draws a point\n * @param p a Pt object\n * @param radius radius of the point. Default is 5.\n * @param shape The shape of the point. Defaults to \"square\", but it can be \"circle\" or a custom shape function in your own implementation.\n * @example `form.point( p )`, `form.point( p, 10, \"circle\" )`\n */\n point( pt:PtLike, radius:number=5, shape:string=\"square\" ):this {\n this.nextID();\n SVGForm.point( this._ctx, pt, radius, shape );\n return this;\n }\n \n\n /**\n * A static function to draw a circle\n * @param ctx a context object of SVGForm\n * @param pt center position of the circle\n * @param radius radius of the circle\n */\n static circle( ctx:DOMFormContext, pt:PtLike, radius:number=10 ):SVGElement {\n let elem = SVGSpace.svgElement( ctx.group, \"circle\", SVGForm.getID(ctx) );\n \n DOMSpace.setAttr( elem, {\n cx: pt[0],\n cy: pt[1],\n r: radius,\n 'class': `pts-svgform pts-circle ${ctx.currentClass}`,\n });\n \n SVGForm.style( elem, ctx.style );\n return elem;\n }\n \n\n /**\n * Draw a circle\n * @param pts usually a Group of 2 Pts, but it can also take an array of two numeric arrays [ [position], [size] ]\n * @see [`Circle.fromCenter`](./_op_.circle.html#frompt)\n */\n circle( pts:GroupLike|number[][] ):this {\n this.nextID();\n SVGForm.circle( this._ctx, pts[0], pts[1][0] );\n return this;\n }\n \n\n /**\n * A static function to draw an arc.\n * @param ctx a context object of SVGForm\n * @param pt center position \n * @param radius radius of the arc circle\n * @param startAngle start angle of the arc\n * @param endAngle end angle of the arc\n * @param cc an optional boolean value to specify if it should be drawn clockwise (`false`) or counter-clockwise (`true`). Default is clockwise.\n */\n static arc( ctx:DOMFormContext, pt:PtLike, radius:number, startAngle:number, endAngle:number, cc?:boolean ):SVGElement {\n let elem = SVGSpace.svgElement( ctx.group, \"path\", SVGForm.getID( ctx ) );\n \n const start = new Pt(pt).toAngle( startAngle, radius, true );\n const end = new Pt(pt).toAngle( endAngle, radius, true );\n const diff = Geom.boundAngle(endAngle) - Geom.boundAngle(startAngle);\n let largeArc = ( diff > Const.pi ) ? true : false;\n if (cc) largeArc = !largeArc;\n const sweep = (cc) ? \"0\" : \"1\";\n \n const d = `M ${start[0]} ${start[1]} A ${radius} ${radius} 0 ${largeArc ? \"1\" : \"0\"} ${sweep} ${end[0]} ${end[1]}`;\n \n DOMSpace.setAttr( elem, { \n d: d,\n 'class': `pts-svgform pts-arc ${ctx.currentClass}`,\n } );\n SVGForm.style( elem, ctx.style );\n return elem;\n }\n \n\n /**\n * Draw an arc.\n * @param pt center position\n * @param radius radius of the arc circle\n * @param startAngle start angle of the arc\n * @param endAngle end angle of the arc\n * @param cc an optional boolean value to specify if it should be drawn clockwise (`false`) or counter-clockwise (`true`). Default is clockwise.\n */\n arc( pt:PtLike, radius:number, startAngle:number, endAngle:number, cc?:boolean ):this {\n this.nextID();\n SVGForm.arc( this._ctx, pt, radius, startAngle, endAngle, cc );\n return this;\n }\n \n\n /**\n * A static function to draw a square \n * @param ctx a context object of SVGForm\n * @param pt center position of the square\n * @param halfsize half size of the square\n */\n static square( ctx:DOMFormContext, pt:PtLike, halfsize:number ) {\n let elem = SVGSpace.svgElement( ctx.group, \"rect\", SVGForm.getID( ctx ) );\n DOMSpace.setAttr( elem, {\n x: pt[0]-halfsize, \n y:pt[1]-halfsize, \n width: halfsize*2, \n height: halfsize*2,\n 'class': `pts-svgform pts-square ${ctx.currentClass}`,\n });\n SVGForm.style( elem, ctx.style );\n return elem;\n }\n \n\n /**\n * Draw a square, given a center and its half-size\n * @param pt center Pt\n * @param halfsize half-size\n */\n square( pt:PtLike, halfsize:number ):this {\n this.nextID();\n SVGForm.square( this._ctx, pt, halfsize );\n return this;\n } \n \n\n /**\n * A static function to draw a line\n * @param ctx a context object of SVGForm\n * @param pts a Group of multiple Pts, or an array of multiple numeric arrays\n */\n static line( ctx:DOMFormContext, pts:GroupLike|number[][] ):SVGElement {\n if (!this._checkSize( pts)) return;\n \n if (pts.length > 2) return SVGForm._poly( ctx, pts, false );\n \n let elem = SVGSpace.svgElement( ctx.group, \"line\", SVGForm.getID( ctx ) );\n \n DOMSpace.setAttr( elem, {\n x1: pts[0][0],\n y1: pts[0][1],\n x2: pts[1][0],\n y2: pts[1][1],\n 'class': `pts-svgform pts-line ${ctx.currentClass}`,\n });\n \n SVGForm.style( elem, ctx.style );\n return elem;\n }\n \n\n /**\n * Draw a line or polyline\n * @param pts a Group of multiple Pts, or an array of multiple numeric arrays\n */\n line( pts:GroupLike|number[][] ):this {\n this.nextID();\n SVGForm.line( this._ctx, pts );\n return this;\n }\n \n \n /**\n * A static helper function to draw polyline or polygon\n * @param ctx a context object of SVGForm\n * @param pts a Group of multiple Pts, or an array of multiple numeric arrays\n * @param closePath a boolean to specify if the polygon path should be closed\n */\n static _poly( ctx:DOMFormContext, pts:GroupLike|number[][], closePath:boolean=true) {\n if (!this._checkSize( pts)) return;\n \n let elem = SVGSpace.svgElement( ctx.group, ((closePath) ? \"polygon\" : \"polyline\"), SVGForm.getID(ctx) );\n let points:string = (pts as number[][]).reduce( (a, p) => a+`${p[0]},${p[1]} `, \"\");\n DOMSpace.setAttr( elem, {\n points: points,\n 'class': `pts-svgform pts-polygon ${ctx.currentClass}`,\n }); \n SVGForm.style( elem, ctx.style );\n return elem;\n }\n \n \n /**\n * A static function to draw polygon\n * @param ctx a context object of SVGForm\n * @param pts a Group of multiple Pts, or an array of multiple numeric arrays\n */\n static polygon( ctx:DOMFormContext, pts:GroupLike|number[][] ):SVGElement {\n return SVGForm._poly( ctx, pts, true );\n }\n \n\n /**\n * Draw a polygon\n * @param pts a Group of multiple Pts, or an array of multiple numeric arrays\n */\n polygon( pts:GroupLike|number[][] ):this {\n this.nextID();\n SVGForm.polygon( this._ctx, pts );\n return this;\n }\n \n \n /**\n * A static function to draw a rectangle\n * @param ctx a context object of SVGForm\n * @param pts usually a Group of 2 Pts specifying the top-left and bottom-right positions. Alternatively it can be an array of numeric arrays.\n */\n static rect( ctx:DOMFormContext, pts:GroupLike|number[][] ):SVGElement {\n if (!this._checkSize( pts)) return;\n \n let elem = SVGSpace.svgElement( ctx.group, \"rect\", SVGForm.getID(ctx) );\n let bound = Group.fromArray( pts ).boundingBox();\n let size = Rectangle.size( bound );\n \n DOMSpace.setAttr( elem, {\n x: bound[0][0],\n y: bound[0][1],\n width: size[0],\n height: size[1],\n 'class': `pts-svgform pts-rect ${ctx.currentClass}`,\n });\n \n SVGForm.style( elem, ctx.style );\n return elem;\n }\n \n \n /**\n * Draw a rectangle\n * @param pts usually a Group of 2 Pts specifying the top-left and bottom-right positions. Alternatively it can be an array of numeric arrays.\n */\n rect( pts:number[][]|Pt[] ):this {\n this.nextID();\n SVGForm.rect( this._ctx, pts );\n return this;\n }\n \n \n /**\n * A static function to draw text\n * @param ctx a context object of SVGForm\n * @param `pt` a Point object to specify the anchor point\n * @param `txt` a string of text to draw\n * @param `maxWidth` specify a maximum width per line\n */\n static text( ctx:DOMFormContext, pt:PtLike, txt:string ):SVGElement {\n let elem = SVGSpace.svgElement( ctx.group, \"text\", SVGForm.getID(ctx) );\n \n DOMSpace.setAttr( elem, {\n \"pointer-events\": \"none\",\n x: pt[0],\n y: pt[1],\n dx: 0, dy: 0,\n 'class': `pts-svgform pts-text ${ctx.currentClass}`,\n });\n \n elem.textContent = txt;\n \n SVGForm.style( elem, ctx.style );\n \n return elem;\n }\n \n\n /**\n * Draw text on canvas\n * @param `pt` a Pt or numeric array to specify the anchor point\n * @param `txt` text\n * @param `maxWidth` specify a maximum width per line\n */\n text( pt:PtLike, txt:string ): this {\n this.nextID();\n SVGForm.text( this._ctx, pt, txt );\n return this;\n }\n \n\n /**\n * A convenient way to draw some text on canvas for logging or debugging. It'll be draw on the top-left of the canvas as an overlay.\n * @param txt text\n */\n log( txt ):this {\n this.fill(\"#000\").stroke(\"#fff\", 0.5).text( [10,14], txt ); \n return this;\n }\n \n \n}\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/Svg.ts","// Source code licensed under Apache License 2.0.\n// Copyright © 2017 William Ngan. (https://github.com/williamngan/pts)\n\n\nimport {Pt, Group} from \"./Pt\";\nimport { Rectangle, Circle } from \"./Op\";\n\n\n/**\n * An enumeration of different UI types\n */\nexport enum UIShape {\n Rectangle, Circle, Polygon, Polyline, Line\n}\n\nexport const UIPointerActions = {\n up: \"up\", down: \"down\", move: \"move\", drag: \"drag\", drop: \"drop\", over: \"over\", out: \"out\"\n};\n\n\n/**\n * UIListener type\n */\nexport type UIHandler = ( pt:Pt, target:UI, type:string ) => void;\n\n\nexport class UI {\n group: Group;\n shape: UIShape;\n\n protected _id:string;\n protected _actions: {[key:string]: UIHandler };\n protected _states: {[key:string]: any};\n\n\n /**\n * Wrap an UI insider a group\n */\n constructor( group:Group, shape:UIShape, states: {}, id?:string ) {\n this.group = group;\n this.shape = shape;\n this._id = id;\n this._states = states;\n this._actions = {};\n }\n\n\n /**\n * Get and set uique id\n */\n get id():string { return this._id; }\n set id( d:string ) { this._id = d; } \n\n\n /**\n * Get a state\n * @param key state's name\n */\n state( key:string ):any {\n return this._states[key] || false;\n }\n\n\n /**\n * Add an event handler\n * @param key event key\n * @param fn handler function\n */\n on( key:string, fn:UIHandler ) {\n this._actions[key] = fn;\n return this;\n }\n\n\n /**\n * Remove an event handler\n * @param key even key\n * @param fn \n */\n off( key:string ) {\n delete this._actions[key];\n return this;\n }\n\n\n /**\n * Listen for interactions and trigger action handlers\n * @param key action key\n * @param p point to check\n */\n listen( key:string, p:Pt ):boolean {\n if ( this._actions[key] !== undefined ) {\n if ( this._trigger(p) ) {\n this._actions[key]( p, this, key );\n return true;\n }\n }\n return false;\n }\n\n\n /**\n * Take a custom render function to render this UI\n * @param fn render function\n */\n render( fn:( group:Group, states:{[key:string]: any}) => void ) {\n fn( this.group, this._states );\n }\n\n\n /**\n * Check intersection using a specific function based on UIShape\n * @param p a point to check\n */\n protected _trigger( p:Pt ):boolean {\n let fn = null;\n if (this.shape === UIShape.Rectangle) {\n fn = Rectangle.withinBound;\n } else if (this.shape === UIShape.Circle) {\n fn = Circle.withinBound;\n } else if (this.shape === UIShape.Polygon) {\n fn = Rectangle.withinBound;\n } else {\n return false;\n }\n\n return fn( this.group, p );\n }\n\n}\n\n\n/**\n * A simple UI button that can track clicks and hovers\n */\nexport class UIButton extends UI {\n\n _clicks:number = 0;\n\n constructor( group:Group, shape:UIShape, states: {}, id?:string ) {\n super( group, shape, states, id );\n }\n\n \n /**\n * Get the total number of clicks on this UIButton\n */\n get clicks():number { return this._clicks; }\n\n\n /**\n * Add a click handler\n * @param fn a function to handle clicks\n */\n onClick( fn:UIHandler ) {\n this._clicks++;\n this.on( UIPointerActions.up, fn );\n }\n\n \n /**\n * Add hover handler\n * @param over a function to handle when pointer enters hover\n * @param out a function to handle when pointer exits hover\n */\n onHover( over:UIHandler, out:UIHandler ) {\n this.on( UIPointerActions.over, over);\n this.on( UIPointerActions.out, out);\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/UI.ts","import * as _Bound from \"./Bound\";\nimport * as _Canvas from \"./Canvas\";\nimport * as _Create from \"./Create\";\nimport * as _Form from \"./Form\";\nimport * as _LinearAlgebra from \"./LinearAlgebra\";\nimport * as _Num from \"./Num\";\nimport * as _Op from \"./Op\";\nimport * as _Pt from \"./Pt\";\nimport * as _Space from \"./Space\";\nimport * as _Color from \"./Color\";\nimport * as _Util from \"./Util\";\nimport * as _Dom from \"./Dom\";\nimport * as _Svg from \"./Svg\";\nimport * as _Typography from \"./Typography\";\n\n// A function to switch scope for Pts library. eg, Pts.scope( Pts, window );\nlet namespace = ( sc:object ) => {\n let lib = module.exports;\n for (let k in lib) {\n if (k!=\"namespace\") {\n sc[k] = lib[k];\n }\n }\n};\n\nmodule.exports = {\n namespace,\n ..._Bound,\n ..._Canvas,\n ..._Create,\n ..._Form,\n ..._LinearAlgebra,\n ..._Op,\n ..._Num,\n ..._Pt,\n ..._Space,\n ..._Util,\n ..._Color,\n ..._Dom,\n ..._Svg,\n ..._Typography\n};\n\n\n// WEBPACK FOOTER //\n// ./~/tslint-loader??ref--0!./src/_lib.ts"],"sourceRoot":""}