Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: apply real resize to mermaid graphs #225

Merged
merged 26 commits into from
Jun 8, 2021
Merged

feat: apply real resize to mermaid graphs #225

merged 26 commits into from
Jun 8, 2021

Conversation

christian-nils
Copy link
Contributor

Hi,

Here comes another way to scale the SVG generated by MermaidJS. As it is done now, the Transform component wrapping the Mermaid component makes it difficult to position the generated SVG when scaled.

I proposed a simple addition (#218) to expose the alignment option to the user. But it may still be unsufficient in some cases (vertical adjustments for instance)

The present PR proposes a way to actually scale directly the SVG and remove the Transform component. The generated SVG become then much easier to position.

Feel free to reject both PRs if this does not make any sense. (I personally prefer this second PR)

Have a good day!

/CN

@antfu antfu changed the title Mermaid svg scaling feat: apply real resize to mermaid graphs Jun 8, 2021
@antfu antfu merged commit f1e2479 into slidevjs:main Jun 8, 2021
@christian-nils
Copy link
Contributor Author

Thanks for your reactivity! :) I enjoy to see the professional way of implementing that feature! Thanks, have a great day!

Note: small typo in your code "acutalHeight.value" instead of "actualHeight.value"

@christian-nils christian-nils deleted the mermaidSVGscaling branch June 8, 2021 10:42
@antfu
Copy link
Member

antfu commented Jun 8, 2021

Typo fixed, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants