
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
For Node and browsers.
Some info about nni.
The nii method is used to interpolate sparse data point along a regular 2D grid surface. This methods work with Voronoi cells and area stilling and is said to give results that are close to the "real solution". The only issue with this method is that it's very computational, and thus, quite slow.
On the left: nni, on the right: same but with using some threshold at rendering.

Sparse point interpolations need:
This implementation performs the interpolation in two steps:
The purpose of creating the map at an intermediary step is to be able to reuse it for the same configuration but with different seed values, because what takes a while to generate is this interpolation map.
npm install --save natninter
Use it in a HTML file:
<script src="natinter/dist/natninter.js"></script>
Use it in ES6:
import * as natninter from 'natninter';
Use it in Node:
const natninter = require("natninter");
// a list of seeds
var seeds = [
{x: 100, y: 100, value: Math.random()*255 },
{x: 300, y: 100, value: Math.random()*255 },
{x: 300, y: 300, value: Math.random()*255 },
{x: 100, y: 300, value: Math.random()*255 },
{x: 200 , y: 200 , value: Math.random()*255 }
]
// creating the nni interpolator instance
var nnInter = new natninter.Interpolator();
// setting the output size
nnInter.setOutputSize(256, 256);
// add a list of seeds
nnInter.addSeeds( seeds );
// Create the interpolation map
// (this may take some seconds, start with a small image to benchmark it)
nnInter.generateMap();
// generate the output image witha nice interpolation
var output = nnInter.generateImage();
The output is actually an object of the form:
{
_data: Float32Array,
_metadata: {
width: Number,
heigth: Number
}
}
Where _data is a 1D array of length heightxwidth arrange in a row major way.
A regular example and A wavy example
See the folder examples for a Node and a browser example.
natninter comes with a node executable to generate a samplig-map file in JSON format. In a terminal, find the executable generatemap.js, located in the bin folder. Then:
./generatemap.js --seeds=your/own/seedsfile.json -width=400 --height=400 --output=somehwere/map.json
You can use the seed file in bin/samples/seeds1.json and use it as a a model to write your own seed file.
Since I didn't want to reinvent the wheel and that I trust some good developers out there, here are the dependencies natninter uses:
FAQs
Natural neighbor interpolation
We found that natninter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.