Ipysheet - An Ipywidget based Spreadsheet that works with Panel

IPySheet

I’m preparing an Introduction to Panel talk to Panel and would like to share some of the code examples.

Here it is Ipysheet. In general Panel provides support for Ipywidgets, c.f. Ipywidget Reference Guide.

If you like Panel and this showcase please share on social media. Thanks

import panel as pn
import ipywidgets as ipw
import ipysheet

pn.extension("ipywidgets", sizing_mode="stretch_width")

accent_base_color = "#F08080"

def get_widget(accent_base_color="blue"):
    slider = pn.widgets.FloatSlider(value=10, start=0, end=100)
    sheet = ipysheet.sheet()

    ipysheet.cell(1,1, "Input")
    cell3 = ipysheet.cell(1,2, 42.)
    ipysheet.cell(2,1, "Output")
    cell_sum = ipysheet.cell(2,2, 52., read_only=True, background_color=accent_base_color)

    @pn.depends(slider, cell3, watch=True)
    def calculate(a,b):
        cell_sum.value = a+b

    return pn.Column(slider, sheet)

widget = get_widget(accent_base_color=accent_base_color)
component = pn.panel(widget, height=500, sizing_mode="stretch_both")
template = pn.template.FastListTemplate(
    site="Panel",
    title="IPySheet",
    accent_base_color=accent_base_color,
    header_background=accent_base_color,
    header_accent_base_color="white",
)
template.main.append(component)
template.servable()

Please note as of 20210818 you will need