Skip to content

[Feature, Prototype, Code] Word-wrap for the Axis Title #5700

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

Closed
m-podlesny opened this issue Jun 1, 2021 · 1 comment
Closed

[Feature, Prototype, Code] Word-wrap for the Axis Title #5700

m-podlesny opened this issue Jun 1, 2021 · 1 comment

Comments

@m-podlesny
Copy link

m-podlesny commented Jun 1, 2021

There are already ongoing discussions about related topic:
#2053 and #382
First one stays open since 2017. Second - since 2016.

While we are waiting for the Unification of text rendering and wrapping, maybe it's worth to update convertToTspans() and buildSVGText() functions a bit, to have the text wrapping for the axes titles working.

Prototype solution

It needs improvements and some testing.
Proposed API:

layout.xaxis.title.wrap?: boolean
layout.yaxis.title.wrap?: boolean

If true - it's going to work like a word-break.
Default: undefined.

Here you are the code comparison: master...m-podlesny:master

Localhost test for a simple string:

str = 'Lorem Ipsum is simply dummy text of the printing and typesetting.';

image

ToDo: Improve the word wrapping if the string has <br />.

str = 'First line.<br />Second line that is very loooong.';
str = 'First line that is very loooong.<br />Second line.';

Let me know if it's worth to continue this way.

@m-podlesny m-podlesny changed the title Word-wrap for the Axis Title [Feature, Prototype, Code] Word-wrap for the Axis Title Jun 3, 2021
@gvwilson
Copy link
Contributor

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

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