The Angular Dev Toolkit

Angular2-825x510

In 2004, I began the practice of maintaining an organized Actionscript/Flash library that would be installed at all clients.  This allowed me to organize and centralize common code that I used repeatedly at practically every gig.

Shortly after the Angular 2 release in 2016, I began organizing frequently used Typescript code and Angular components into a library project I named ‘The Angular Dev Toolkit.’  In reality, the library is largely Typescript libraries and utilities, with a small number of Angular components/directives/pipes/validators.  I’ve never liked this organization, so the library will be refactored in the future to better adhere to separation of concerns.  I have become a fan of the NWRL Nx utility, so the project will be re-scaffolded with Nx.  Typescript libraries/utils and Angular-specific features will be in separate libraries, all under the ‘umbrella’ (too bad I can’t use the Umbrella Corp logo) of ‘The Angular Dev Toolkit.’

In the mean time, this post serves as a permanent link to describe the current library contents.  All code in the toolkit is Apache 2.0 licensed and while it contains some of my open-source code, much of the library is closed and client-proprietary.  As such, it’s one of my key competitive advantages, since every client who hires me is several tens of thousands of lines of code further ahead from day one than if they hired someone else.  Every client may continue to use the library free of charge and for any commercial project for as long as desired, after my contract is over.

So, here we go (folders are bold highlighted)

ANGULAR DEV TOOLKIT

src
-- actions (simple set of ngrx/store actions for generic app and user slices of the store)
-- components
----- breadcrumbs (simple breadcrumbs that can be extended for a variety of apps)
----- graph-component (single-quadrant graphing engine)
----- login (template for a basic login screen)
----- menu (template for a basic menu)
----- paging-bar (configurable paging bar)
-- core
----- drawing
-------- DrawStack.ts (draw-stack for drawing an object inside an arbitrary bounding-box)
-------- LineDecoratorFactory.ts (Factory to generate line decorators, i.e. dashed, dotted)
-------- ShapeConstants.ts (constants that apply to imperatively drawing a variety of shapes)
----- shapes
-------- ArcTo.ts (implementation of the arc-to algorithm)
-------- Arrow.ts (arrows in horizontal or vertical orientation)
-------- CircularArc.ts (circular arc in [0, 2*pi])
-------- CSection.ts (C-section)
-------- CurvedArrow.ts (arrow with a quad bezier base)
-------- EllipticalArc.ts (elliptical arc in [0, 2*pi]
-------- ISection.ts (I-section)
-------- LSection.ts (L-section)
-------- Wedge.ts (wedges or pie sections)
-- directives 
----- basic-scene.directive.ts (for BabylonJS)
----- canvas-selector.directive.ts
----- href.directive.ts
----- input-selector.directive.ts
----- make-clickable.directive.ts
----- media-toggle.directive.ts
-- enums
----- UserRoleEnum.ts
-- guards
----- AuthGuard.ts
-- interceptors
----- ErrorInterceptor.ts
----- TokenInterceptor.ts
-- interfaces
----- IBreadcrumbItem.ts
----- IHierarchySearchResult.ts (result from recursive, hierarchical search)
----- IMenuItem.ts
----- IPageChange.ts
----- IPoint.ts
----- IQuadBezierParam.ts (parameters of a quadratic Bezier curve)
----- ISimAnneal.ts (simulated annealing problem description, WIP)
-- libs
----- ai
-------- decision-tree (data-driven decision tree based on general tree and expression engine)
----------- DecisionTree.ts
-------- fsm (reactive, data-driven finite-state machine)
----------- FiniteStateMachine.ts
-------- pathfinding (placeholder for A* for waypoints, WIP)
----------- AStarWaypoint.ts
-------- sequencing-engine (drive multiple decision trees in sequence, also data-driven)
----------- SequencingEngine.ts
-------- simanneal (simulated annealing solver, WIP)
---------- Simulate.ts
-------- text-vsm (text to Vector State Model, text freq., inv. doc. freq, cosine sim. library)
---------- cosineSim.ts
---------- score.ts
---------- textToVSM.ts
---------- TlIDF.ts
---------- toVector.ts
---------- vsmMod.ts
---------- vsmNorm.ts
----- barcode
-------- code39.ts (code-39 barcode generator for Canvas surface)
----- composable (functions that can be used in composition)
-------- Fcns.ts
---------- reverseChars
---------- initials
---------- padLeft
---------- minValue
---------- maxValue
---------- areGreaterThan
---------- getAllGreaterThan
---------- indexFirstGreaterThan
----- misc
-------- CookieMgr.ts
-------- DayHourOffset.ts
-------- DayIterator.ts
-------- getIntervalsBetweenDays.ts
-------- LocalStorageMgr.ts
-------- toCap.ts
-------- toMsec.ts
----- paging
-------- Paging.ts (manage paging of an array of Object data)
----- search
-------- Hierarchy.ts (recursively search a hierarchical structure)
----- sorting
-------- CountingSort.ts (implementation of counting sort algorithm)
-------- SortOn (sort an array of objects based on a set of input properties)
----- tsmt (subset of the Typescript Math Toolkit)
-------- crypto
----------- core
-------------- Euclid.ts (LCM, GCD, and extended Euclid's algorithm)
-------- data-frame (Dataframe analysis, similar to R)
----------- Chi2.ts (chi-squared - to be merged into statistics folder)
----------- CompareUtils.ts (scalar/vector comparisons)
----------- DataFrame.ts (organize/analyze 2D tables of string/numeric data)
----------- FrameStats.ts (variety of stats on data frame columns)
----------- Spcfcn.ts (special functions, beta, approx beta, beta-inverse, log-gamma, etc - to be placed in math or statistics)
----------- TableAnalysis.ts (one-way and two-way table analysis - cross-tab)
-------- datastructures
----------- AVLTree.ts
----------- BTreeLight.ts
----------- BTreeNode.ts
----------- BTreeUtils.ts
----------- DisjointSet.ts
----------- DSNode.ts
----------- DSNodeImpl.ts
----------- Graph.ts
----------- GraphArc.ts
----------- Heap.ts
----------- IBTree.ts
----------- IPrioritizable
----------- LinkedList.ts
----------- ListNode.ts
----------- Prioritizable.ts
----------- PriorityQueue.ts
----------- Queue.ts
----------- SimpleGraph.ts
----------- SkipList.ts
----------- SkipListNode.ts
----------- SkipListNodeImpl.ts
----------- Stack.ts
----------- Tree.ts
----------- TreeNode.ts
-------- decorators (line decorators for programmatic drawing)
----------- AbstractLineDecorator.ts
----------- DashedLineDecorator.ts
----------- DottedLineDecorator.ts
----------- IGraphics.ts
----------- ILineDecorator.ts
-------- drawing (utilities for programmatic drawing/graphing)
----------- Axis.ts
----------- FunctionDrawProperties.ts
----------- GraphAxis.ts
----------- GraphDrawProperties.ts
----------- LabelDrawProperties.ts
----------- Quadrant.ts
-------- expression-engine (parse and evaluate expressions for multiple independent variables)
----------- ExpressionEngine.ts
-------- functionparser (parse and evaluate functions of one or more independent variables)
----------- FunctionParser.ts
-------- geom (analytic and computational geometry utilities; line simplification methods)
----------- Circle.ts
----------- ConvexHull.ts
----------- Coordinate.ts
----------- DouglasPeucker.ts
----------- IPlanarCurve.ts
----------- Lang.js
----------- Layout.ts
----------- LayoutObject.ts
----------- LayoutPoint.ts
----------- LayoutTypeEnum.ts
----------- Line.ts
----------- McMaster.ts
----------- PlanarCurve.ts
----------- Point.ts
----------- Polygon.ts
----------- QuadBezier.ts
----------- RegularNGon.ts
----------- TwoPointCurve.ts
----------- Units.ts
-------- item-allocation (continuous and 0-1 knapsack problem)
----------- AllocatableItem.ts
----------- DefaultItemStrategy.ts
----------- IAllocatableItemProps.ts
----------- IAllocationStrategy.ts
----------- ItemAllocation.ts
----------- Knapsack.ts
----------- Matrix.ts
-------- math (some general math utils)
----------- Derivative.ts (some methods for numerical estimation of a function's first derivative)
----------- Matrix.ts (general dense matrix and linear system solver)
----------- Neville.ts (Neville's method for polynomial interpolation)
----------- PrimeFactorization.ts (prime factorization of modest-sized integers)
----------- Quaternion.ts (general quaternion operations and slerp)
----------- RepeatToFrac.ts (repeating decimal to fraction)
-------- misc
----------- UndoRedo.ts (supports general Undo/Redo operations - built on top of TSMT Linked List)
-------- random (utilities for pseudo-random generation and random integer in a range)
----------- RandomIntInRange.ts (with endpoint bias compensation)
----------- SeededRng.ts (implementation of Park-Miller generator)
-------- shuffle
----------- fisher-yates.ts (fisher-rates algorithm ... don't leave home without it)
-------- statistics (lies, damned lies, and statistics)
----------- bayes
-------------- Bayes.ts
-------------- FrequencyTable.ts
----------- BinomialCoef.ts
----------- DataStats.ts
----------- ExtNormal.ts (extended Normal class - approx. distribution with sequence of quad bezier curves)
----------- Normal.ts (computations dealing with normal distribution)
----------- Poisson.ts (computations dealing with Poisson distribution)
----------- regression
-------------- Bagging.ts (helper class for computations involving bagging)
-------------- Bllsq.ts (bagged linear least squares)
-------------- Deviates.ts (pseudo-random deviates from popular distributions)
-------------- llsq.ts (linear least squares)
-------------- Pllsq.ts (general polynomial least squares)
----------- utils (general utilities)
-------------- ApproxEqual.ts (compare numbers for approximate equality)
-------------- ArrayFunctions.ts (some one-liner array functions)
-------------- balancedparens.ts (balanced parens, brackets, etc)
-------------- Bisect.ts (bisect and interval, looking for a root)
-------------- CircleUtils.ts (a large number of circle-related functions)
-------------- CompareUtils.ts (comparisons for exact/approximate equality)
-------------- CubicRoots.ts (root-finder for cubic polynomials with real coefficients)
-------------- Gauss.ts (Gaussian quadrature for numerical integration)
-------------- General.ts (replacements - to be inlined - for common loadash functions)
-------------- GeomUtils.ts (large collection of general analytic geometry functions)
-------------- Halley.ts (Halley's method for root finding)
-------------- Interp.ts (linear interpolation)
-------------- LayoutUtils.ts (utilities to support a layout - mapping between user-coordinates and canvas pixel space)
-------------- Limits.ts (some machine limits useful in numerical algorithms)
-------------- MathUtils.ts (another place to find LCM, GCD and simple arithmetic-related utilities)
-------------- Newton.ts (Newton's method for root-finding)
-------------- NumberFormatter.ts (general number formatter - supports exponentiation and scientific notation)
-------------- PackingUtils.ts (some utilities for spatial packing problems)
-------------- PointUtils.ts (utilities involving computations on Points and Point clouds)
-------------- QuadBezierInterpolate.ts (three-point quadratic bezier interpolation)
-------------- Solve2x2.ts (linear system solver optimized for 2x2 matrices)
-------------- StringUtils.ts (a wide variety of string utility functions)
-------------- TableFilter.ts (filter a selection of table rows (and optional 2nd table) based on supplied column values)
-------------- Timer.ts (reactive, general-purpose timing function)
-------------- TWBRF.ts (port of Jack Crenshaw's Worlds Best Root Finder)
------------ validation
--------------- Validation.ts (number/vector/matrix checks for validity and basic comparison vs a tolerance)
--------- logging
------------ Log.ts (general logging class to use with Angular services)
--------- models (some generic models for use with ngrx/store - slices of global store)
------------ App.ts (application model)
------------ IAddress.ts (interface for an address model)
------------ IAppAction.ts (interface for an app action)
------------ ILoggingAction.ts (interface for a logging action)
------------ IUser.ts (interface for a User model)
------------ User.ts (specific implementation of IUser)
---------- pipes (some Angular pipes)
------------- null-dash (display a dash for null/undefined value)
------------- phoneNumber (format a phone number that is provided as a continuous set of digits)
------------- scientific (display a number in scientific/exponential notation)
---------- reducers (stock reducers for ngrx/store)
-------------- app.ts (baseline application model reducer)
-------------- user.ts (baseline user model reducer)
---------- services
------------- breadcrumb.service.ts
------------- media.services.ts
------------- window-resize.service.ts
---------- state (more models for ngrx/store)
------------- State.ts (a baseline state consisting of app and user slices)
---------- styles (some baseline styles for ADT components)
------------- colors.scss
------------- core.scss
------------- text.scss
---------- validators (form validators)
------------- CCTypes.ts (types of credit cards)
------------- CCValidator.ts (validate credit card number)
------------- CreditCardValidator.ts (Angular form validator for credit card numbers)
------------- Email validator (Angular email form validator)
------------- PasswordStrength.ts (evaluate password strength on 1-100 basis)
------------- PasswordValidator.ts (Angular form password validator - baseline function)
------------- patternValidator.ts (Angular form regex pattern validation)

If you have any questions about the library or wish to schedule a consultation on your project, please contact me at theAlgorithmist [at] gmail [dot] com.

Thanks and refer back to this link frequently to keep up on changes to the toolkit.

Comments are closed.