I am trying to get the dimensions of my xy data that have this nested form:
data = [
{"points": [{"x": 0, "y": 0}, {"x": -5, "y": 100}, {"x": 300, "y": 1}, ...],
"rgbval": "rgb(0, 0, 0)"
},
{"points": [{"x": 1, "y": 2}, {"x": -7000, "y": 2}, {"x": 0, "y": 0}, ...],
"rgbval": "rgb(255, 0, 0)"
},
.
.
.
]
In the case of sample data, the data I'm looking for is as follows:
x_domain = [-7000, 300]
y_domain = [0, 100]
I can get the size of a specific group of points using:
for i in [0...data.length]
console.log(d3.extent(data[i].points, (d) -> d.x))
console.log(d3.extent(data[i].points, (d) -> d.y))
In the sample example, this will give me two x_domains and two y_domains. I want common xy data domains.