Jammer Jamski
unread,Dec 5, 2012, 8:21:15 AM12/5/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to d3...@googlegroups.com
Hi All,
I'm just trying to figure out how best to manipulate some data prior to visualising.
I'm stuck on getting this to work and from doing some Googling it appears that a lot of people don't even attempt it this way and it started me wondering. Currently I'm trying to get this to work:
var x = d3.time.scale()
.domain(
d3.min(plotCollection, function (plot) { return d3.min(plot.date, function (dateVar) { dateVar.date; }); }),
d3.max(plotCollection, function (plot) { return d3.max(plot.date, function (dateVar) { dateVar.date; }); })
)
.range([0, width]);
But it seems a lot of people just sort the array and then pick the first and last items in order to build the Domain scale.
Which is "right"?
I know that is a subjective and (s'cus the pun) domain related issue but if you have a large data set which would be the method of choice?
I guess my lack of knowledge on Javascript doesn't help here. If you sort an array is a new array generated and then populated or does it operate only on the indexing of the original array?
Cheers,
Jammer