skrub icon indicating copy to clipboard operation
skrub copied to clipboard

Interactivity for reporting of skrub

Open lionelkusch opened this issue 3 months ago • 6 comments

An ideal option, would have been to have a "hover": information that appears when the mouse goes over the relevant graph. But it's hard to do with our current toolkit.

Originally posted by @GaelVaroquaux in https://github.com/skrub-data/skrub/issues/1496#issuecomment-3328175022

lionelkusch avatar Sep 24 '25 13:09 lionelkusch

By looking at some possibilities, I find that it's possible to use mpld3 to generate an html figure and include it in jinja template.

A guide line is proposed in this stackoverflow question: https://stackoverflow.com/questions/25728442/how-to-place-a-matplotlib-plot-into-an-html-container-using-mpld3-and-flask

lionelkusch avatar Sep 24 '25 13:09 lionelkusch

I think that if we want more interactivity we should consider using plotly directly, and move towards using plotly for all the plots in the TableReport instead of trying to work around matplotlib.

With the dataops plotly has become a required dependency, so we could actually move in that direction now without needing a new dependency.

That said, I don't like working with plotly, so I won't be the one leading the charge to rework the TableReport to use plotly instead of matplotlib.

For the record, this was originally brought up in #1454, and I disagreed with using plotly at the time. However, at this point I need to reconsider the proposal (though I still won't be the one that works on it).

rcap107 avatar Oct 09 '25 14:10 rcap107

That said, I don't like working with plotly, so I won't be the one leading the charge to rework the TableReport to use plotly instead of matplotlib.

That's not going to work: cannot be customized and thus will not render well in small settings.

How about we don't touch anything on the TableReport. People like it as such

GaelVaroquaux avatar Oct 09 '25 17:10 GaelVaroquaux

How about we don't touch anything on the TableReport. People like it as such

In general I agree. The problem is that, if we want to add more information to the TableReport, we're going to run out of space, and having interactive plots would be a way out of that. If that's the direction, using matplotlib rather than plotly would probably make life much harder.

Whether we need to add more information at all is a completely different discussion.

rcap107 avatar Oct 10 '25 07:10 rcap107

In general I agree. The problem is that, if we want to add more information to the TableReport, we're going to run out of space, and having interactive plots would be a way out of that. If that's the direction, using matplotlib rather than plotly would probably make life much harder.

What we should really do, IMHO, is to use SVGs generated via templates, and use the CSS "hover" properties. Ie, leave the Python world, and really use HTML technology.

But that's and lot of work, and we should consider it only later, much later

GaelVaroquaux avatar Oct 10 '25 09:10 GaelVaroquaux

indeed, replacing the simple SVG with plotly figures would jeopardize a key feature of the tablereport: that it tends to always work and display correctly in different environments and screen sizes. speaking of which ...

https://github.com/skrub-data/skrub/issues/1672

jeromedockes avatar Oct 12 '25 22:10 jeromedockes