Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Support circle as well as rectangle packing #15

Open
Offbeatmammal opened this issue Oct 5, 2020 · 9 comments
Open

FR: Support circle as well as rectangle packing #15

Offbeatmammal opened this issue Oct 5, 2020 · 9 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Offbeatmammal
Copy link

is it possible to add capability of packing circles (rather than rectangles) into the parent rectangle maintaining relative size and clustered around either the center or an arbitrary point?

@kurkle
Copy link
Owner

kurkle commented Oct 5, 2020

Would it be circles in the last level only? Do you have an example image what it would look like?

@Offbeatmammal
Copy link
Author

circles
for my example a single level as attached where the circles scale as large as they can to fit in the bounding box, and rules can apply to control the colour/visibility of labels etc

@kurkle
Copy link
Owner

kurkle commented Oct 5, 2020

To me it looks like those circles could be much larger in that box? or is the bounding box not visible?

@kurkle
Copy link
Owner

kurkle commented Oct 5, 2020

Quick mock:
image

@Offbeatmammal
Copy link
Author

sample above was from a Tableau visualisation (not 100% what we want but close in look) and yes, there's a non-visible border being used to constrain the circles to give the slightly more vertical orientation (perhaps options to assign preferences for vertical/horizontal layouts would allow more visually pleasing defaults for the clustering as a longer term goal)

@kurkle
Copy link
Owner

kurkle commented Oct 5, 2020

ok. it also looks like that example lays the circles from top to bottom, leaving the top left corner unused. If that smallest circle was placed there, those circles could be bigger.
anyway, an interesting concept.

@kurkle kurkle added the enhancement New feature or request label Oct 5, 2020
@Offbeatmammal
Copy link
Author

finally found a name for this - Packed Circle chart. There are a couple of d3.js samples but I'd prefer to stick with chart.js

@kurkle
Copy link
Owner

kurkle commented Oct 28, 2021

This is probably different enough to deserve its own package.

@kurkle kurkle added the help wanted Extra attention is needed label Oct 28, 2021
@Offbeatmammal
Copy link
Author

in the linked FR at chartjs/Chart.js#11443 I've dropped some sample code that relies on the bubble chart ... problem is getting it to scale so the bubbles stay in the canvas, and the circles actually touch! not sure if there's any logic existing in treemap that combines with the sample algorithm could help make this a reality?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants