Add Space Between Circles

31 views
Skip to first unread message

Robin Burrage

unread,
May 16, 2017, 1:09:00 PM5/16/17
to d3-js
Hi all, 

Can anyone please tell me how to space out my circles more? They're all running into each other. 

Thanks!
Robin

Paul Hobson

unread,
May 16, 2017, 1:43:40 PM5/16/17
to d3...@googlegroups.com
Shot in the dark here, but perhaps a thick but transparent border would visually add space.

--
You received this message because you are subscribed to the Google Groups "d3-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

steve rickus

unread,
May 16, 2017, 2:28:46 PM5/16/17
to d3-js
Probably the simplest way to create some whitespace around each circle would be to reduce each radius by a couple pixles.
I would start by trying to modify line #43 in your scripts.js file to return the radius - 5px like so:

.attr("r", function(d) { return d.r - 5; })

Mike Bostock

unread,
May 16, 2017, 4:19:39 PM5/16/17
to d3-js
If you are using d3.pack, try pack.padding. Here is an example:


--
You received this message because you are subscribed to the Google Groups "d3-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+un...@googlegroups.com.

Robin Burrage

unread,
May 16, 2017, 5:08:20 PM5/16/17
to d3...@googlegroups.com
Gasp! It's Mike Bostock! 
I'll try it! Thank you! 

Sent from my iPhone
You received this message because you are subscribed to a topic in the Google Groups "d3-js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/d3-js/f05PBc8LMN8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to d3-js+un...@googlegroups.com.

Robin Burrage

unread,
May 17, 2017, 11:56:59 AM5/17/17
to d3...@googlegroups.com
I was, indeed, using pack(). I added .padding(50) to my visualization and voila! Thank you so much!

To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "d3-js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/d3-js/f05PBc8LMN8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to d3-js+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages