Given a set of (x, y, z)
coordinates, how would I go about creating a contour map?
Would be nice to know how to implement in d3 but wouldn\'t mind trying to
It looks like this would be very easy with conrec.js
. If you pass the data in the form that you have it, you can get a list of paths by calling .contourList()
on the result. That you should be able to pass without modification to a d3
.data()
call. All you should need to do is supply a path generator that maps the coordinates in the data to screen coordinates.
https://plot.ly/javascript/contour-plots/
Plotly.js: How to avoid overlapping contour lines?
How to apply plotly.js to an existing svg group <g> as target instead of applying it to a target <div> element?
https://github.com/d3/d3-plugins/blob/master/geom/contour/contour.js
And an example: http://bl.ocks.org/mbostock/4241134