thi.ng/umbrella

repository·develop·Indexed 26 days ago

https://github.com/thi-ng/umbrella

A massive monorepo of independent, highly modular TypeScript libraries for functional programming, reactive dataflow, geometry, and specialized domains including WebGL, DSP, and ECS. Included packages include @thi.ng/adjacency for graph implementations and traversal algorithms, @thi.ng/arcball for 3D quaternion-based camera rotations, and @thi.ng/args for declarative CLI argument parsing and application frameworks.

Tokens
212.2K
Snippets
563
Records
1.2K
Agent score
87%

What's inside thi-ng/umbrella

  1. Overview of @thi.ng/umbrella packages

    develop

    The thi-ng/umbrella repository contains a collection of specialized TypeScript packages for geometry, image processing, simulation, and visualization. Below is a categorized list of available packages:

    Geometry & Spatial

    • @thi.ng/geom: 2D geometry types & operations.
    • @thi.ng/geom-accel: Spatial indexing data structures.
    • @thi.ng/geom-arc: 2D elliptic arc utilities.
    • @thi.ng/geom-clip-line: 2D line clipping.
    • @thi.ng/geom-clip-poly: 2D convex polygon clipping.
    • @thi.ng/geom-closest-point: Closest point helpers.
    • @thi.ng/geom-fuzz: Fuzzy 2D shape drawing/filling.
    • @thi.ng/geom-hull: 2D convex hull (Graham scan).
    • @thi.ng/geom-isec: Point & shape intersection tests.
    • @thi.ng/geom-isoline: 2D contour line extraction.
    • @thi.ng/geom-poly-utils: 2D polygon helpers.
    • @thi.ng/geom-resample: nD polyline/curve resampling.
    • @thi.ng/geom-sdf: 2D Signed Distance Field (SDF) creation, operators, and utilities.
    • @thi.ng/geom-splines: nD cubic/quadratic spline operations.
    • @thi.ng/geom-subdiv-curve: nD iterative subdivision curves.
    • @thi.ng/geom-tessellate: nD convex polygon tessellators.
    • @thi.ng/geom-trace-bitmap: Bitmap image to vector conversion.
    • @thi.ng/geom-voronoi: 2D iterative Delaunay/Voronoi.
    • @thi.ng/geom-webgl: WebGL shape conversion & interop for @thi.ng/geom.
    • @thi.ng/geom-axidraw: Shape conversions for AxiDraw pen plotters.

    Image & Pixel Processing

    • @thi.ng/pixel: Multi-format pixel buffers.
    • @thi.ng/imago: Declarative & extensible image processing pipelines.
    • @thi.ng/pixel-analysis: Image color & feature analysis utilities.
    • @thi.ng/pixel-convolve: Extensible image convolution & kernel presets.
    • @thi.ng/pixel-dominant-colors: k-means based dominant color extraction.
    • @thi.ng/pixel-dither: Image dithering with various algorithm presets.
    • @thi.ng/pixel-flow: Optical flow analysis.
    • @thi.ng/distance-transform: Image-based distance field generation.
    • @thi.ng/color: Color conversions and gradients.
    • @thi.ng/color-palettes: Collection of image-based color palettes.

    Simulation & Systems

    • @thi.ng/boids: Configurable n-dimensional boids simulation.
    • @thi.ng/lsys: Extensible L-System architecture.
    • @thi.ng/fuzzy-viz: Visualization and instrumentation for @thi.ng/fuzzy.
    • @thi.ng/dgraph-dot: Dependency graph to Graphviz conversion.
  2. Overview of @thi.ng/gp

    develop

    The @thi.ng/gp package provides helpers and strategies for Genetic Programming (GP), specifically focusing on tree-based and multi-expression programming.

    Supported Operations:

    • General GP setup configuration
    • Genotype / chromosome / AST generation
    • Phenotype / chromosome translation
    • Offspring generation (including single-point and uniform crossover, and mutation)

    Note: This package is currently in ALPHA status and does not handle population management, AST evaluation, or fitness computation.

  3. Overview of @thi.ng/random

    develop

    The @thi.ng/random package provides pseudo-random number generators (PRNGs) with a unified IRandom interface. It includes various seedable implementations, wrappers for Math.random() and window.crypto, and a suite of random distribution and utility functions.

    PRNG Implementations

    • Crypto (wrapper for window.crypto)
    • SFC32
    • Smush32
    • System
    • WrappedRandom
    • Xoshiro128
    • XorShift128
    • XorWow
    • XsAdd

    Random Distributions

    • exponential()
    • gaussian()
    • geometric()
    • normal()
    • uniform()

    Utilities

    • coin() / fairCoin()
    • pickRandom() / pickRandomKey()
    • randomBytes() / randomBytesFrom()
    • randomID()
    • weightedRandom() / weightedRandomKey()
    • uniqueIndices() / uniqueValuesFrom()
  4. Overview of @thi.ng/soa memory layouts

    develop

    The @thi.ng/soa package provides memory-mapped structured views with optional and extensible serialization. It supports three primary memory layouts:

    1. AOS (Array Of Structures): Data is organized as an array where each element is a complete structure.
    2. SOA (Structure of Arrays): Data is organized as multiple arrays, where each array contains one specific field for all elements.
    3. Hybrid: A combination of AOS and SOA layouts.

    Note: This package is currently in ALPHA status and is considered bleeding edge/work-in-progress. It may be superseded by @thi.ng/ecs.

  5. Overview of @thi.ng/wasm-api

    develop

    @thi.ng/wasm-api is a generic, modular, and extensible API bridge and infrastructure designed for hybrid JavaScript and WebAssembly (WASM) projects. It provides a toolkit for managing the interop between JS/TS and WASM-targeted languages like Zig or C/C++.

    Key features include:

    • WasmBridge: A core class that serves as a generic interop basis with reduced boilerplate.
    • Modular API Architecture: Support for child WASM API modules with dependency graph resolution and automatic initialization.
    • Core API: Provides minimal primitives for debug output, string/pointer/typedarray accessors (8/16/32/64-bit integers and 32/64-bit floats), and memory-mapped UTF-8 string abstractions.
    • Memory Management: Shared (opt-in) memory allocation mechanisms accessible from both JS/TS and WASM sides.
    • Polyglot Bindings: An extensible code generator (@thi.ng/wasm-api-bindgen) that supports Zig, TypeScript, and C11 to create shared datatypes and memory-mapped accessors.
  6. Overview of @thi.ng/viz visualization types

    develop

    The @thi.ng/viz package supports a wide variety of data visualization formats, including:

    • Scatter Plots: Linear and logarithmic axes (Log X, Linear Y; Log X, Log Y).
    • Line & Area Plots: Cartesian and Polar projections.
    • Bar Charts: Single value per domain or interleaved datasets.
    • Radar Plots: Single values or min-max intervals across categories.
    • Heatmaps: Rainbow gradient presets, polar projections, and custom shape functions.
    • Contour Plots: Standard contouring and terrain visualizations.
    • Timelines.
  7. Overview of @thi.ng/umbrella packages

    develop

    The @thi.ng/umbrella repository is a collection of functional and declarative utility packages. Below is a summary of the available packages and their primary purposes:

    PackageDescription
    @thi.ng/argsDeclarative & functional CLI arg parsing & coercions
    @thi.ng/apiCommon types, decorators, mixins
    @thi.ng/benchBasic benchmarking helpers
    @thi.ng/checksType & value checks
    @thi.ng/compareComparators
    @thi.ng/composeFunctional composition helpers
    @thi.ng/dateDate/time iterators, formatters, rounding
    @thi.ng/defmultiDynamic multiple dispatch
    @thi.ng/distancen-D distance metrics & K-nearest neighborhoods
    @thi.ng/equivDeep value equivalence checking
    @thi.ng/errorsCustom error types
    @thi.ng/exposeConditional global variable exposition
    @thi.ng/fibersProcess hierarchies & ops for cooperative multitasking
    @thi.ng/hexHex value formatters for U4-64 words
    @thi.ng/loggerBasis infrastructure for arbitrary logging
    @thi.ng/memoizeFunction memoization w/ customizable caching
    @thi.ng/metricsComputing & aggregating value metrics (mean, range, sd)
    @thi.ng/object-utilsPlain JS object & map manipulation
    @thi.ng/oqueryPattern based query engine for JS objects
    @thi.ng/parseParser combinators & AST generator/transformer
    @thi.ng/pathsImmutable nested object accessors
    @thi.ng/stringsHigher-order string formatting utils
    @thi.ng/systemMinimal life cycle container for stateful app components
    @thi.ng/timestampTimestamp abstraction/wrapper
    @thi.ng/transcludeTemplate engine for text document generation
    @thi.ng/unitsExtensible SI unit conversions
    @thi.ng/validateComposable functional data validation
    @thi.ng/validate-schemaJSON schema validation
  8. Overview of @thi.ng/rdom

    develop

    @thi.ng/rdom is a lightweight, reactive, and VDOM-less UI/DOM library. Unlike traditional virtual DOM frameworks that use a centralized diffing cycle, @thi.ng/rdom allows reactive values and components to be embedded directly into a hiccup tree. When a value changes, @thi.ng/rdom targets the specific underlying DOM node or attribute directly, avoiding expensive tree diffing.

    Key features:

    • VDOM-free: Updates are targeted and isolated.
    • Hiccup compatible: Uses nested JS arrays for component definitions.
    • Async Lifecycle: Supports async methods for mounting, unmounting, and updating components.
    • Flexible Targets: While it targets the browser DOM by default, components can manage other data structures (e.g., @thi.ng/rdom-canvas for HTML Canvas).
  9. Overview of thi.ng/umbrella

    develop

    The thi.ng/umbrella repository is a large-scale monorepo containing over 200 independent TypeScript libraries and tools. It is designed as an anti-framework ecosystem, meaning it provides a suite of composable functional programming instruments rather than a single, opinionated framework.

    Key characteristics:

    • Independence: All packages can be used in isolation and are versioned independently.
    • Modularity: Highly modular design (often one function/class per file) to facilitate tree-shaking and selective imports.
    • Distribution: Distributed as ESM modules (ES2022) with TypeScript typings and export maps.
    • Philosophy: Encourages a 'mix and match' approach to application design, providing customization points that rely on interfaces rather than concrete implementations.

    Useful discovery tools:

  10. Overview of @thi.ng/webgl-msdf

    develop

    The @thi.ng/webgl-msdf package provides multi-channel SDF (MSDF) font rendering and basic text layout for WebGL.

    Key features include:

    • Support for MSDF font formats based on Don McCurdy's generator.
    • Basic text alignment.
    • Vertex colors (enabling multi-color text).
    • Shader options for drawing character outlines.
    • GLSL shader snippets for embedding MSDF functionality directly into custom shaders.
  11. Overview of @thi.ng/canvas helpers

    develop

    The @thi.ng/canvas package provides helpers for HTML Canvas 2D creation, resizing, and High DPI (HDPI) support. Key functions include:

    • adaptiveCanvas2d(): For adaptive canvas creation.
    • canvas2d(): For standard canvas 2D creation.
    • pixelCanvas2d(): For pixel-based canvas 2D creation.
    • adaptDPI(): For adapting to device pixel ratios.
    • isHighDPI(): To check if the current environment is High DPI.