Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
planar-graph-to-polyline
Advanced tools
Convert a planar graph to a collection of nest polylines
Converts a planar graph to a collection of nested polylines (as would be consumed in a GeoJSON/TopoJSON file for example).
var graphToPolygons = require("planar-graph-to-polyline")
var edges = []
var positions = []
for(var i=1; i<=3; ++i) {
var v0 = positions.length
for(var j=0; j<10; ++j) {
var theta = 2.0 * Math.PI * j / 10
positions.push([ i * Math.cos(theta), i * Math.sin(theta) ])
edges.push([ v0+j, v0+((j+1)%10) ])
}
}
console.log(graphToPolygons(edges, positions))
Output:
[ [ [ 20, 29, 28, 27, 26, 25, 24, 23, 22, 21 ],
[ 11, 12, 13, 14, 15, 16, 17, 18, 19, 10 ] ],
[ [ 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 ] ] ]
npm install planar-graph-to-polyline
require("planar-graph-to-polyline")(edges, positions)
Converts a planar graph into a collection of nested polylines
edges
are the edges of the graphpositions
are the locations of the vertices in the planeReturns A list of loops encoding the regions bounded by the graph
(c) 2014 Mikola Lysenko. MIT License
FAQs
Convert a planar graph to a collection of nest polylines
The npm package planar-graph-to-polyline receives a total of 18,051 weekly downloads. As such, planar-graph-to-polyline popularity was classified as popular.
We found that planar-graph-to-polyline 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.