Side histograms are x-scaled up to the side of the (inferred) main direction of the reaction.
Hover histograms are just x-scaled by 80.
In the case of side histograms, the appearance is right (leaving out edge cases where the direction has not been properly inferred). However, x-scaling makes it very tricky to put text with extra information on the histogram, like a number for the mean and axis.
In the hover case, this is fundamentally wrong, since initial x-size depends on the data. The hover should have a fixed size, instead of a fixed scale.
Solutions
There are two solutions.
The first is to stop scaling and draw the histogram with proper x-size, calculated prior to the path construction. This makes it easy two add things on top and the intention of having the size (and not the scale) to some value is better expressed.
The second is to calculate the scale for x given the final desired size. To account for text scaling, each child transform has to be updated accordingly to $\frac {1}{scale}$.
An hybrid will be needed. I think is better to avoid scaling as much as possible but y-scaling is unavoidable to have comparable scales between histogram and to have it as a parameter.
Description
There are two kind of hist-like geoms:
In the case of side histograms, the appearance is right (leaving out edge cases where the direction has not been properly inferred). However, x-scaling makes it very tricky to put text with extra information on the histogram, like a number for the mean and axis. In the hover case, this is fundamentally wrong, since initial x-size depends on the data. The hover should have a fixed size, instead of a fixed scale.
Solutions
There are two solutions.
The first is to stop scaling and draw the histogram with proper x-size, calculated prior to the path construction. This makes it easy two add things on top and the intention of having the size (and not the scale) to some value is better expressed.
The second is to calculate the scale for x given the final desired size. To account for text scaling, each child transform has to be updated accordingly to $\frac {1}{scale}$.
An hybrid will be needed. I think is better to avoid scaling as much as possible but y-scaling is unavoidable to have comparable scales between histogram and to have it as a parameter.