panel-extensions / panel-material-ui

Panel extension to bring Material UI components to Panel
1 stars 1 forks source link

Mirroring Panel - missing and extra features: Button widgets #5

Open thuydotm opened 1 day ago

thuydotm commented 1 day ago

The code below lists and compares all features for Panel, and Panel material UI Button widgets to find out what's missing and what's new.

import pandas as pd

import panel as pn
import panel_material_ui as pnui
from bokeh.models.widgets.tables import BooleanFormatter

pn.extension('tabulator', template='material', defer_load=True)

def callback(event):
    print("event", event)

widget = "Button"
pnw = eval(f"pn.widgets.{widget}")(name="panel button")
puiw = eval(f"pnui.widgets.{widget}")(name="panel ui button", tooltip="default")

pnw.servable()
puiw.servable()

pn_dir = sorted(dir(eval(f"pn.widgets.{widget}")))
pnui_dir = sorted(dir(eval(f"pnui.widgets.{widget}")))
comparison_df = pd.DataFrame({
    "Item": sorted(set(pn_dir + pnui_dir)),
    "Panel": [item in pn_dir for item in sorted(set(pn_dir + pnui_dir))],
    "Panel Material UI": [item in pnui_dir for item in sorted(set(pn_dir + pnui_dir))]
})
pn.widgets.Tabulator(
    comparison_df.sort_values(by=['Panel Material UI', 'Panel'], ascending=[True, True]),
    formatters={
        "Panel": BooleanFormatter(),
        "Panel Material UI": BooleanFormatter(),
    },
).servable()
thuydotm commented 1 day ago

Missing and extra features for Button widget:

screencapture-localhost-1234-components-2024-11-22-20_17_19

thuydotm commented 1 day ago

Missing and extra features for ButtonIcon widget: screencapture-localhost-1234-components-2024-11-22-20_19_50

thuydotm commented 1 day ago

Missing and extra features for Toggle widget:

screencapture-localhost-1234-components-2024-11-22-20_23_01