Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/retraigo/curves
Functions to generate various curves in TypeScript
https://github.com/retraigo/curves
Last synced: 8 days ago
JSON representation
Functions to generate various curves in TypeScript
- Host: GitHub
- URL: https://github.com/retraigo/curves
- Owner: retraigo
- License: mit
- Created: 2023-07-05T05:45:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-29T10:45:26.000Z (15 days ago)
- Last Synced: 2024-10-29T12:35:12.126Z (15 days ago)
- Language: TypeScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# curves
Functions to generate various curves in TypeScript## Example
Generate a cubic bezier:
```ts
import { svgChart, cubicBezier } from "@retraigo/curve";const pts = cubicBezier(20, .17, .67, .83, .67)
const x = pts.map(x => x[0])
const y = pts.map(x => x[1])// Plot the points on a 100 x 100 scatter chart
const svg = svgChart(x, y, [100, 100], true, .1)Deno.writeTextFile("bezier.svg", svg)
```