I have some data that looks like [[30 elements], [30 elements], [30 elements] ...] this array can contain any number of arrays of 1-31 elements. Internal arrays will always be the same as the number of days to be processed. Each inner array will also have its own label on the label, so it would like to
A | 30 array elements
B | 30 array elements
C | 30 array of elements
The 30 element array will just be svg rects, which I draw on the screen, so it will look like
A | direct direct direct ... (1-31 rects)
B | direct direct direct ... (1-31 rects)
C | direct direct direct ... (1-31 rects)
Naturally, I am new to d3.js, so I have problems, and I think because I do not understand how to use data() correctly. I'm doing something like this right now
.data(d3.range( d3.range(d[0].length).length) * d3.range(d.length).length ) //this is to know how many rectangles I need to draw
therefore, the first member is the number of elements for the internal array, and the second is the number of internal arrays.
I do not use the scales because I could not locate the corrections correctly, therefore, I think I do not understand this either. to give you an idea of ββwhat I am doing, to place them for the x and y attributes, I am doing such things.
daysProcessed = d[0].length uniqueLabels = d3.range(d.length).length x = svgwidth/(daysProcessed +xmargin) * i%dayProcessed +xmargin // i is from .attr("x",function(d, i) y = rectSize *(i%uniqueLables)
since you can imagine that this is a mess, can someone help me in a simpler way and tell me the correct way to use .data on a square matrix?