laserson / squarify

Pure Python implementation of the squarify treemap layout algorithm
Other
293 stars 36 forks source link

pad can be changed to a value? #21

Closed feiyu007 closed 3 years ago

feiyu007 commented 4 years ago

I used the pad =True. But the gap is biger. So, I want to know this parameter kan be changed to a float or int value?

laserson commented 4 years ago

Let me look into the best way to change this. As a workaround, you can see how the the padded version simply passes each of the rectangles through pad_rectangle: https://github.com/laserson/squarify/blob/master/squarify/__init__.py#L9-L15

You could easily reimplement this for now with you preferred amount of padding. If you're using the plot function, then at least for now you could easily redefine that and have it use your custom padding function.

I'll update this issue when I push a fix.

laserson commented 3 years ago

Closing this, as I don't have time to implement it, and it's easy enough to work around it.