# regl-splom

> Scatterplot matrix for 2d plots

Latest version **1.0.14** (published 2021-01-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install regl-splom
pnpm add regl-splom
yarn add regl-splom
bun add regl-splom
```

## 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.14 |
| Published | 2021-01-19 |
| First published | 2018-04-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 21.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Dmitry Yv |
| Maintainers | jmmease, chriddyp, verazabeida, bpostlethwaite, alexcjohnson, nicolaskruchten, antrg, archmoj, xhlu, jody_plotly, dmt0, emmanuelle, rpkyle, andrefarzat, harryturr, hammadtheone, jackluo, maxkfranz, etpinard, wilzbach, marivet, t4rk, jackparmer, shannon-lal, rmarren1, vnieman, dy, shammamah, matthew_plotly |
| Keywords | regl, plotly, splom, scatter, matrix, scattermatrix, gl, webgl, plot, scatterplot |

## Links

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

## Dependencies (8)

- [raf](https://npm.io/package/raf.md) ^3.4.1
- [parse-rect](https://npm.io/package/parse-rect.md) ^1.2.0
- [array-range](https://npm.io/package/array-range.md) ^1.0.1
- [color-alpha](https://npm.io/package/color-alpha.md) ^1.0.4
- [array-bounds](https://npm.io/package/array-bounds.md) ^1.0.1
- [pick-by-alias](https://npm.io/package/pick-by-alias.md) ^1.2.0
- [regl-scatter2d](https://npm.io/package/regl-scatter2d.md) ^3.2.3
- [flatten-vertex-data](https://npm.io/package/flatten-vertex-data.md) ^1.0.2

## Recent versions

- 1.0.14 (latest) — 2021-01-19
- 1.0.13 — 2021-01-18
- 1.0.12 — 2020-08-17
- 1.0.11 — 2020-08-17
- 1.0.10 — 2020-08-17
- 1.0.9 — 2020-07-28
- 1.0.8 — 2019-10-30
- 1.0.7 — 2019-05-26
- 1.0.6 — 2019-01-09
- 1.0.5 — 2018-12-13
- 1.0.4 — 2018-08-30
- 1.0.3 — 2018-05-01
- 1.0.2 — 2018-05-01
- 1.0.1 — 2018-05-01
- 1.0.0 — 2018-04-13

## README

# regl-splom

Matrix of scatter plots. A wrapper over [regl-scatter2d](https://github.com/dy/regl-scatter2d) for optimized intersected data rendering.

* [x] minimal GPU memory footprint: N vs N*N in direct [regl-scatter2d](https://github.com/dy/regl-scatter2d) passes case.
* [ ] optimized performance due to binary trees for 1d point clustering, opposed to default 2d quad clustering.


## Usage

[![npm install regl-splom](https://nodei.co/npm/regl-splom.png?mini=true)](https://npmjs.org/package/regl-splom/)

```js
let regl = require('regl')({extensions: 'oes_element_index_uint'})
let createMatrix = require('regl-splom')

let scatterMatrix = createMatrix(regl)

// pass data and views to display
scatterMatrix.update(
	{ data: [[], [], ...], ranges, domains, viewport, size, color, border },
	{ data: [[], [], ...], ranges, domains, viewport, size, color, border }
)

// draw views by ids
scatterMatrix.draw(0, 1, ...views)
```

## API

### `splom = createSplom(regl)`

Creates scatter matrix instance.

### `splom.update(trace1, trace2, ...traces)`

Define passes for `draw` method. Every trace can include the following options:

Option | Description
---|---
`data` | An array with arrays for the columns.
`range` | Array with data ranges corresponding to `data`. Every range can be an array `[min, max]` or `[minX, minY, maxX, maxY]`. If undefined - detected automatically.
`domain` | Array with domains for the data, ie. the area data dimension holds  within the `viewport`. Each domain can be an array `[min, max]` for symmetric placement or `[minX, minY, maxX, maxY]` for precise position. Domain values are from `0..1` interval, defining what area of the `viewport` a dimension holds. By default domains cover viewport evnely.
`padding` | Padding within domains (in px), or list of paddings per-domain. By default `[0,0,0,0]`. Can be a number, an array or any [rectangle](https://github.com/dy/parse-rect) format.
`color`, `size`, `borderColor`, `borderSize`, `opacity` | Points style.
`marker` | Points marker.
`diagonal` | Show or hide diagonal.
`upper` | Show or hide upper half matrix.
`lower` | Show or hide lower half matrix.
`viewport` | Area that the plot holds within the canvas. Can take any [rectangle](https://github.com/dy/parse-rect) format.
<!-- `transpose` | Use transposed view of data, ie. swap columns and rows. -->
<!-- `normalizeDomain` | Normalize domains to fit the viewport. -->
<!-- `snap` | Enable snapping for the points, ie. hide invisible points -->


### `splom.draw(...ids?|...points?)`

Draw all defined passes, or only selected ones provided by `ids`. Optionally define point indexes to render.

```js
// draw 1 and 3 passes
splom.draw(1, 3)

// draw 1, 2 and 3 points from the first pass and 3 point from the second pass
splom.draw([1, 2, 3], [3])
```

### `splom.destroy()`

Dispose renderer and all the associated resources

## Related

* [regl-scatter2d](https://github.com/dy/regl-scatter2d)
* [regl-line2d](https://github.com/dy/regl-line2d)
* [regl-error2d](https://github.com/dy/regl-error2d)


## License

© 2018 Dmitry Yv. MIT License

Development supported by [plot.ly](https://github.com/plotly/).

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