Geologic Cross Sections, Visualizing Contaminant Concentrations

Directly relevant to this thread → How to update data of contour in CustomJS fun?

The idea was to interpolate contaminant concentrations to a regular mesh/point cloud (via kriging/rbf/idw/whatever). This mesh along with the interpolated values at each node get passed into the bokeh app. Then on user-click, interpolate the intersecting mesh elements onto the cross section view, then contour that result using d3’s tricontour. Finally, clip that result to the existing XS model domain (e.g. so no concentration contours are above ground surface). That last step was trickier than it seems, because there are no quality assurances from d3 tricontour output (self intersecting polygons, duplicate coordinates etc), which made coming up with a robust “clip line to polygon” algo super difficult/problematic.

Lots more to build on but pretty happy with the functionality this adds to my XS app!



Gorgeous! It’s similar to some less-ambitious work we did at Analyzing Meshes — EarthSim 0.0.1 documentation a while back. That code probably won’t run any more, and was never runnable directly from the web site, but it also let you draw a polyline and compute a cross section that displays in a separate plot as a line or surface.

Really fantastic, thanks for sharing @gmerritt123 !

If you are able to share code, think an example that demonstrates using d3 features inside a CustomJS could be interesting to lots of people. (It’s doubtful we’d ever take a dependency directly on d3 but interop is always good to promote!)