philogb / jit

The JavaScript InfoVis Toolkit provides tools for creating Interactive Data Visualizations for the Web
http://thejit.org
Other
1.51k stars 297 forks source link

TreeMap : computed node height can be negative #54

Closed clementdenis closed 13 years ago

clementdenis commented 13 years ago

If a subnode is small enough, the computed display height can be negative. It creates a weird rendering on Firefox, Chrome, and produces an error on IE.

The problem is in Layouts.TM.js, in the computePositions function height = chi.getData('height', prop) - offst - config.titleHeight,

If chi.getData('height', prop) is smaller than config.titleHeight, the computed height is negative.

I just added this line as a workaround (the node is not displayed, but the rendering is ok in all browsers) height = height < 0 ? 0 : height;

philogb commented 13 years ago

Thanks a lot for your feedback, I will try to fix this issue for the next release :)

philogb commented 13 years ago

Fixed in the master branch :)