Hi WikiPathways,
Is there a way to get raw SVG for a pathway diagram using CORS HTTP requests?
I'm aware of two similar options, but neither quite suits.
getColoredPathway: perfect, but offline
First is the WikiPathways API endpoint for
getColoredPathway, which seems broken. Trying to plug in values in the Swagger example returns a message that the service was offline. It's also
deprecated in related software. This `getColoredPathway` functionality seems like precisely what I need, as it's CORS-enabled and returns a pathway diagram graphic.
PathwayWidget: iframe makes reuse hard
Second is the
PathwayWidget API, which doesn't fit my use case given its iframe approach. Basically, I'd like to fetch the pathway diagram SVG and use the neat
pvjs library more directly. Using iframes raises security concerns with some downstream embedding applications, and substantially increases complexity in modern JavaScript components that otherwise use CORS.
Could you restore the getColoredPathway API endpoint? Or is there another way to fetch pathway SVG via CORS, i.e. directly via web browser JavaScript on another domain?
Thanks,
Eric
P.S.: My use case for this is to show pathway diagrams in gene tooltips for a related genes ideogram. E.g. if a user
searches for GNAQ and sees OXTR as an interacting gene, they could hover over OXTR, and see not only the name of the pathway as they can now, but also the biochemical drawing of how the two genes interact.
The diagram is uniquely rich and valuable. Seeing it in context would supercharge this gene discovery UI, and enable many other use cases!