vipzhicheng / logseq-plugin-mark-map

This is a plugin for https://github.com/logseq/logseq to provide mindmap support based on https://github.com/markmap/markmap.
282 stars 7 forks source link

Issues with SVG File Alignment and Possible Corruption #74

Open 2001kg opened 4 months ago

2001kg commented 4 months ago

overview

(Click on the file to open full svg image)

I've generated an SVG markup and upon export, I noticed the initial section is truncated. The alignment seems excessively left-oriented. Converting it to a PDF yielded identical results. Additionally, the SVG seems to be malfunctioning in certain programs, which is likely why numerous SVG to PNG conversion tools report an "Incompatible file format". It appears the plugin requires further testing.

image

The file just opens in browser. I use Microsoft Edge image

vipzhicheng commented 4 months ago

I took some time to investigate this issue, the key reason is the SVG includes foreignObject, which is used to add text in SVG which is needed in mindmap, but this is not supported in almost all svg2png tools, even figma are not supported.

So the short answer may be only browsers can used to render this type of SVG. and then you can use a screenshot tool to get a png.

2001kg commented 4 months ago

Thanks for information 🙌. Taking screenshot of whole mind map reduces quality and not visible to read.

vipzhicheng commented 4 months ago

You can try to export PNG from mindmap directly. I tried to optimize the flow for a large map. Maybe it would work for you.