Giter VIP home page Giter VIP logo

circlepacker's People

Contributors

bgirschig avatar dependabot[bot] avatar onedayitwillmake avatar snorpey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

circlepacker's Issues

[Feature Request] Ability to disable centering behavior

I was curious how difficult it would be to disable the centering behavior of the circle packing algorithm. The reason for this is that I am somewhat misusing this library, not for packing, but for making sure objects don't overlap in 3D printing application. I notice there is a function to "setCenteringPasses(number)" but that the argument is documented as requiring a number equal to at least one. Would it be possible to allow that to be zero, in which case, only overlapping circles would be moved to not overlap, while others would remain where they are? I have not tried to set this to zero to see whether the behavior already exists.

How to import the library in NodeJS project?

I'm using the library through npm, with TypeScript, and I'm having a little hard time importing and using it in my code.

I have tried below with VS Code, TypeScript 4 and 5. Also tried in plain node project, and SvelteKit project I'm currently working on.

// Suggested by LSP, doesn't work
import { CirclePacker } from 'CirclePacker';
// Suggested by LSP, doesn't work
import type PackedCircle from 'PackedCircle';

// LSP doesn't recognize "circlepacker"
import { CirclePacker } from "circlepacker";

Thank you!

StopLoop incorrectly updates listeners

In stopLoop you have this.updateListeners( 'moveend' ); but that method takes an object with properties.

This causes the moveend listeners to never be called.

FR: resize to avoid overlap

I'm trying to find a circle packing solution to use with ChartJS - which has a handy Bubble chart which takes x,y, and radius, but doesn't have a packing/treemap type solution.

really like this library as it handles a center of gravity which I think is a really elegant way to make layouts look nice, but doing some quick testing with the static sample (before even using it to feed into ChartJS) I notice adding circles it starts to visually overlap. Is it possible to configure it to apply a scale factor to all the radii to avoid overlap while ensuring fit into the bounds? Alternative would be to get a flag in the returned packer object to alert to their being overlaps and I could rescale the radii and re-run

In my specific scenario I'd know all the radii to start with, and happy to wait for a few passes of the calcs before rendering the chart

(of course my ideal dream would be to have this packing algo implemented as a ChartJS chart type that I just give a list of 'raw' radii to and it calculates the x,y, and scaled-radii by magic!)

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet.
We recommend using:

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Execution environment

Hey there!

I notice you mentioned it executes in a webworker. Is there a mode to support functionality outside of a browser-based worker and execute the algoritm via Node.js for instance? On the server-side, the execution of the process doesn't need to be async (and if it does, we can kick off another process to do this).

[Feature Request] Ability to modify circle radius

Hello there, and thanks for this nifty little package!

I’m playing around with your lib and I’m really enjoying its simplicity and small size. I’m even considering using it for a small dataviz! However, as far as I can tell, there’s currently no way to modify a circle’s radius after it’s been pushed to the packer. This would be a really useful feature to show data changes and to add a little animation if needed!

Thanks again! 👍

Calling setTarget repeatedly causes loop to stop prematurely

I noticed that calling setTarget repeatedly (with different x, y values) causes the animation loop to stop prematurely. The stopLoop method seems to be called too early.

Calling updateLoop or startLoop when this happens moves the circles one frame in the right 'direction' before calling stopLoop again prematurely.

Hope this description is enough to locate the bug. If not I will supply a bug demo.

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.