JS for hazard plotting