About 137,000 results
Open links in new tab
  1. javascript - Packing different sized circles into rectangle - d3.js ...

    Nov 12, 2012 · // try to fit all circles into a rectangle of a given surface. compute: function (surface) // check if a circle is inside our rectangle. function in_rect (radius, center) if (center.x - radius < …

  2. Packing different sized circles into rectangle - d3.js

    var Packer = function (circles, ratio) { this.circles = circles; this.ratio = ratio || 1; this.list = this.solve(); } Packer.prototype = { // try to fit all circles into a rectangle of a given surface …

  3. Packing (uniform radius) Circles inside a Rectangle - Observable

    Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation. Exploring a variant on Wang et al.’s circle-packing algorithm.

  4. javascript - How to calculate and place circles on an rect area ...

    Jul 25, 2014 · var MX = Math.round(width / (R * 2)); // max amount of squares that can fit on the width. var MY = Math.round(height / (R * 2)); // max amount of squares that can fit on the …

  5. Most efficient way to pack circles with different radii in a rectangle ...

    Apr 30, 2021 · Do you maybe instead want to maximize the sum of areas of circles? Or do you need the same number of circles for each radius? Here's a way to fit 11 11 of each radius: By …

  6. Javascript D3.js fit circles of different sizes in a rectangle of fixed ...

    (function () {//www.demo2s.com//D3 program to fit circles of different sizes//in a rectangle of fixed aspect ratio//as tightly as reasonable.////By Amelia Bellamy-Royds, in response …

  7. javascript - adding text to circles in a rectangle - STACKOOM

    var bubbles = bubbleGroup.selectAll ("circle") .data (data) .enter () .append ("circle"); bubbleGroup.append ("text") .attr ("dx", function (d) {return -20}) .text (function (d) {return "test"})

  8. Dragging circles & rectangles around the Canvas

    var BB=canvas.getBoundingClientRect(); offsetX=BB.left; offsetY=BB.top; . if(shape.radius){ // this is a circle. var dx=mx-shape.x; var dy=my-shape.y; // math test to see if mouse is inside circle. …

  9. Javascript library for 2d geometry - GitHub Pages

    flatten-js is a javascript library for manipulating abstract geometrical shapes like point, vector, line, ray, segment, circle, arc and polygon. Shapes may be organized into Planar Set - searchable …

  10. Packing Circles inside a Rectangle (thank you Mike Bostock )

    Jun 23, 2021 · Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation. Exploring a variant on Wang et al.’s circle …

Refresh