I have a different solution to this problem using progressBar.js at Tracing vectors and circular mask with progressBar.js