D3 Configurability

Showing 1-3 of 3 messages
D3 Configurability IPWright 7/26/12 1:50 AM
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.

Re: D3 Configurability Kai Chang 7/30/12 1:52 PM
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:

Re: D3 Configurability IPWright 8/1/12 2:55 AM
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).