Open k1ng440 opened 6 years ago
I have exactly the same desire. I'm using Mermaid and the SVG's would really benefit from some zoom.
I have exactly the same desire. I'm using Mermaid and the SVG's would really benefit from some zoom.
+1
Exactly the same issue
Same here - did someone find a solution for that?
I saw mermaid is using https://github.com/bumbu/svg-pan-zoom - but would rather stick with one additional dependency :)
I had this same problem with Docusaurus. I was able to solve it by rendering the SVG as an image using data URI.
First, swizzle the mermaid theme. Then, replace the component on the newly created TSX file:
function MermaidRenderResult({renderResult}: {renderResult: RenderResult}): ReactNode {
return (
<div
className={`${MermaidContainerClassName} ${styles.container}`}
>
<img
alt="Diagram"
src={`data:image/svg+xml;utf8,${encodeURIComponent(renderResult.svg)}`}
/>
</div>
);
}
The problem
mediumZoom('#svg-element') does not work
Solution
Add inline SVG support