You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/01/09 19:07:33 UTC

[GitHub] betodealmeida opened a new pull request #6626: Improve padding in NVD3Vis

betodealmeida opened a new pull request #6626: Improve padding in NVD3Vis
URL: https://github.com/apache/incubator-superset/pull/6626
 
 
   I made some cosmetic adjustments to the padding in the `NVD3Vis.js` file for when the x labels are at 45 degrees. First, I shifted the labels to the left so they look better. Before:
   
   <img width="1698" alt="screen shot 2019-01-09 at 10 59 32 am" src="https://user-images.githubusercontent.com/1534870/50921864-df913580-13fd-11e9-9a1c-e851e99a5484.png">
   
   After:
   
   <img width="1698" alt="screen shot 2019-01-09 at 10 58 11 am" src="https://user-images.githubusercontent.com/1534870/50921874-e5871680-13fd-11e9-8bf0-a3e1cc99ee35.png">
   
   Now they are aligned with the middle of the first character of the label. This makes a difference in long labels. Before:
   
   <img width="1698" alt="screen shot 2019-01-09 at 11 03 48 am" src="https://user-images.githubusercontent.com/1534870/50922022-49a9da80-13fe-11e9-9a48-d641b2efa5a4.png">
   
   After:
   
   <img width="1698" alt="screen shot 2019-01-09 at 11 03 34 am" src="https://user-images.githubusercontent.com/1534870/50922057-5af2e700-13fe-11e9-9502-d0574c7c93c6.png">
   
   I also improved the way the extra padding is computed. Before, it the maximum label had a length of `X` we would add `X` pixels to both the right and the bottom margin, resulting in excessive padding. I updated the padding to be a function of the rotation angle (for 45 degrees we use `X*sqrt(2)/2` instead, eg).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org