Closed jbednar closed 6 years ago
__str__
or __repr__
so that Panel can genuinely display everything (even if the textual representation isn't actually appropriate!).All types we listed as hoping to support are now included, so this issue can be closed. Additional types can of course be added as needed over time.
And, as of Panel 0.10.0, even the ipywidgets-based functionality we hadn't initially expected to be able to support should work now!
Panel is designed to be very inclusive, providing basic support for a large number of different types of viewable objects. In categories ordered by decreasing richness of the representation, the supported types are:
_repr_svg_
rich display method_repr_png_
rich display method, including:_repr_jpg_
rich display method.png
,.jpg
,.svg
, or.gif
.png
,.jpg
,.svg
, or.gif
._repr_html_
rich display method, including:_repr_markdown_
rich display method, including:_repr_latex_
rich display method, includingIPython.display.Latex
objectsExpr
objectspanel.widgets
)panel.widgets
)str()
function:The library selects the richest representation available (generally those higher in this list) unless explicitly requested. If you want a rich (non-plaintext) representation for a given object not already supported, you could consider adding one of the various
_repr_X_
methods that allow rich display in IPython/Jupyter. That way, the object will have a rich representation in a Jupyter notebook or Jupyter Lab session, as well as being usable in Panel. If you only want Panel support, you could consider adding a suitable Pane class to Panel, accepting an object of that type and returning something displayable in a Panel.Implementing Pane classes should be straightforward for most object types, with the specific exception that Jupyter-based interactivity provided by ipywidgets is more difficult. We are currently (7/2019) working on ipywidgets integration, and expect that it will be available in late summer 2019, allowing Panel to support the interactive features from: