# @types/simpleheat

> TypeScript definitions for simpleheat

Latest version **0.4.3** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/simpleheat
pnpm add @types/simpleheat
yarn add @types/simpleheat
bun add @types/simpleheat
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; popular repo; extremely popular.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.4.3 |
| Published | 2023-11-07 |
| First published | 2023-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51375 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/simpleheat
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/simpleheat
- npm.io page: https://npm.io/package/@types/simpleheat

## Recent versions

- 0.4.3 (latest) — 2023-11-07
- 0.4.0 (ts4.3) — 2023-05-15
- 0.4.2 — 2023-10-18
- 0.4.1 — 2023-09-25

## README

# Installation
> `npm install --save @types/simpleheat`

# Summary
This package contains type definitions for simpleheat (https://github.com/mourner/simpleheat).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/simpleheat.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/simpleheat/index.d.ts)
````ts
declare namespace simpleheat {
    interface Instance {
        /**
         * Set heatmap data points
         *
         * @param points Array of data points containing 2D coordinates and intensity value (defaulted to 1)
         * @example [[0, 0, 1.0], [1, 0, 2.0], [1, 1, 0.5], ...]
         */
        data(points: Array<[number, number] | [number, number, number]>): this;

        /**
         * Set max data value
         *
         * @param maxValue Maximum data value (defaulted to 1)
         */
        max(maxValue: number): this;

        /**
         * Add a data point
         *
         * @param point Array of 2D coordinates and intensity value (defaulted to 1)
         */
        add(point: [number, number] | [number, number, number]): this;

        /**
         * Clear canvas data
         */
        clear(): this;

        /**
         * Set point radius and optional blur radius
         *
         * @param radius Radius (defaulted to 25)
         * @param blur Optional blur radius (defaulted to 15)
         */
        radius(r: number, blur?: number): this;

        /**
         * Update drawing, in case canvas size changed
         */
        resize(): this;

        /**
         * Set gradient colors as {<stop>: '<color>'}
         * Thresholds are between 0.0 and 1.0.
         *
         * @param gradient Thresholds with associated colors to generate the gradient
         * @example {
         *            0.4: 'blue',
         *            0.6: 'cyan',
         *            0.7: 'lime',
         *            0.8: 'yellow',
         *            1.0: 'red'
         *          }
         */
        gradient(gradient: { [key: number]: string }): this;

        /**
         * Draw the heatmap
         *
         * @param minOpacity Optional param to set the opacity of the heatmap (defaulted to 0.05)
         */
        draw(minOpacity?: number): this;
    }
    interface Static {
        new(canvas: HTMLCanvasElement): Instance;
        (canvas: HTMLCanvasElement): Instance;
    }
}

declare const simpleheat: simpleheat.Static;

export = simpleheat;
export as namespace simpleheat;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: none

# Credits
These definitions were written by [Tristan de Guillebon](https://github.com/tristangbn).

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