Open MarcSkovMadsen opened 18 hours ago
Oh wow -- this is incredible! Sorry, I responded to your App Frameworks Issue (#35) before seeing this. But I get now why you said ipyreact is not necessary! I'm away this week, but will dig more into integrating with panel once I'm back!
I'm on board with making ipyreact optional and adding a Panel implementation. And this example is so helpful!
(cc @schloerke in case you're interested, the Panel example is very similar to our prototype AnyWidget stuff)
FYI. Panel supports the AnyWidget AFM API via https://panel.holoviz.org/reference/custom_components/AnyWidgetComponent.html.
Then it should be possible to use the same javascript for Panel and Jupyter/ AnyWidget if you want. Only difference is the Python "models" using Param or Traitlets.
Maarten Bredals from Py.Cafe helped show me how I could actually run Panel + Reactable there. So here is a link to a working application https://py.cafe/awesome.panel.org/panel-reactable-table.
Congrats on the launch.
This looks like a powerful and mature table. Would be nice if Panel was integrated or supported. I've crossposted this request with Panel in https://github.com/holoviz/panel/issues/7522.
Its pretty easy to support via ReactComponent.
Please either provide a Panel native component in the library or document how it can be used with Panel.
Extra Example
I would have liked to share this example on Py.Cafe. But its not possible (#34).
"""
data = cars_93[:5, ["make", "mpg_city", "mpg_highway"]]
def html_barchart(label, width="100%", height="1rem", fill="#00bfc4", background=None): """Create general purpose html fill bar."""
def fmt_barchart(ci: CellInfo, **kwargs): """Format cell value into html fill bar."""
reactable = Reactable( data, columns={ "mpg_city": Column( name="MPG (city)", align="left", cell=fmt_barchart, ), "mpg_highway": Column( name="MPG (highway)", align="left", cell=lambda ci: fmt_barchart(ci, fill="#fc5185", background="#e1e1e1"), ), }, default_page_size=5, ) reactable_table = ReactableTable(reactable)
Layout the components
Should support dark FastListTemplate table css one day
pn.template.FastListTemplate( title="Panel reactable-py", main=[HEADER, reactable_table, DETAILS], accent=ACCENT, main_layout=None, main_max_width="800px", ).servable()