How szimek/signature_pad works
Signature Pad is a browser-side JavaScript library for capturing smooth, variable-width signatures on an HTML canvas. A user draws through the pad’s pointer, mouse, or touch handling; the pad tracks points, computes curves, and renders them. Its API also supports importing and exporting signature data or images, clearing and redrawing, and stroke events. The sampled source shows the main runtime dependencies; other API capabilities are documented in the README, not all inspected in source.
Main entry points: signature_pad.ts Signature pad · bezier.ts Bezier curves · point.ts Point model · throttle.ts Input throttle
Components 8
Signature runtime
- Signature pad
src/signature_pad.ts - Point model
src/point.ts - Bezier curves
src/bezier.ts - Input throttle
src/throttle.ts - Event target
src/signature_event_target.ts
Other components
- Signature user
- HTML canvas
- Signature data consumer
Connections 8
- Signature user → Signature pad: draws through
README.md - Signature pad → HTML canvas: renders on
README.md - Signature pad → Point model: creates points
src/signature_pad.ts - Signature pad → Bezier curves: uses curves
src/signature_pad.ts - Signature pad → Input throttle: throttles input
src/signature_pad.ts - Signature pad → Event target: extends target
src/signature_pad.ts - Bezier curves → Point model: constructs points
src/bezier.ts - Signature pad → Signature data consumer: returns signature data
README.md