Skip to content

TypeScript algorithm for evaluating and visualizing functions that map Euclidean points to discrete values.

License

Notifications You must be signed in to change notification settings

pallosp/contour_plot

Repository files navigation

Contour Plot

MIT license

Contour Plot is a TypeScript library designed for efficient plotting of functions that map (x, y) points to a limited set of discrete values. The library evaluates the function at grid points with configurable density, refines boundaries where neighboring grid points produce different values, and generates a list of squares or runs (unit-height rectangles). Within each square or run, the function's value is treated as constant. The coordinates of the building blocks are selected so that they can be precisely and efficiently rendered as SVG.

Demo

To run a demo, build it with npm run build, start a web server with npm run preview, then open http://localhost:4173
There you can select a function to plot, specify the resolution, and optionally highlight the edges of the building blocks.

demo screenshot

About

TypeScript algorithm for evaluating and visualizing functions that map Euclidean points to discrete values.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published