Adarsh Singh
Adarsh Singh
~~converted to draft since added jest test fails when run together using `yarn test`, they are passing when only that test file is run individually~~ > TypeError: (0 , contextMenuUtils_1.svgDimensions)...
> if the window is small, the exported PNG will be small too ~yeah that would be a problem in this approach 🤔~ viewBox is not affected by resizing window...
> The viewport is the dimension in user space it's [viewBox](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox) actually 🥲.
> yeah that would be a problem in this approach 🤔 my bad 😅 , the viewbox's values are not varying when I resize the window of joplin if that's...
so what is the final implementation ? IMO combining viewbox information and minimum dimension approach explained by Henry would be sufficient for this ? should I implement and push that...
> did you check the Mermaid API could not find anything like that there, but found about their [live editor](https://mermaid.live/) which also has `PNG download` functionality. they are using dimensions...
> Sounds reasonable. How about using this technique but double the dimensions (just to be sure it's high res enough for printing)? Dimensions of rendered Svg will depend on window...
> How about using this technique Yes, allowing user's to override auto detected dimensions would be a very helpful feature IMO not sure about other point.
> But what's the alternative, do you have any suggestion? using [viewBox](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox) attribute's height and width values is a good plan IMO. - it's independent of window size in which...
> what is setting the viewbox? Is that the mermaid lib Yes. > how do they determine the dimensions then? They $draw^1$ the svg and use it's `getBBox` method to...