See https://github.com/wikipathways/gpml2pvjson-js/issues/33 , and implement for SVG generation as well.