kurkle / chartjs-chart-treemap

Chart.js module for creating treemap charts
MIT License
140 stars 34 forks source link

Children overflow parents when they're narrower than spacing #77

Closed imankulov closed 2 years ago

imankulov commented 2 years ago

Hey @kurkle!

I came across an issue in the chartjs-chart-treemap, and I hope you can help me resolve it.

When using groups and non-zero spacing, and when one of the rectangle dimensions is less than the spacing value, child rectangles may overflow their parents.

I reproduced it across all versions between v1.0.0 and v2.0.1. It seems like the version v0.2.3 behaves correctly, hiding the rectangle that's too narrow to show.

If you need more context or any other help with this issue, please let me know. Thank you!

Codepen samples:

chartjs-chart-treemap@2.0.1, chart.js@3.7.0

chartjs-chart-treemap@2.0.1, chart.js@3.7.0

chartjs-chart-treemap@0.2.3, chart.js@2.9.4

chartjs-chart-treemap@0.2.3, chart.js@2.9.4
kurkle commented 2 years ago

Thanks @imankulov, that's a well described bug.

imankulov commented 2 years ago

Works like a charm. Thanks a lot for the quick turnaround, Jukka! ✨ 🍰 ✨