Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

snap-points-2d

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snap-points-2d

snap round 2d points

Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
566
53.8%
Maintainers
1
Weekly downloads
 
Created
Source

snap-points-2d

Runs iterative snap rounding on a set of 2D coordinates to produce a hierarchical level of detail for optimizing online rendering of huge 2D plots.

Install

npm i snap-points-2d

API

var hlod = require('snap-points-2d')(points, output, outputIds[, bounds])

Reorders the points hierarchically such that those which are drawn at the same pixel coordinate are grouped together.

  • points is an array of 2*n values
  • output is the reordered array of points
  • outputIds is the index of the reordered points in the input array
  • bounds is an optional array of 4 values giving the bounding box of the points

Returns An array of LOD scales. Each record is an object with the following properties:

  • pixelSize the pixel size of this level of detail in data units
  • offset the offset of this lod within the output array
  • count the number of items in the lod

Note the points in output are rescaled to the unit box [0,1]x[0,1] and the array points in the input is shuffled during execution.

License

(c) 2015 Mikola Lysenko. MIT License

Keywords

snap

FAQs

Package last updated on 10 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts