# contour_plot

> Contour Plots of Mathematical Functions

Latest version **0.0.1** (published 2016-10-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install contour_plot
pnpm add contour_plot
yarn add contour_plot
bun add contour_plot
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2016-10-30 |
| First published | 2016-10-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19 |
| Author | Ben Frederickson |
| Maintainers | benfrederickson |
| Keywords | Contour Plot |

## Links

- npm: https://www.npmjs.com/package/contour_plot
- Repository: https://github.com/benfred/contour_plot
- Issues: https://github.com/benfred/contour_plot/issues
- npm.io page: https://npm.io/package/contour_plot

## Recent versions

- 0.0.1 (latest) — 2016-10-30

## README

# contour_plot

A D3 plugin to draw contour plots of 2D functions.

Uses the marching squares algorithm from d3.geom.contour to generate contour lines.

This project is a work in progress, and not ready for public consumption. Notably this doesn't
generate 

## Installing

If you use NPM, `npm install contour_plot`. Otherwise, download the [latest
release](https://github.com/benfred/contour_plot/releases/latest).

## Example

Draw the [Goldstein Price](https://en.wikipedia.org/wiki/File:Goldstein_Price_function.pdf) function:

```javascript
function goldsteinPrice(x, y) {
    return (1. + Math.pow(x + y + 1, 2) *
    (19 - 14*x + 3*x*x - 14 * y + 6 * x * x + 3 * y * y))
    * (30 + Math.pow(2*x-3*y, 2)*(18 - 32*x + 12 * x * x + 48*y - 36 * x * y + 27 * y* y));
}

var plot = contour_plot.ContourPlot()
    .f(goldsteinPrice)
    .drawAxis(true)
    .xDomain([-2, 2])
    .yDomain([1, -2])
    .colourRange(["white", "green"]);

var elements = plot(d3.select("#contour_graph"));
```

Should produce something like:

![Example](https://github.com/benfred/contour_plot/raw/master/image.png)

---
_Source: https://npm.io/package/contour_plot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
