rewrite the client code to utilize the library svg.js