Closed jspeis closed 6 years ago
Thanks for the fiddle @jspeis, helped a lot in debugging this.
The bad news: because of the way that d3plus-text handles RTL positioning, the visualization needs to be re-rendered whenever the direction is changed: https://jsfiddle.net/0k5arcL0/1/
The good news: are you running into this because you have to manually set the direction after page load in datawheel-canon? If so, I can just bake that into canon fairly quickly so that the page gets rendered with the correct direction (I'm going to go do that right now regardless).
Sounds good to me!
Yes, I was running into this when I was reading the locale from the state.i18n.locale
variable in App.jsx
then was doing something along the lines of style={{direction: locale === "ar" ? "rtl": "ltr"}}
on the container
div. But if cannon could automatically do this based on the locale that would be amazing
Expected Behavior
Expected: after changing body style from LTR to RTL, labels in viz will fit within visualization boundaries
Current Behavior
When changing direction of body style after page load, labels extend past shape boundaries
Steps to Reproduce (for bugs)
See https://jsfiddle.net/0k5arcL0/ and click the button that says "Change Body Direction to RTL"
Your Environment