Documentation

@thi.ng/umbrella

Travis status Conventional Commits Discord chat Twitter Follow

About

Mono-repository for almost 100 thi.ng TypeScript/ES6 projects, a wide collection of largely data transformation oriented packages and building blocks for:

  • Functional programming (composition, memoization, transducers, multi-methods)
  • Stream based, reactive programming, dataflow graphs / pipelines
  • Data structures & data transformations for wide range of use cases
  • Data driven UI components, event & side effect handling
  • Immutable data handling
  • Geometry generation, processing & visualization
  • Vector & matrix implementations with optional support for strided layouts
  • Declarative WebGL 1/2 abstraction layer
  • DSL for shader functions defined in TypeScript and cross-compilation to GLSL, JS, VEX etc.
  • Low-level tooling for binary data, shared memory / WASM / WebGL interop
  • etc. (see package overview below)

...all with a keen eye on simplicity, re-use & minimalism without sacrificing flexibility.

This project is NOT a framework, provides no turn-key, one-size-fits-all approach and instead encourages a mix & match philosophy for various key aspects of application design (in & outside the browser). Most customization points only expect certain interfaces rather than concrete implementations.

Most packages:

  • have detailed, individual README files w/ small usage examples
  • are versioned independently
  • distributed in ES6 syntax and multiple format (ESM, CommonJS, UMD) with TypeScript typings & changelogs
  • highly modular with largely only a few closely related functions or single function / class per file to help w/ tree shaking
  • provide re-exports of all their publics for full library imports
  • have either none or only @thi.ng internal runtime dependencies
  • have been used in production
  • declare public interfaces, enums & types in an src/api.ts file (larger packages only)
  • auto-generated online documentation at docs.thi.ng
  • licensed under Apache Software License 2.0

Examples

There's a steadily growing number (~60) of standalone examples (different complexities, often combining functionality from several packages) in the examples directory.

Blog posts

Community

Join our little community on our Discord server or get in touch via Twitter or the issue tracker. If you'd like to contribute, please first read this document.

Projects

New / unreleased packages in development

(These packages are only available on their respective feature branches)

Fundamentals

Project Version Changelog Description
@thi.ng/api version changelog Common types, decorators, mixins
@thi.ng/bench version changelog Basic benchmarking helpers
@thi.ng/checks version changelog Type & value checks
@thi.ng/compare version changelog Comparator
@thi.ng/compose version changelog Functional composition helpers
@thi.ng/defmulti version changelog Dynamic multiple dispatch
@thi.ng/dsp version changelog DSP utils, oscillators
@thi.ng/equiv version changelog Deep value equivalence checking
@thi.ng/errors version changelog Custom error types
@thi.ng/math version changelog Assorted common math functions & utilities
@thi.ng/memoize version changelog Function memoization w/ customizable caching
@thi.ng/paths version changelog Immutable nested object accessors
@thi.ng/random version changelog Seedable PRNG implementations w/ unified API
@thi.ng/strings version changelog Higher-order string formatting utils

Iterator, stream & sequence processing

Project Version Changelog Description
@thi.ng/csp version changelog Channel based async ops
@thi.ng/fsm version changelog FSM / parser primitives
@thi.ng/iterators version changelog ES6 generators / iterators
@thi.ng/sax version changelog SAX-like XML parser / transducer
@thi.ng/transducers version changelog Composable data transformations
@thi.ng/transducers-binary version changelog Binary data related transducers
@thi.ng/transducers-fsm version changelog Finite state transducer
@thi.ng/transducers-hdom version changelog Transducer based hdom UI updates
@thi.ng/transducers-stats version changelog Technical / statistical analysis

Reactive programming

Project Version Changelog Description
@thi.ng/rstream version changelog Push-based, reactive event stream primitves
@thi.ng/rstream-csp version changelog Adapter bridge CSP -> rstream
@thi.ng/rstream-dot version changelog Graphviz visualization of rstream topologies
@thi.ng/rstream-gestures version changelog Mouse & touch event stream abstraction
@thi.ng/rstream-graph version changelog Declarative dataflow graph construction
@thi.ng/rstream-log version changelog Hierarchical structured data logging
@thi.ng/rstream-log-file version changelog Log-file output handler
@thi.ng/rstream-query version changelog Triple store & query engine

Data structures

Project Version Changelog Description
@thi.ng/adjacency version changelog Adjacency matrices & graph algorithms
@thi.ng/arrays version changelog Array utilities
@thi.ng/associative version changelog Alt Set & Map implementations
@thi.ng/atom version changelog Immutable value wrappers, views, history
@thi.ng/bitfield version changelog 1D/2D bit field implementations
@thi.ng/cache version changelog In-memory caches / strategies
@thi.ng/dcons version changelog Doubly-linked list
@thi.ng/diff version changelog Array & object diffing
@thi.ng/dgraph version changelog Dependency graph
@thi.ng/heaps version changelog Binary & d-ary heap impls
@thi.ng/intervals version changelog Open/closed intervals, queries, set ops
@thi.ng/quad-edge version changelog Quad-edge, dual-graph data structure
@thi.ng/resolve-map version changelog DAG computations & value resolution
@thi.ng/sparse version changelog Sparse matrix & vector impls

Frontend / UI

Project Version Changelog Description
@thi.ng/hdom version changelog Hiccup based VDOM & diffing
@thi.ng/hdom-canvas version changelog hdom based declarative canvas drawing
@thi.ng/hdom-components version changelog hdom based UI components
@thi.ng/hdom-mock version changelog hdom mock implementation (testing / prototyping)
@thi.ng/hiccup version changelog S-expression based HTML/XML serialization
@thi.ng/hiccup-carbon-icons version changelog IBM Carbon icons in hiccup format
@thi.ng/hiccup-css version changelog CSS from nested JS data structures
@thi.ng/hiccup-markdown version changelog Hiccup-to-Markdown serialization
@thi.ng/hiccup-svg version changelog hiccup based SVG vocab
@thi.ng/imgui version changelog Immediate mode GUI
@thi.ng/interceptors version changelog Composable event handlers & processor
@thi.ng/router version changelog Customizable browser & non-browser router

Geometry & visualization

Project Version Changelog Description
@thi.ng/color version changelog Color conversions, gradients
@thi.ng/dot version changelog Graphviz DOM & export
@thi.ng/geom version changelog 2D only geometry types & ops
@thi.ng/geom-accel version changelog Spatial indexing data structures
@thi.ng/geom-api version changelog Shared types & interfaces
@thi.ng/geom-arc version changelog 2D elliptic arc utils
@thi.ng/geom-clip version changelog 2D convex line/shape clipping
@thi.ng/geom-closest-point version changelog Closest point helpers
@thi.ng/geom-hull version changelog 2D convex hull (Graham scan)
@thi.ng/geom-isec version changelog Point & shape intersection tests
@thi.ng/geom-isoline version changelog 2D contour line extraction
@thi.ng/geom-poly-utils version changelog 2D polygon helpers
@thi.ng/geom-resample version changelog nD polyline / curve resampling
@thi.ng/geom-splines version changelog nD cubic / quadratic spline ops
@thi.ng/geom-subdiv-curve version changelog nD iterative subdivision curves
@thi.ng/geom-tessellate version changelog nD convex polygon tessellators
@thi.ng/geom-voronoi version changelog 2D iterative delaunay/voronoi
@thi.ng/iges version changelog IGES format geometry serialization
@thi.ng/lsys version changelog Extensible L-System architecture
@thi.ng/matrices version changelog Matrix operations
@thi.ng/pixel version changelog Multi-format pixel buffers
@thi.ng/poisson version changelog nD Poisson disk sampling
@thi.ng/porter-duff version changelog Alpha blending / compositing ops
@thi.ng/vectors version changelog Fixed & arbitrary-length vector ops

WebGL / GPGPU

Project Version Changelog Description
@thi.ng/shader-ast version changelog AST DSL for x-platform shader code
@thi.ng/shader-ast-glsl version changelog GLSL code generator
@thi.ng/shader-ast-js version changelog JS code generator
@thi.ng/shader-ast-stdlib version changelog 100+ useful AST shader functions
@thi.ng/webgl version changelog WebGL 1/2 / GPGPU facilities
@thi.ng/webgl-msdf version changelog MSDF font rendering

Low-level, binary, memory management

Project Version Changelog Description
@thi.ng/bencode version changelog Bencode binary format encoding
@thi.ng/binary version changelog Assorted binary / bitwise ops, utilities
@thi.ng/bitstream version changelog Bitwise input / output streams
@thi.ng/dlogic version changelog Digital logic ops / constructs
@thi.ng/leb128 version changelog WASM based LEB128 varint encoder / decoder
@thi.ng/malloc version changelog Raw & typed array memory pool & allocator
@thi.ng/morton version changelog Z-order-curve / Morton coding
@thi.ng/range-coder version changelog Binary data Range encoder / decoder
@thi.ng/rle-pack version changelog Run-length encoding data compression
@thi.ng/unionstruct version changelog Wrapper for C-like structs / unions
@thi.ng/vector-pools version changelog Data structures for memory mapped vectors

DSLs

Project Version Changelog Description
@thi.ng/pointfree version changelog Stack-based DSL & functional composition
@thi.ng/pointfree-lang version changelog Forth-like syntax layer for @thi.ng/pointfree

Building

git clone https://github.com/thi-ng/umbrella.git
cd umbrella

yarn install
yarn build

Once the entire mono-repo has been fully built at least once before, individual packages can then be (re)built like so:

lerna run build --scope @thi.ng/transducers

Building example projects

Please see the example build instructions in the wiki for further details.

Testing

(most, but not all packages have tests)

yarn test

# or individually
lerna run test --scope @thi.ng/rstream

Coverage

The resulting reports will be saved under /packages/*/coverage/lcov-report/.

yarn cover

Documentation

Autogenerated documentation (using TypeDoc) will be saved under /packages/*/doc/ and is also available at docs.thi.ng.

yarn doc

License

© 2018 Karsten Schmidt // Apache Software License 2.0

Contributors

Thanks goes to these wonderful people (emoji key):

Karsten Schmidt
Karsten Schmidt

💻 📖 🚧
Alberto
Alberto

💻 💡 🐛
Arthur Carabott
Arthur Carabott

💻 🤔
André Wachter
André Wachter

💻 🤔 🐛

This project follows the all-contributors specification. Contributions of any kind welcome!