# gl-pointcloud2d

> 2D WebGL point cloud plots

Latest version **1.0.3** (published 2020-04-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install gl-pointcloud2d
pnpm add gl-pointcloud2d
yarn add gl-pointcloud2d
bun add gl-pointcloud2d
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-04-05 |
| First published | 2016-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 15.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Mikola Lysenko |
| Maintainers | alexcjohnson, antrg, archmoj, bpostlethwaite, chriddyp, dfcreative, dmt0, emmanuelle, etpinard, jmmease, jody_plotly, monfera, nicolaskruchten, verazabeida, xhlu |
| Keywords | webgl, point cloud, pointcloud, gl-vis, 2d |

## Links

- npm: https://www.npmjs.com/package/gl-pointcloud2d
- Repository: https://github.com/gl-vis/gl-pointcloud2d
- Homepage: https://github.com/gl-vis/gl-pointcloud2d#readme
- Issues: https://github.com/gl-vis/gl-pointcloud2d/issues
- npm.io page: https://npm.io/package/gl-pointcloud2d

## Dependencies (4)

- [glslify](https://npm.io/package/glslify.md) ^7.0.0
- [gl-buffer](https://npm.io/package/gl-buffer.md) ^2.1.2
- [gl-shader](https://npm.io/package/gl-shader.md) ^4.2.1
- [typedarray-pool](https://npm.io/package/typedarray-pool.md) ^1.1.0

## Recent versions

- 1.0.3 (latest) — 2020-04-05
- 1.0.2 — 2019-01-09
- 1.0.1 — 2018-02-05
- 1.0.0 — 2016-09-07

## README

gl-pointcloud2d
============
WebGL 2D point cloud for lots of points

## Example
... to be created

## Install
Using [npm](https://docs.npmjs.com/), you can install this module as follows:

```
npm i gl-pointcloud2d
```

## API

### Constructor

#### `var pointcloud = require('gl-pointcloud2d')(plot, options)`
Creates a new 2D point cloud.

* `plot` is a reference to a `gl-plot2d` object
* `options` is a JSON object containing the parameters which are passed to the object when it is updated.

`options` has the following properties:

* `data` is a packed 2*n length array of the unrolled xy coordinates of the points (required) - buffering is significantly faster if it's of type Float32Array
* `idToIndex` is an optional array of length n where `idToIndex[i] = i` - buffering is significantly faster if it's supplied and of type Int32Array
* `color` is the color of a marker as a length 4 RGBA array (default `[1,0,0,1]`)
* `borderSize` is the ratio of the border around each point (default `0`)
* `borderColor` is the color of the border of each point (default `[0,0,0,1]`)
* `blend` determines if `gl` blending is enabled for a translucency effect on overlaps; enabling it lowers draw speed somewhat (default `false`)

**Returns** A new point cloud plot object, which is also registered to `plot`

### Methods

#### `pointcloud.update(options)`
Updates the point cloud plot.

* `options` is an object with the same properties as in the point cloud plot constructor

#### `pointcloud.dispose()`
Destroys the point cloud plot and all associated resources.

## License
(c) 2015 Mikola Lysenko. MIT License

Development supported by plot.ly

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