Creating a custom widget

If we were to use IpyWidgets and traitlets, we could create a DOMWidget with 2 way communication.

Can we create the same with Panel?

Say I want to render an HTML element and have a Javascript function calling a python callback in my widget?

Is there a way to do such thing without using Templates, in Jupyter?

example:
a pn.widgets.button that shows an HTML table.
when clicking on a cell, a python callback is called with some predefined data.

Note:
A docs link would be super

Thank you

Hi @ItamarShDev

For Panel you would build Bokeh extensions. I have a description here https://awesome-panel.readthedocs.io/en/latest/guides/awesome-panel-extensions-guide/bokeh-extensions.html

The best way to start (I think) is with a working example and then change it in small increments.

1 Like