Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add hv.HTML Element? #2221
Linked streams in HoloViews make it feasible to make richly linked interactive apps, where hovering or clicking in one plot can control which information is shown in other plots. E.g. the Tap example shows how a click on a heatmap can open an associated curve, and the LandSat example shows how to do the same by just hovering. This functionality is really powerful, but it's limited by the scope of what can be contained in a HoloViews element, and so what can be linked right now are just plots and tables.
It could be very useful to be able to bring up arbitrary HTML information, if we add an HV element that can accept arbitrary HTML-renderable content as its .data. Such content might include a textual description of a selected data point, a news article about that item, some web page links associated with it, and so on -- anything that can be put into a
Bokeh should be able to handle arbitrary HTML like this, but the matplotlib renderer would not have an HTML parser, in which case it could possibly show the .data characters as a plot with a text annotation, just to give it some value under mpl as well. It's not ideal, but exploiting the power of HTML for formatting and hyperlinking in the Bokeh case seems to override the goal of having the backends have similar functionality.
The prototype looks good: a relatively thin wrapper around Bokeh's
I do think your examples demonstrate the generality of such an element which I consider a curse as much as a blessing. I suppose I would be ok with this as a bokeh-only element although I would hate to see it abused. I just hope our users will use this power in the few sensible ways it can be used as opposed to the uncountably larger number of ways it could be used to give me nightmares!
@philippjfr, that Div prototype looks fabulous! Showing a dataframe there is an odd coincidence, as I just added that ability to Datashader's Images class as well; it can now handle anything with a
Can you add an example of what would happen for formatted text in general, i.e. something with paragraphs? When it's big, will it get a scroll bar, get crammed into a box, get cut off, or...?