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!