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

Horizontal centering for multi-line text #224

Open
maxxime opened this issue Aug 6, 2021 · 1 comment
Open

Horizontal centering for multi-line text #224

maxxime opened this issue Aug 6, 2021 · 1 comment

Comments

@maxxime
Copy link

maxxime commented Aug 6, 2021

Hello, is it possible to adjust the horizontal centering for text spread over several lines? By default, such text is left aligned and therefore the spacing between the text and the frame is asymmetrical (unlike frames containing a single line of text), as in the capture below:

Screenshot 2021-08-06 at 22-25-34 flowchart js

By hand I changed the text-anchor property from start to middle and adjusted the start position in x to half the width of the frame to illustrate the rendering which I imagine is more visually pleasing:

Screenshot 2021-08-06 at 22-24-34 flowchart js

Is this actually possible with flowchart.js because I don't see any use of it in the examples?

Many thanks to the developers of this project that I find very useful.

@adrai
Copy link
Owner

adrai commented Aug 7, 2021

These are the current available options: https://github.com/adrai/flowchart.js/blob/master/src/flowchart.defaults.js
It may be a new option could be introduced to make text-anchor dependend on it....
But I don't know if this will work....
Feel free to try a PR.

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

No branches or pull requests

2 participants