MCPcopy
hub / github.com/Kanaries/pygwalker / display_html

Function display_html

pygwalker/utils/display.py:9–35  ·  view source on GitHub ↗

Judge the presentation method to be used based on the context Args: - html (str): html string to display. - env: (Literal['Widgets' | 'Streamlit' | 'Jupyter'], optional): The enviroment using pygwalker * - slot_id(str): display with given id.

(
    html: Union[str, HTML, ipywidgets.Widget],
    *,
    slot_id: str = None
)

Source from the content-addressed store, hash-verified

7
8
9def display_html(
10 html: Union[str, HTML, ipywidgets.Widget],
11 *,
12 slot_id: str = None
13):
14 """Judge the presentation method to be used based on the context
15
16 Args:
17 - html (str): html string to display.
18 - env: (Literal['Widgets' | 'Streamlit' | 'Jupyter'], optional): The enviroment using pygwalker
19 *
20 - slot_id(str): display with given id.
21 """
22 if isinstance(html, str):
23 widget = HTML(html)
24 else:
25 widget = html
26
27 if slot_id is None:
28 display(widget)
29 else:
30 handler = DISPLAY_HANDLER.get(slot_id)
31 if handler is None:
32 handler = display(widget, display_id=slot_id)
33 DISPLAY_HANDLER[slot_id] = handler
34 else:
35 handler.update(widget)

Callers 14

showMethod · 0.90
hideMethod · 0.90
init_displayMethod · 0.90
render_gw_reviewMethod · 0.90
_send_jsFunction · 0.90
runMethod · 0.90
show_tips_user_kaggleFunction · 0.90
display_on_jupyterMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected