# Changelog

- 2020-09-07
- Added the Circle.circleIntersection(Circle) function.
- Changed the vertAt function by switching sin and cos! The old version did not return the correct vertex (by angle) according to the assumed circle math. Please re-check your code if you already used this function.
- Added the drawutils.circleArc(…) function to draw sections of circles.

- 2020-08-19
- Ported the HobbyPath class from vanilla JS to TypeScript.
- Ported the CatmullRomPath class from vanilla JS to TypeScript.
- Ported the CubicSplinePath class from vanilla JS to TypeScript.
- Added the VertexAttr.visible attribute to toggle on/off the rendering of particular vertices.
- Added the VertexAnimator.Sinoid to the demos (see Hobby Curve).

- 2020-08-17
- Ported the convexHull algorithm to TypeScript.
- Ported the convexPolygonIncircle algorithm to TypeScript.
- Ported the Delaunay algorithm to TypeScript.

- 2020-08-12
- BezierPathInteractionHelper: Added a distance check before handling the click/tap event.
- Ported the VoronoiCell helper class (see demos) from vanilla JS to TypeScript.

- 2020-08-03 (1.8.3)
- Tweaked the BezierPathInteractionHelper.
- Added proper JSDoc tags to the MouseHandler and the KeyHandler.

- 2020-07-31
- Added PlotBoilerplate.getDraggedElementCount().

- 2020-07-28
- Added PlotBoilerplate.revertMousePosition(number,number) – the inverse function of transformMousePosition(…).
- Added Bézier curve splitting to the bezier-point-distance demo.
- KeyHandler: changed the ‘delete’ key code from 8 to 46.

- 2020-07-27
- Added the getVertexNear(XYCoords,number) function.
- Extended the remove(Drawable) function: vertices are now removed, too.

- 2020-07-24 (1.8.2)
- Fixed an error in the touch handlers ‘tap start’ function (nullpointerexception if empty area was tapped).
- Added CubicBezierPath.getClosestT(Vertex) function.
- Added BezierPath.getClosestT(Vertex) function.

- 2020-07-22
- Fixed missing dragStart and dragEnd events in touch mode (after switching from Touchy to AlloyFinger).

- 2020-07-21
- Changed the safeMargeByKeys function: all keys, from source and destination, will be used now.
- Changed the fetch.bool and fetch.number function: they will try a JSON.parse now on type mismatch (and use the fallback on failure of that).

- 2020-07-15
- Included the Bounds class into the bundle.
- Added the PlotBoilerplate.fitToBounds(Bounds) function to make zooming onto particular areas easier.

- 2020-07-14
- Changed the CubicBezierCurve.moveCurvePoint(…,Vertex) to moveCurvePoint(…,XYCoords), which is more generic.
- Changed the BezierPath.moveCurvePoint(…,Vertex) to moveCurvePoint(…,XYCoords), which is more generic.
- Added the autoDetectRetina param to PlotBoilerplate.

- 2020-07-06
- Added AlloyFinger support (will replace Touchy.js).
- Following new touch actions are now possible: panning (two fingers), zoominng (two fingers).

- 2020-07-03
- Fixed the selectedVerticesOnPolyon(Polygon) function: non-selectable vertices were selected too, before.
- Added the CubicBezierPath.getBounds() function.
- BezierPath: Made the private helper functions _locateUIndex, adjustPredecessorControlPoint, adjustSuccessorControlPoint to a private function.
- Added the BezierPath.getBounds() function.
- Added draw.rect(Vertex,number,number) function.

- 2020-07-01 (1.8.1)
- Tweaked the pattern gradient demo (rotation and scale).
- Prepared a new demo: with THREE.js.
- Changed the scope of BezierPath.fromJSON (is now static, was an instance method before).

- 2020-06-22 (1.8.0)
- Added the rasterScaleX and rasterScaleY config params.
- Added a context.clearRect() call to the clear() function; clearing with alpha channel did not work as expected.

- 2020-06-09
- Defined new private interface IDraggable and move the Draggable class into the main class.
- Refactored the JSDoc layout template for larger screens.
- Fixed the problem of undocumented main class (no docs in HTML were generated).

- 2020-05-26 (pap’s 74s birthday)
- Added functions Vertex.addX(number) and Vertex.addY(number).

- 2020-05-25
- Added the Circle.vertAt and the Circle.tangentAt functions.
- Added the basics for the gradient-pattern demo.

- 2020-05-20
- Created a script for the minmal npm package.

- 2020-05-18
- Added the Triangle.getIncenter() function.
- Added VoronoiCell.toPolygon() in the demos.
- Added proper JSDoc tags to the VoronoiCell class.

- 2020-05-15 (v1.7.8)
- Moved the bezier-autoadjust handling to a private helper function. Fixed the auto-update of last control point.

- 2020-05-12 (v1.7.7)
- The VertTuple.angle(line) param was still not optional. Changed that.
- Added the geomutils helper. First helper function: nsectAngle. (moved this from the demos).
- Added Triangle.getIncircularTriangle().
- Added Triangle.getIncircle().
- Changed the license vom CC-BY-4.0 to MIT.

- 2020-05-12 (v1.7.6)
- Fixed the annoying [Ctrl]-pressed bug; the reason was the missing key-up evend after [Ctrl]+[t]. This was browser-specific.
- Drawing any handles (square, circle, diamond) with lineWidth 1 now; this was not reset before.

- 2020-05-11 (v1.7.5)
- PlotBoilerplat.viewport() now return a proper Bounds instance.
- Added new class Bounds (implementing IBounds and XYDimension).
- Renamed interface Bounds to IBounds.
- Fixed a bug in the Triangle.getCircumcircle function (center was not cloned).
- Updated all demos with the new Circle class.
- Removed the BezierPath._roundToDigits helper function. Using Number.toFixed instead.
- Added proper JSDoc class specifications to Bounds, Triangle and Circle.

- 2020-05-09 (v1.7.4)
- Included the Circle class from the demos into the plot-boilerlplate core repertoire.

- 2020-05-05
- Added the ‘lineWidth’ param to the circle(…) function.
- Finished the circle-in-convex-polygog demo.

- 2020-05-04
- Added a stub for the circle-in-convex-polygon demo.
- Fixed a serious bug in the VertTuple.pointDistance function.
- Refactored the VertTuple class a bit. Added missing JSDoc tags.
- Added the VertTuple.getClosestPoint(Vertex) function.

- 2020-04-27
- Added the Urquhart graph demo.

- 2020-04-08
- Fixed the MouseHandler’s click event (internally fired a ‘mouseup’ event).
- The new version always installs internal listenrs to track drag events even if there is no external drag listener installed (1.1.0).

- 2020-04-07 (v1.7.1)
- Fixed an error in the draw.grid(…) function. Non-rastered grids were not properly drawn on zoom and pan comibinations.

- 2020-04-06
- Fixed the radius error in the drawutils.circleHandle function. The radius parameter had no effect and circle handles were always rendered with radius 3.

- 2020-04-03 (v1.7.0)
- Fixed broken SVG export (after porting to TS).
- Fixed broken canvas resizer (after porting to TS).

- 2020-04-01
- Refactored Jekyll config to work with the new paths (post Typescript migration).
- Refactored the demos to work with the new paths (post Typescript migration).

- 2020-03-31
- Reconfigured the typescript compiler for es5.
- Reconfigured webpack.
- Tweaked the main demo for some moved files.

- 2020-03-30
- Ported the main class of PlotBoilerplate to Typescript.
- Moved the RectSelector from the main class to the demo section.
- Added a utils wrapper that intializes the GUI (dat.gui.GUI).
- Updated the logistic-map demo.

- 2020-03-28
- Ported following classes to Typescript: KeyHandler.

- 2020-03-25
- Ported following classes to Typescript: drawutils, drawutilsgl, Grid, VEllipse, Triangle, SVGBuilder, MouseHandler.

- 2020-03-24
- Ported following classes to Typescript: CubicBezierCurve, BezierPath, Polygon, gup.
- Added VertTuple
to solve the subclassing and clonable problem. - 2020-03-23
- Ported following classes to Typescript: Vertex, Line, VertexAttr, VertexListeners.

- 2020-03-17
- Added the Triangle.toPolygon() function.
- Added proper JSDoc tags to the Triangle class.
- Added a new demo: ported the Morley-Triangle visualization (from an older project).
- Fixed an issue in the safeMergeKeys function (‘funcion’ type was flawed).

- 2020-03-16
- Added Triangle.fromArray(Array) function.
- The Line.angle(Line) parameter is now optional. The baseline (x-axis) will be used if not defined.

- 2020-02-29
- Added the VertexAttr.selectable attribute.

- 2020-02-22
- Added ‘return this’ to VertexListeners addDragListener, addDragStartListener, addDragEnd functions (for chanining).

- 2020-02-11
- Added ‘return this’ to the BezierPath.scale(Vertex,number) and to the .translace(Vertex) functions.

- 2020-02-10
- Added the CubixBezierCurve.reverse() function.
- Fixed the CubicbezierCurve.translate(Vector) function (returning ‘this’ was missing).

- 2020-02-09
- Added the BezierPath.getSubPathAt(number,number) function.

- 2020-02-08
- Added the CubicBezierCurve isInstance(any) function.

- 2020-02-07
- Added function BezierPath.locateCurveByEndPoint( Vertex ).
- Added handling for the end- and end-control-points of non-cirular Bézier paths (was still missing).
- Added functions Vertex.invX() and Vertex.invY().
- Added the CubicBezierCurve.getSubCurveAt(number,number) function.
- Fixed a drag-amount bug in the move handling of end points of Bezier paths (control points was not properly moved when non circular).
- Fixed a serious bug in the arc lenght calculation (length was never reset, urgh).

- 2020-01-13
- Added a ‘CanvasPointList’ to the demos to make point count managing easier.

- 2020-01-09
- Added the ‘lineWidth’ param to the draw.ellipse(…) function.
- Fixed a bug in the Color.parse(string) function. Hex color with three elements were consideres faulty.
- Added a getContrastColor(color) helper function to the demo directory. This requires a color object, not a string!

- 2019-12-20
- Added the ‘lineWidth’ param to the draw.polyline(…) function.

- 2019-12-18
- Added the draw.quadraticBezier(…) function (for the sake of approximating Lissajous curves).

- 2019-12-15
- Added the Line.moveTo(Vertex) fucnction.

- 2019-12-11
- Added the ‘color’ param to the draw.label(…) function.
- Fixed the draggable-intersection-point issue in the line-point-distance demo.
- Added a working bark-beetle-tunnel demo to the line-point-distance demo. There was an odering problem.

- 2019-12-09
- Fixed the Triangle.determinant() function. The calculation was just wrong.
- Removed an unnecesary if-condition from the VoronoiCell._calculateOpenEdgePoint(…) helper function.
- Extended the line-point-distance demo with some toy features.

- 2019-12-08 (1.6.3)
- Fixed a css scale bug in the viewport() function.
- Added the drawconfig UI panel (line colors and line widths).

- 2019-12-07
- Added a fallback CSS raster (inline PNG).
- Added the drawConfig for lines, polygons, ellipse, triangles, bezier curves and image control lines.
- Added a new demo for bezier spline interpolation.

- 2019-12-04 (1.6.0)
- Added relative positioned zooming.
- Added offsetX and offsetY params.
- Added an ‘Set to fullsize retina’ button to the GUI config.
- Added the Vector.inv() function.

- 2019-12-03
- Fixed a bug in the Bézier perpenicular demo (arc length were not updated after changes or before redraw).

- 2019-12-02 (1.5.1)
- Fixed the CubicBezierCurve.updateArcLength function. It used the wrong pointAt function.
- Added the Bézier perpendicular demo (11).
- Added the demo for simple tween animations (using GSAP).

- 2019-11-22
- Added the Polygon.rotate(number,Vertex) function.
- Fixed a bug in Vertex.rotate(…).
- Added a second workaround for th drawImage bug in Safari.
- Added a GSAP/TweenMax animation example.

- 2019-11-21
- Fixed a bug in the rotate(…) function (elements were moved).

- 2019-11-19
- Fixed a bug in the resizeCanvas function; retina resolution was not possible.

- 2019-11-18 (1.5.0)
- Added the Triangle class as a direct drawable class to the PlotBoilerplate (was in the demos only before).
- Added the drawutils.polyline(Vertex[],boolean,color) function.
- The PlotBoilerplate.add(…) function now works with arrays, too.
- Added the _handleColor helper function to determine the render color of non-draggable vertices.
- Fixed the BezierPath.clone function: adjustCircular attribute was not cloned.
- Added the Vertex.rotate(number,Vertex) function.
- Added the BezierPath.rotate(number,Vertex) function.
- Non-draggable vertices are now be excluded by the locateNear(…) function. There is no use locating non-draggable vertcies as they may block underlying draggable vertices.

- 2019-11-13
- Fixed an issue with the mouse-sensitive area around vertices (were affected by zoom).

- 2019-11-07
- Added Vertex.toSVGString(object) function.
- Added Polygon.Added toCubicBezierPath(number) function.
- Added SVG export for postDraw-rendering in the Voronoi demo.
- Added the ‘Triangle’ style class to the SVGBuilder.

- 2019-11-06
- Added fetch.num, fetch.val, fetch.bool, fetch.func functions for easier config props fetching.

- 2019-10-30
- Renamed the demo/VertexAnimator to demo/VertexAnimator.Linear.
- Added a new class demo/VertexAnimator.Cirular.

- 2019-10-25
- Added proper JSDoc comments to the Voronoi cell code.
- Polygons are no longer drawn with dashed lines (solid lines instead).
- Added the Polygon.scale(number,Vertex) function.
- Fixed a serious bug in the VoronoiCell.toPathArray function; cell with only one vertex (extreme cases) returned invalid arrays which broke the rendering.

- 2019-10-03
- Added the {draw,drawgl}.beginDrawCycle fuction.

- 2019-09-18
- Added an experimental GL drawing stub (drawgl).

- 2019-09-12
- Added JSDoc compliant comments to the (inofficial) Triangle class.

- 2019-09-11
- (Inofficial) Added the Triangle.scaleToCentroid(Number) function (used by the walking triangle demo).

- 2019-09-02
- Added the Line.add( Vertex ) function.
- Added the Vector.perp() function for calculating perpendiculars (required for the upcoming GLSL support).
- Added the Vector.inverse() function.
- Added the Line.denominator( Line ) function.
- Fixed a severe error in the Line.intersection( Line ) function (class Point was renamed to Vertex).

- 2019-04-28
- Added Math.round to the dot() drawing parameters to really draw a singlt dot.
- Added the preClear callback param (called before the canvas was cleared on redraw and before any elements are drawn).
- Fixed a bug in the Line.sub( Vertex ) function (was not working).

- 2019-04-27
- Fixed a severe drawing bug in the arrow(…) function. Scaling arrows did not work properly.
- Changed the vectorfield demo to a more beautiful one.
- Watched the ending of star trek discovery when doing that.

- 2019-04-24
- Added the Vertex.randomVertex(ViewPort) fuction.
- Added the VertexAnimator for demos.

- 2019-04-17
- Added the PlotBoilerplate.removeVertex(Vertex,boolean) function.

- 2019-04-16
- Added the PlotboilerPlate.remove(drawable) function.
- Added the draw.cubicBezierPath(path,color) function.
- Added the Voronoi and Delaunay demo.

- 2019-04-12
- Added the PlotBoilerplate.drawConfig with ‘drawVerices’ attribute.
- Extended the gui a bit.

- 2019-04-11
- Added the ‘drawGrid’ config param.
- Added the simple animation demo.
- Added the PlotBoilerplate.viewport() function.

- 2019-04-07
- Re-styled the website, optimized the css, merged jekyll-css with jsdoc-css.

- 2019-04-03
- Fixed wrong positioning on touch devices when canvas is not located at (0,0). Touch-drag is now working.
- Tweaked the fit-to-parent function. This is now working and respecting paddings and borders.
- Added a fix for Touchy.js: e.preventDefault() to avoid window scrolling during element drag (touch-move).

- 2019-03-28
- Mouse wheel zoom now calls e.preventDefault().
- Added the unminified-webpack-plugin.
- Removed the overlay-dialog from the plot-boilerplate as it was not used at all.

- 2019-03-27
- Renamed the repository from plot-boilerplate to plotboilerplate.

- 2019-03-25
- Moved the collection demo scripts to demo/.

- 2019-03-23
- Added more JSDoc code.
- Changed the default value of config param ‘drawOrigin’ to false.
- Swapped the BezierPath.getPoint and getPointAt to match the semantics with linear interpolation in the Line class. This makes the class incompatible with older versions! Thus: BezierPath version 2.0.

- 2019-03-20
- Added JSDoc inline documentation for these classes: Vertex, Line, Vector, VertexAttr, VertexListeners, Polygon.

- 2019-02-23
- Removed the ‘rebuild’ function as it had no purpose.
- Added scaling of the click-/touch-tolerance with the CSS scale.
- Added the helper function PlotBoilerplate.utils.buildArrowHead(Vertex,Vertex,Number,Number,Number).
- Added the Vector.toSVGString function, overriding Line.toSVGString.
- Tweaked the initial vector field demo a little bit (it’s really fancy now but still not yet finished).

- 2019-02-20
- Removed the ‘loadFile’ entry from the GUI as it was experimental and never in use.

- 2019-02-19
- Added the Vertex.difference(Vertex) function.
- Put the TouchHandler back because it is badly coded and rubbish. Used Touchy.js instead.
- Added two new constants: DEFAULT_CLICK_TOLERANCE and DEFAULT_TOUCH_TOLERANCE. Touch devices have larger tolerance now.
- Added the second param to the locatePointNear(Vertex,Number) function.

- 2019-02-14
- Added the console for debugging (setConsole(object)).

- 2019-02-10
- Fixed a draggable-bug in PBImage handling (scaling was not possible).
- Added the ‘enableTouch’ option (default is true).

- 2019-02-06
- Vertices (instace of Vertex) can now be added using PlotBoilerplate.add(Object).
- Added the ‘draggable’ attribute to the vertex attributes.
- Added the point-to-line distance demo.

- 2019-02-03
- Removed the drawBackgroundImage() function, with had no purpose at all. Just add an image to the drawables-list.

- 2019-02-02
- Added the ‘canvasWidthFactor’ and ‘canvasHeightFactor’ params.

- 2019-01-30
- Fixed the offsetAdjustXPercent and offsetAdjustYPercent bug. They are working properly now.
- Added the Vector class (subclass of Line).
- Added the draw.arrow(Vertex,Vertex,color) function for drawing arrow heads.
- Added the Vertex.setX(Number) and Vertex.setY(Number) functions.
- Added the PBImage type.
- Added image rendering.

- 2019-01-14
- Added params ‘drawBezierHandleLines’ and ‘drawBezierHandlePoints’.
- Added the ‘redraw’ param to the add() function.

- 2018-12-30
- Added the PlotBoilerplate.RectSelector helper for selecting sub areas of the current plot without interfering with the current plot progress.

- 2018-12-29
- Renamed the ‘autoCenterOffset’ param to ‘autoAdjustOffset’.
- Added the params ‘offsetAdjustXPercent’ and ‘offsetAdjustYPercent’.

- 2018-12-29
- Fixed a bug in the Feigenbaum demo: y was plotted inverted.

- 2018-12-28
- Removed the unused ‘drawLabel’ param.
- Added the ‘enableMouse’ and ‘enableKeys’ params.

- 2018-12-21
- Added the Vertex.inv() function.
- Fixed the grid offset problem. Grid is now always drawn in visible center.
- Logarithmic reduction of the grid is now working.
- Added a small test case for balanced binary search trees.
- Refactored the redraw() function into several sub-functions for drawing several elements.

- 2018-12-20
- Fixed a bug in the location-transformation (did not consider the CSS scale yet).

- 2018-12-19
- Added cssScaling for the canvas. This allows other resolutions than 1:1.

- 2018-12-18
- Added the config.redrawOnResize param.
- Added the config.defaultCanvasWidth and config.defaultCanvasHeight params.
- Fixed the action bugs for the default overlay buttons (OK and cancel had no action assigned).
- Added a default function for creating a dat.gui interface.

- 2018-12-09
- Minimal zoom is now 0.01.
- Added Grid.utils.baseLog(Nnumber,Number) and Grid.utils.mapRasterScale(Number,Number).
- Bézier control points are not selectable any more.
- Basic SVG export works now.
- Added toSVGString to VEllipse class.
- Added to SVGString to Polygon class.
- Added a Line class.
- Changed Bézier control points rendering.
- Added a demo plot: main-feigenbaum.html.

- 2018-12-06
- Changed the CTRL key to the ALT key (for panning).
- Fixed a translate an scale issue in the SVG builder.
- The constructor’s config-param is in use now.

- 2018-12-05
- Added the Vertex.sub(x,y) function.
- Added the Line class.
- Moved the demo code (Line, Polygon, Bezier, Circle) to the index.js file.
- Expanded the Vertex.add(…) function. Now add(number,number) and add(Vertex) are allowed.

- 2018-12-04
- Added a simple SVGBuilder.

- 2018-11-30
- Added the mouse position display.

- 2018-11-28
- Extended the VertexAttr class (extended the event params by the affected vertex).
- Added BezierPath.locateCurveBy*Point(Vertex) functions.
- Added the mousewheel listener to the MouseHandler.
- Added mousewheel zoom.
- Added the VEllipse (vertex-ellipse) class and ellipse drawing.
- Added the Grid class.
- Added the grid() function to the draw class.

- 2018-11-27
- Added an attribute model to the VertexAttr class.
- Changing bezier path points with holding down ‘y’+click is now possible (bezier-autoadjust).
- Added a new function to the draw class: diamondHandle.

- 2018-11-20
- Bézier curve does now auto adjust when dragging path points and control points.
- BezierPath implementation now support circular paths.
- Fixed some issues in the dat.gui interface configuration. Axis independent scaling works now.

- 2018-11-19
- Re-animated the CubicBezierCurve class and the BezierPath class.
- Added multi-select and multi-drag option.
- Made elements selectable (with holding SHIFT).
- Added panning (move the canvas origin by pressing CTRL and drag).
- Implemented zoom into dat.gui interface.

- 2018-11-17
- Added the Polygon class.
- Added npm/webpack for compiling and code minification.

- 2018-11-11
- Added a simple KeyHandler for receiving key events.

- 2018-11-10
- Renamed the js/ direcotory to src/.

- 2018-11-09
- Refactored the main script to a class.

- 2018-10-31
- Added the Vertex class from an older project.
- Added the VertexAttr class (not yet in use).
- Added the VertexListeners class (not yet in use).
- Added the MouseListener from an older project.
- Can drag vertices around now.

- 2018-10-23
- Init.