Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
@visx/voronoi
Advanced tools
Changelog
Readme
A Voronoi diagram partitions a two-dimensional plane into regions based on a set of input points. Each unique input point maps to a corresponding region, where each region represents all points that are closer to the input point than to any other input point.
Not only are Voronoi diagrams 😍, but they can be used to improve the interactive experience of a visualization. This is most often accomplished by overlaying an invisible voronoi grid on top of the visualization to increase the target area of interaction sites such as points on a scatter plot.
The @visx/voronoi
package provides a wrapper around the existing
d3-voronoi package with some react
-specific utilities.
npm install --save @visx/voronoi
The @visx/voronoi
package exports a wrapped version of the d3 voronoi
layout for flexible usage,
as well as a <VoronoiPolygon />
component for rendering Voronoi regions.
import { voronoi, VoronoiPolygon } from '@visx/voronoi';
const points = Array(n).fill(null).map(() => ({
x: Math.random() * innerWidth,
y: Math.random() * innerHeight,
}));
// width + height set an extent on the voronoi
// x + y set relevant accessors depending on the shape of your data
const voronoiLayout = voronoi({
x: d => d.x,
y: d => d.y,
width,
height,
});
const voronoiDiagram = voronoiLayout(data);
const polygons = voronoiDiagram.polygons(); // equivalent to voronoiLayout.polygons(points)
return (
<svg>
<Group>
{polygons.map((polygon) => (
<VoronoiPolygon key={...} polygon={polygon} />
))}
{points.map(({ x, y }) => (
<circle key={...} cx={x} cy={y} />
)}
</Group>
</svg>
)
For more advanced usage with events, see this example. Additional information about the voronoi layout + diagram can be found in the d3-voronoi documentation.
FAQs
visx voronoi
The npm package @visx/voronoi receives a total of 99,580 weekly downloads. As such, @visx/voronoi popularity was classified as popular.
We found that @visx/voronoi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers 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
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.