jaumard / ngx-dashboard

Dashboard library for angular 4 and more
https://jaumard.github.io/ngx-dashboard/demo/demoDist/index.html
MIT License
71 stars 31 forks source link

When size is not an integer (i.e 1.2, 1.8) the height allocate wrong margin #42

Closed evandrogrm closed 6 years ago

evandrogrm commented 6 years ago

Hi, great component, When i put some size like the tittle, the size of margin allocate the height/width wrong. Demo here: https://stackblitz.com/edit/angular-mw3s1w?file=src%2Fapp%2Fapp.component.html Image: screenshot_20180924_173256

jaumard commented 6 years ago

Hello :)

Thanks for the report but this is by design :) size needs to be integer for the algorithm to work. It's a simple algorithm that create a proportional grid, allowing floating size will break the "proportional" effect as widgets will have whatever size. It will change the all purpose of the library and the all algorithm will need to be rewrite to allow this as widget will be able to be positioned at multiple x and y.

on your example it's only the height that is a float, this can be done quite easily but a nightmare with the current algorithm if you want to support this for width too. I think if you start supporting float it should be for both width and height...

Feel free to create your own dashboard library with a Floating size algorithm, if my code can be a starting point it's cool but the main part will be the algorithm so I'm not sure it will help you a lot.