0.0.2 • Published 5 years ago

d3-force-bounded-box v0.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

A D3 force. Inspired by https://bl.ocks.org/cmgiven/547658968d365bcc324f3e62e175709b

Examples:

const boundedBox = require('d3-force-bounded-box')
const { forceSimulation } = require('d3-force');

const nodeData = [
  {
    size: 52,
    x: 0,
    y: 0,
    vx: 0,
    vy: 0,
  }
]

const boxForce = boundedBox()
  .bounds([[0, 0], [width, height]])
  .size(d => [d.size, d.size]);

const simulation = forceSimulation(nodeData)
  .force('boxForce', boxForce);
0.0.2

5 years ago

0.0.1

5 years ago

0.0.0

5 years ago

0.0.1-security

5 years ago