decorate diagonal elements
js code cleanup
support saving as svg