-
Notifications
You must be signed in to change notification settings - Fork 19
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
textWrap issue with overflow and long text #111
Comments
@pdesoyres thanks for finding this. I've pushed a fix, please update your d3plus-text install and let me know if it works for you! Also, did you know you can simplify your ES module import? import {textWrap} from 'd3plus-text'; |
@davelandry thank you for this quick fix. Now, I have no error anymore. But, is there a way to truncate the text and add an ellipsis at the end ? |
Setting The |
Thank you @davelandry . I will handle ellipsis with TextBox. Anyway, I found another bug at the same line of code : Running following code
will throw the same Error : I suggest to fix that be changing Line 59 in 3dddf7e
by
|
@pdesoyres good catch! just pushed another release |
@davelandry thank you. This is now working fine. |
@davelandry Thank you so much for providing this library! :-) I'm currently trying to modernize the way my organization handles JS dependencies, and I'm having trouble with d3plus. I figured I'd be able to use
I haven't found documentation about how to use I've tried all sorts of variations of that The error I'm getting is:
If you have a moment, I'd very much appreciate any hints. Thanks! |
@ryancwalsh great to see some ES6 users! each d3plus package exports every Class and Function as named exports, so you should be able to do the following: import {textWidth} from "d3plus-text"; |
@davelandry Thanks so much for your response! And that's one of the variations I tried (and I just tried again since you confirmed that that was the right approach). Unfortunately I get the error that I showed above. What's weird is that I can get everything to work if I put I will keep playing around. Maybe I'll be able to narrow down what the problem is. |
@davelandry Upgrading from "0.9.43" to "^0.10.1" fixed it. The other way I noticed I could fix it (temporarily within 0.9.43) was by adding |
Hi. We have recently upgraded to Babel7 and are hitting an issue 'TypeError: TypeError: Cannot redefine property: innerHTML' in d3plus-text. We have various d3 packages installed as dependencies We get the same issue with 0.9.25 version. Inserting "configurable: true" at the points in d3plus-text.js where it defines the innerHTML property fixes the issue temporarily
Is there a fix for this? |
@phullphill two questions:
The docs of So because that makes it work, it makes me think you're build process is loading both the d3plus polyfill for innerHTML before then loading another polyfill for innerHTML on top of it (causing the need for it to be changed and/or deleted). I've been using d3plus-text with Babel7 for a while now with no issue, and I believe if you import the d3plus-text functions as ES modules then it shouldn't include the d3plus polyfill. |
When running following code
I get an error :
TypeError: Cannot read property 'replace' of undefined
atd3plus-text/src/textWrap.js
Line 59 in 46be263
The text was updated successfully, but these errors were encountered: