Closed jeffcatania closed 7 years ago
@jeffcatania This seems to be localized to the scale that's passed into the legend rendering in the example, not the legend rendering itself. The solution would be to use a sqrt scale for radius and rect size where the range starts at zero, so the area is always proportional to the quantity.
@jeffcatania yes I agree with @curran here (thanks for the follow up). The assumption is that you would use a sqrt scale in the case. I will update the documentation so it is a better example, but yes it's just dependent on the scale you send it.
Awesome. Thanks for the help!
Hi Susie,
Awesome library. Definitely simplifies my life quite a bit.
There seems to be a bug with the implementation of the d3.legendSize() computations, as per Tufte's data-ink ratio.
If you take the circles example, you can see the computed radius mappings are 5.0->20px and 10.0->30px.
For the purposes of simplifying the mapping, I will assume that the scale should be zeroed (where 0->0px, 5.0->10px, 10.0->20px). According to Tufte's data-ink theory, the entire area of each circle should scale linearly. However, in the rendered example 5.0->10px radius->100 sq px area and 10.0->20px radius->400 sq. px area. As you can see, double the radius is 4x the area. 5.0 should be mapped to 14px radius if the radius of 10.0->20px.
This bug affects rects as well.