# @yaoc1996/js-tools

A multi-module JavaScript/TypeScript utility library for React front-end development.

## Modules

### js-utils

| Module | Import path | Description |
|--------|-------------|-------------|
| [format](js-utils/format.md) | `@yaoc1996/js-tools` | Human-readable formatting helpers |
| [path-utils](js-utils/path-utils.md) | `@yaoc1996/js-tools` | URL path joining utilities |
| [functional-tools](js-utils/functional-tools.md) | `@yaoc1996/js-tools` | Functional programming helpers |
| [event](js-utils/event.md) | `@yaoc1996/js-tools` | Type-safe event bus |
| [animation](js-utils/animation.md) | `@yaoc1996/js-tools` | Animation loop and transition helpers |
| [geom-2d](js-utils/geom-2d.md) | `@yaoc1996/js-tools` | 2D polygon geometry utilities |
| [geom](js-utils/geom.md) | `@yaoc1996/js-tools` | n-dimensional geometry utilities |
| [heap](js-utils/heap.md) | `@yaoc1996/js-tools` | Generic binary heap data structure |
| [lru](js-utils/lru.md) | `@yaoc1996/js-tools` | LRU cache with O(1) operations |
| [mbtiles-utils](js-utils/mbtiles-utils.md) | `@yaoc1996/js-tools` | MBTiles tile math for EPSG:3857 |
| [kdtree](js-utils/kdtree.md) | `@yaoc1996/js-tools` | K-D tree for spatial queries |
| [cv](js-utils/cv.md) | `@yaoc1996/js-tools` | Canvas image load, resize, and crop |
| [file-utils](js-utils/file-utils.md) | `@yaoc1996/js-tools` | Browser file download helpers |
| [ui-utils](js-utils/ui-utils.md) | `@yaoc1996/js-tools` | ResizeObserver-based resize watcher |
| [request](js-utils/request.md) | `@yaoc1996/js-tools` | fetch wrapper with base URL and progress |

### google

| Module | Import path | Description |
|--------|-------------|-------------|
| [google-three](google/google-three.md) | `@yaoc1996/js-tools/google` | Three.js WebGL overlay view factory for Google Maps |

### ifc

| Module | Import path | Description |
|--------|-------------|-------------|
| [ifc](ifc/ifc.md) | `@yaoc1996/js-tools/ifc` | IFC model loader — geometry, spatial structure, properties |

### las

| Module | Import path | Description |
|--------|-------------|-------------|
| [las](las/las.md) | `@yaoc1996/js-tools/las` | LAS/LAZ point-cloud parsing, writing, and Three.js rendering |

### mapbox

| Module | Import path | Description |
|--------|-------------|-------------|
| [mapbox](mapbox/mapbox.md) | `@yaoc1996/js-tools/mapbox` | Mapbox GL JS Three.js custom layer and coordinate projection |

### react-mapbox

| Module | Import path | Description |
|--------|-------------|-------------|
| [react-mapbox](react-mapbox/react-mapbox.md) | `@yaoc1996/js-tools/react-mapbox` | React components and hooks for Mapbox GL maps with Three.js custom layers |

### react-google

| Module | Import path | Description |
|--------|-------------|-------------|
| [react-google](react-google/react-google.md) | `@yaoc1996/js-tools/react-google` | React components and hooks for Google Maps with Three.js overlay views |

### react-three

| Module | Import path | Description |
|--------|-------------|-------------|
| [react-three](react-three/react-three.md) | `@yaoc1996/js-tools/react-three` | React components and hooks for Three.js scenes |

### three-utils

| Module | Import path | Description |
|--------|-------------|-------------|
| [compute](three-utils/compute.md) | `@yaoc1996/js-tools/three-utils` | GPGPU compute pipeline using Three.js render targets |
| [geojson](three-utils/geojson.md) | `@yaoc1996/js-tools/three-utils` | GeoJSON polygon-to-geometry builders |
| [id-picker](three-utils/id-picker.md) | `@yaoc1996/js-tools/three-utils` | GPU-based object picker via render target pixel readback |
| [instanced](three-utils/instanced.md) | `@yaoc1996/js-tools/three-utils` | Instanced geometry and material helpers |
| [subset](three-utils/subset.md) | `@yaoc1996/js-tools/three-utils` | Selective rendering geometry with per-feature id control |
| [utils](three-utils/utils.md) | `@yaoc1996/js-tools/three-utils` | Typed array merge helpers for buffer geometry construction |

### react-utils

| Module | Import path | Description |
|--------|-------------|-------------|
| [chart](react-utils/chart.md) | `@yaoc1996/js-tools/react-utils` | Composition-based SVG chart with axes, line/bar series, annotations, and legend |
| [dropdown](react-utils/dropdown.md) | `@yaoc1996/js-tools/react-utils` | Accessible dropdown components |
| [history](react-utils/history.md) | `@yaoc1996/js-tools/react-utils` | Undo/redo history management via React context |
| [hooks](react-utils/hooks.md) | `@yaoc1996/js-tools/react-utils` | React hooks for async effects, resize observation, drag interactions, viewport size, and stable resource references |
| [loading](react-utils/loading.md) | `@yaoc1996/js-tools/react-utils` | Queue async tasks with loading state tracking |
| [popup](react-utils/popup.md) | `@yaoc1996/js-tools/react-utils` | Overlay popup system with persistent and dismissible modes |
| [state-context](react-utils/state-context.md) | `@yaoc1996/js-tools/react-utils` | Composable React context with layered state management |
| [virtual-list](react-utils/virtual-list.md) | `@yaoc1996/js-tools/react-utils` | Windowed list renderer with constant DOM size |
| [window](react-utils/window.md) | `@yaoc1996/js-tools/react-utils` | Tabbed panel system with Window, WindowTab, and WindowTabContent |

## Installation

```bash
npm install @yaoc1996/js-tools
# or
pnpm add @yaoc1996/js-tools
```

## Usage

```typescript
import { formatBytes, join, mapEffect, EventHandler, animate } from '@yaoc1996/js-tools'
```

Each module can also be imported via its subpath:

```typescript
import { ... } from '@yaoc1996/js-tools/las'
import { ... } from '@yaoc1996/js-tools/ifc'
import { ... } from '@yaoc1996/js-tools/mapbox'
import { ... } from '@yaoc1996/js-tools/react-utils'
```
