skrub icon indicating copy to clipboard operation
skrub copied to clipboard

Showing values for bar plots in TableReport

Open alamehm opened this issue 6 months ago • 2 comments

Problem Description

Hello, It would be great if we can see the value of a horizontal bar , or a vertical bar in the TableReport plot. Currently the situation is the following:

  • For vertical bars, we cannot know the exact value of a bar (X and Y), especially when we have a single tick label in the axes, with large values .
  • For horizontal bars, we can see the percentage of each bar, but not the value as well.

Suggestion:

  • Showing more info about each bar on_hover , similar to what is used in other libraries like plotly.
  • This way the layout of TableReport will remain the same, but the info will be shown on_hover only

Below is an example of the current TableReport plots.

Image

Feature Description

  • Adding an on_hover event to the plots
  • This may open the doors to simplify the implementation of "tailored" plots in TableReport

Alternative Solutions

Using off-the-shelf solutions may solve it ex.plotly, but this will add a new dependency for skrub , and it is not straight forward to execute javascript inside templates (currently in skrub, the plots exist inside template tags)

Additional Context

No response

alamehm avatar Jun 19 '25 10:06 alamehm

Hey @alamehm, thanks a lot for the suggestion!

I agree that the current version of the plots in the TableReport could be improved (having only one tick in some cases should be fixed, for example).

I think that having the exact value of a bar could be quite useful, and straightforward to implement. It could also be a kwarg or a configuration parameter for convenience.

I am not keen on adding a dependency on plotly for that, and in general I'm afraid that replacing the current plots with a plotly version would likely introduce a lot of issues.

Tailored plots are a cool idea that I remember from the workshop, and while there is some refactoring to be done, it shouldn't be too difficult.

So, I like the suggestion but I am not convinced that implementing it with plotly would be the best way of doing it 🤔

rcap107 avatar Jun 19 '25 13:06 rcap107

@rcap107, I agree with you about the issues of adding a new dependency.

alamehm avatar Jun 19 '25 13:06 alamehm

I try to open an Pull Request for plotting the value on the histogram.

lionelkusch avatar Jul 09 '25 08:07 lionelkusch