0.1.1 • Published 3 years ago

@saehrimnir/hagrid v0.1.1

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

HAGRID

Hagrid is a JavaScript library for removing overlaps in scatterplots. When using glyphs or images instead of points in a scatterplot, overlaps happen which impedes the readability of the scatterplot. Hagrid uses space filling curves to remove the overlaps in such a scatterplot.

Installation

If you use npm, install with npm install @saehrimnir/hagrid, and use it with

import * as hagrid from "@saehrimnir/hagrid";

Usage

Hagrid provides a method gridify:

let gridified_data = hagrid.gridify(data, method, parameters);

or use the method directly:

let gridified_data = hagrid.gridify_hilbert(data, parameters);
let gridified_data = hagrid.gridify_gosper(data, parameters);
let gridified_data = hagrid.gridify_dgrid(data, parameters);
let gridified_data = hagrid.gridify_cmds(data, parameters);
let gridified_data = hagrid.gridify_nmap(data, parameters);

Methods & Parameters

The methods 'hilbert' and 'gosper' are ours, 'dgrid', 'cmds', and 'nmap' are reimplementations or translations of other techniques.

namedescriptionparameterslink
hilbertuses the hilbert curve, produces rectangular grid cellspluslevel = 0 or whitespace, keep_aspect_ratio...
gosperuses the gosper curve, produces hexagonal grid cellspluslevel = 0 or whitespace, scale_factor...
dgridfills the whole visualization area, keeping an given aspect ratio of the grid cells.aspect ratio = 1...
cmdssimilar to mds but with constraintsalpha, Gamma, size...
nmapa space filling treemap approachnone...