
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
d3-bboxCollide
Advanced tools
A bounding box collision detection constraint for d3 forceSimulation.
npm install d3-bboxCollide
A bounding box constraint for forceSimulation.
Here's a data-driven example with 500 nodes.
You can include it as a "collide"
constraint in your force simulation for rectangular nodes or bounding boxes around labels. It uses bounding boxes, which are [[],[]] arrays that give the top-left and bottom-right coordinates of a rectilinear space. You can set these bounding boxes manually or base them of the data of the node.
The following would set up a bounding box constraint for a 20x10 rectangle (remember the bounding box is around the center of your node, so the top left corner will be -10px
for the x-coordinate and -5px
for the y-coordinate while the bottom right corner of the bounding box will be 10px
for the x-coordinate and 5px
for the y-coordinate).
var rectangleCollide = bboxCollide([[-10,-5],[10,5]])
Which you would attach to your force like so:
var force = d3.forceSimulation(data)
.force("collide", rectangleCollide)
FAQs
A bounding box collision detection constraint for d3 forceSimulation.
The npm package d3-bboxCollide receives a total of 6,590 weekly downloads. As such, d3-bboxCollide popularity was classified as popular.
We found that d3-bboxCollide 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
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.