Help with a punchcard chart

25 views
Skip to first unread message

Mark Daggett

unread,
Apr 18, 2014, 12:59:31 PM4/18/14
to d3...@googlegroups.com
Hey Everyone,
In order to pound away some of the rough edges of d4 I have started to try to recreate some of the more custom charts out there. Today, I wanted to see how quickly I could recreate a punchcard chart using d4. You can see an example of the original chart here:


The version I am working on is here:


So far I only have about 30 minutes invested in this sketch, which makes me pretty happy because I feel I am getting close to the original. However, one thing I am struggling with is making the circles
not too small and not too big to fit in the available "cell" in the chart. As you can see in my example the smallest circles are very small, as compared to the original. I would like to reduce the variance here, and I assume you do it with range() but not really sure what the best approach is. Thanks for any help you can offer.

Best Regards,
Mark

Kai Chang

unread,
Apr 18, 2014, 3:27:07 PM4/18/14
to d3...@googlegroups.com
A good approach is to have 3 values for the range and domain. First value is zero for both. The middle value is the non-zero minimum and the smallest circle size.

That way zero values still don't get any radius, but are still available for transitions/etc.


--
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.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages