Interactivity for reporting of skrub
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
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
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).
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
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.
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
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