JavaScript implementation of CONREC contouring algorithm