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

Is there a way to softwrap labels? #62

Open
dagumak opened this issue Nov 25, 2013 · 5 comments
Open

Is there a way to softwrap labels? #62

dagumak opened this issue Nov 25, 2013 · 5 comments

Comments

@dagumak
Copy link

dagumak commented Nov 25, 2013

I saw the stagger labels, but since these labels are drawn by SVG, how would I go about adding line breaks? I'm thinking of using d3.selectAll('text') and then adding a line break after the first space.

@cmaurer
Copy link
Contributor

cmaurer commented Nov 26, 2013

@dagumak
What about CSS?

@dagumak
Copy link
Author

dagumak commented Nov 26, 2013

I actually gave that a shot, but it didn't make a difference. It seems like I would have to wrap textarea elements around it. http://stackoverflow.com/questions/4991171/auto-line-wrapping-in-svg-text

@cmaurer
Copy link
Contributor

cmaurer commented Nov 26, 2013

@dagumak
What about a div with a specific class name, then work the margin with CSS?
http://stackoverflow.com/questions/18727064/add-line-break-after-p-tag-using-javascript-jquery

<div class="soft-wrap">text to soft wrap</div>
.soft-wrap {margin-bottom:10px}

@dagumak
Copy link
Author

dagumak commented Dec 20, 2013

I don't think I have much CSS options since the text element is SVGs. I found this stackoverflow and it suggests to add a foreign object: http://stackoverflow.com/questions/4991171/auto-line-wrapping-in-svg-text

@carolineBda
Copy link

Any update on wrapping labels?

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

3 participants