Closed longxiaofei closed 5 months ago
def to_table_html( df: DataFrame, *, theme_key: Literal['vega', 'g2'] = 'g2', dark: Literal['media', 'light', 'dark'] = 'media', **kwargs ) -> str: """ Generate embeddable HTML code of Graphic Walker with data of `df`. Args: - df (pl.DataFrame | pd.DataFrame, optional): dataframe. Kargs: - theme_key ('vega' | 'g2'): theme type. - dark ('media' | 'light' | 'dark'): 'media': auto detect OS theme. """ pass
from pygwalker.api.html import to_table_html with open("pyg_table.html", "w") as f: f.write(to_table_html(df))
def to_render_html( df: DataFrame, spec: str, *, theme_key: Literal['vega', 'g2'] = 'g2', dark: Literal['media', 'light', 'dark'] = 'media', **kwargs ) -> str: """ Args: - df (pl.DataFrame | pd.DataFrame, optional): dataframe. - spec (str): chart config data. config id, json, remote file url Kargs: - theme_key ('vega' | 'g2'): theme type. - dark ('media' | 'light' | 'dark'): 'media': auto detect OS theme. """ pass
from pygwalker.api.html import to_table_html with open("pyg_render.html", "w") as f: f.write(to_render_html(df))
to_table_html
to_render_html