Open didiercrunch opened 8 years ago
Indeed they are. I locally changed them to be parent.getBoundingClientRect().width and parent.getBoundingClientRect().height. Not sure what the procedure is for getting this into the formal code.
thanks for looking into this @laxgeek, the correct place to change is this file: https://github.com/PMSI-AlignAlytics/dimple/blob/c3a10e5a2dbc7c1b67c361f480f6f896af47b22d/src/methods/_parentWidth.js. However I notice that even with removal the current code will still work with parent.clientWidth
.
thanks @kenips! I agree that the code will work fine with parent.clientWidth
. My change was to remove any warnings/errors that may occur in the background once the functionality is removed. I can make the change in the correct file (Github newbie mistake).....but which one? Should I simply remove the call to offsetWidth
or change it to the code I originally inserted (parent.getBoundingClientRect().width
)?
The file to change is dimple/src/methods/_parentWidth.js
. You can leave the rest untouched. Does parent.getBoundingClientRect().width
cover Firefox as well? If so you can really clean up that file :). Thanks!
After a bit of research and testing it appears that parent.getBoundingClientRect().width
works correctly for Firefox. I'll fix up dimple/src/methods/_parentWidth.js
with the changes. Thanks for the guidance!
That's great to know. Thanks for looking into this :beers:.
we have some code that is using dimple in production. Is this something to be concerned about? Will this be considered a hard break in the sense the chart won't render at all come April 1st?
Thanks all, sorry I've been a bit quiet on here lately. I'll be implementing these fixes when I get a chance, however you don't need to be alarmed about the fail date, existing versions of dimple will fall back to methods implemented for other browsers. I'm really excited about getBoundingClientRect as a solution, I wasn't aware of that one. I'll be really pleased to lose the method I implemented for Firefox support.
How does getBoundingClientRect behave with viewbox because the method I've got at the moment doesn't work properly with viewbox.
Thanks @johnkiernander! Less code, simpler code, just makes you sleep better at night! :relieved: I have not personally used viewBox in my system, but I did find this StackOverflow item along with this JFiddle that seem to prove that it works as expected.
Google chrome will remove the offsetWidth and offsetHeight methods of SVGElement in April of this year. There are couple of places where those methods are use in the current code base, we should replace them. See https://www.chromestatus.com/features/5724912467574784 for more details.
Bellow is a log from my console