-
Notifications
You must be signed in to change notification settings - Fork 18
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
advanced overflow options #1
Comments
That was the intended behavior. I've always just enabled the fontResize and this took care of shrinking the text to fit. That being said, I have no problem adding in a "overflow" boolean. |
I was going to do a PR but see it is already done. Have you considered instead of just a boolean, add a few options like 'clip', 'resize', 'hidden', 'overflow'? |
hmm interesting, can you describe the difference between "clip" and "hidden", and how "resize" differs from the fontResize method? definitely wouldn't mind you taking a crack at it if you feel comfortable |
My idea was the following: 'hidden' - hide the entire text that overflows, this is the current default. I guess this name can be easily confused with clip. 'visible' - just show it. 'clip' - draw a binding box (defined a clip path?) and hide the overflow. 'resize' - force resize when text overflows. I realized later this is the same as setting fontMin === font Size. |
Thank you for making this a standalone module. It took me some time to figure out the new API so perhaps I am missing something.
What I am seeing is that if a word is too long for the bounding box it is omitted completely. I believe this is happening here: https://github.com/d3plus/d3plus-text/blob/master/src/box.js#L189 . If I comment out this line the labels that are too long for the bounding box overflow. Not sure if this is by design, perhaps it should be an option at least.
I'm using the module like this:
The text was updated successfully, but these errors were encountered: