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
)
| 7 | |
| 8 | |
| 9 | def 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) |
no outgoing calls
no test coverage detected