D3 Configurability

77 views
Skip to first unread message

IPWright

unread,
Jul 26, 2012, 4:50:40 AM7/26/12
to d3...@googlegroups.com
I've been taking a look around the D3 examples, and having a read of what it is able to do (and trying to poke around the API documentation a little). I've a couple of questions that I've not managed to answer yet and was wondering if someone could help me with them?

  1. Is it possible for me to put extra information into the JSON that can be consumed? For example in a Dendogram would I be able to include some custom colour and size information that can then be applied via some function later on? I've seen that the Force Directed Graph seems to do this (based on the Group number it applies a colour), so I think I can do it but I just wanted to confirm that...
  2. Is it possible to combine various visualizations? For example could I combine a Dendogram or a Map and with pie charts, or add spark lines to a chord diagram? Similar to the pictures below (the latter might be done in D3 I'm not sure)?
Thanks for your help.

RadialAdditionalInfo.png

Kai Chang

unread,
Jul 30, 2012, 4:52:25 PM7/30/12
to d3...@googlegroups.com
1) Yes. Simply add more data to the object that's bound to each element. Perhaps "color" and "size" keys. You can also nest arrays and objects. One possible use: including a time-series for each link on a force-directed graph. Or % composition per node, for a pie chart. Or a URI to access the original data.

2) Yes, but expect to learn quite a bit about d3's layouts and SVG. There's a lot of functionality, which means multiple ways to achieve the same thing. I would try rendering those spark lines in a rectangle, then wrapping around the circle with SVG transforms or the arc layout. Or you could do scales in polar coordinates.

Also check out this Protovis example:

IPWright

unread,
Aug 1, 2012, 5:55:33 AM8/1/12
to d3...@googlegroups.com, kai.s...@gmail.com
Thanks for your response Kai, I'm not currently looking to implement these visualizations yet, more just checking what is and isn't possible with the library, although appreciate the example link (nice example).
Reply all
Reply to author
Forward
0 new messages