From a0bafc4723e2b335088bab4eb2fcccff16efb467 Mon Sep 17 00:00:00 2001 From: longxiaofei Date: Wed, 12 Jun 2024 13:05:32 +0800 Subject: [PATCH] fix: modify document of appearance param --- README.md | 2 +- docs/README.zh.md | 2 +- pygwalker/api/gradio.py | 2 +- pygwalker/api/html.py | 10 +++++----- pygwalker/api/jupyter.py | 7 +++---- pygwalker/api/streamlit.py | 4 ++-- tests/main-modin.ipynb | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b69b463..4fbb116 100644 --- a/README.md +++ b/README.md @@ -191,7 +191,7 @@ renderer.explorer() | field_specs | Optional[Dict[str, FieldSpec]] | None | Specifications of fields. Will be automatically inferred from `dataset` if not specified. | | hide_data_source_config | bool | True | If True, hides DataSource import and export button. | | theme_key | Literal['vega', 'g2'] | 'g2' | Theme type for the GraphicWalker. | -| dark | Literal['media', 'light', 'dark'] | 'media' | Theme setting. 'media' will auto-detect the OS theme. | +| appearance | Literal['media', 'light', 'dark'] | 'media' | Theme setting. 'media' will auto-detect the OS theme. | | spec | str | "" | Chart configuration data. Can be a configuration ID, JSON, or remote file URL. | | use_preview | bool | True | If True, uses the preview function. | | kernel_computation | bool | False | If True, uses kernel computation for data. | diff --git a/docs/README.zh.md b/docs/README.zh.md index 82d8f0e..f0fa1ee 100644 --- a/docs/README.zh.md +++ b/docs/README.zh.md @@ -189,7 +189,7 @@ Kargs: - env: (Literal['Jupyter' | 'Streamlit'], optional): The enviroment using pygwalker. Default as 'Jupyter' - hide_data_source_config (bool, optional): Hide DataSource import and export button (True) or not (False). Default to True - theme_key ('vega' | 'g2'): theme type. - - dark (Literal['media' | 'light' | 'dark']): 'media': auto detect OS theme. + - appearance (Literal['media' | 'light' | 'dark']): 'media': auto detect OS theme. - return_html (bool, optional): Directly return a html string. Defaults to False. File: /usr/local/lib/python3.9/dist-packages/pygwalker/gwalker.py Type: function diff --git a/pygwalker/api/gradio.py b/pygwalker/api/gradio.py index 64ac7ec..b25fe4c 100644 --- a/pygwalker/api/gradio.py +++ b/pygwalker/api/gradio.py @@ -38,7 +38,7 @@ def get_html_on_gradio( - env: (Literal['Jupyter' | 'Streamlit'], optional): The enviroment using pygwalker. Default as 'Jupyter' - field_specs (List[FieldSpec], optional): Specifications of some fields. They'll been automatically inferred from `df` if some fields are not specified. - theme_key ('vega' | 'g2' | 'streamlit'): theme type. - - dark (Literal['media' | 'light' | 'dark']): 'media': auto detect OS theme. + - appearance (Literal['media' | 'light' | 'dark']): 'media': auto detect OS theme. - spec (str): chart config data. config id, json, remote file url - spec_io_mode (ISpecIOMode): spec io mode, Default to "r", "r" for read, "rw" for read and write. - kernel_computation(bool): Whether to use kernel compute for datas, Default to True. diff --git a/pygwalker/api/html.py b/pygwalker/api/html.py index cdeb4e6..99118ab 100644 --- a/pygwalker/api/html.py +++ b/pygwalker/api/html.py @@ -40,7 +40,7 @@ def _to_html( - field_specs (List[FieldSpec], optional): Specifications of some fields. They'll been automatically inferred from `df` if some fields are not specified. - spec (str): chart config data. config id, json, remote file url - theme_key ('vega' | 'g2' | 'streamlit'): theme type. - - dark ('media' | 'light' | 'dark'): 'media': auto detect OS theme. + - appearance ('media' | 'light' | 'dark'): 'media': auto detect OS theme. """ check_expired_params(kwargs) @@ -95,7 +95,7 @@ def to_html( - field_specs (List[FieldSpec], optional): Specifications of some fields. They'll been automatically inferred from `df` if some fields are not specified. - spec (str): chart config data. config id, json, remote file url - theme_key ('vega' | 'g2'): theme type. - - dark ('media' | 'light' | 'dark'): 'media': auto detect OS theme. + - appearance ('media' | 'light' | 'dark'): 'media': auto detect OS theme. - default_tab (Literal["data", "vis"]): default tab to show. Default to "vis" """ return _to_html( @@ -125,7 +125,7 @@ def to_table_html( Kargs: - theme_key ('vega' | 'g2'): theme type. - - dark ('media' | 'light' | 'dark'): 'media': auto detect OS theme. + - appearance ('media' | 'light' | 'dark'): 'media': auto detect OS theme. """ return _to_html( df, @@ -155,7 +155,7 @@ def to_render_html( Kargs: - theme_key ('vega' | 'g2'): theme type. - - dark ('media' | 'light' | 'dark'): 'media': auto detect OS theme. + - appearance ('media' | 'light' | 'dark'): 'media': auto detect OS theme. """ return _to_html( df, @@ -187,7 +187,7 @@ def to_chart_html( Kargs: - spec_type (Literal["graphic-walker", "vega"]): type of spec. - theme_key ('vega' | 'g2'): theme type. - - dark ('media' | 'light' | 'dark'): 'media': auto detect OS theme. + - appearance ('media' | 'light' | 'dark'): 'media': auto detect OS theme. """ # pylint: disable=import-outside-toplevel # Since the compatibility of quick js is not certain, the related methods are lazy loaded. diff --git a/pygwalker/api/jupyter.py b/pygwalker/api/jupyter.py index e0742c8..41b6cea 100644 --- a/pygwalker/api/jupyter.py +++ b/pygwalker/api/jupyter.py @@ -21,7 +21,6 @@ def walk( env: Literal['Jupyter', 'JupyterWidget'] = 'JupyterWidget', field_specs: Optional[List[FieldSpec]] = None, theme_key: IThemeKey = 'g2', - # alias for appearance, dark is deprecated, please use appearance instead appearance: IAppearance = 'media', spec: str = "", use_kernel_calc: Optional[bool] = None, @@ -42,7 +41,7 @@ def walk( - env: (Literal['Jupyter' | 'JupyterWidget'], optional): The enviroment using pygwalker. Default as 'JupyterWidget' - field_specs (List[FieldSpec], optional): Specifications of some fields. They'll been automatically inferred from `df` if some fields are not specified. - theme_key ('vega' | 'g2' | 'streamlit'): theme type. - - dark (Literal['media' | 'light' | 'dark']): 'media': auto detect OS theme. + - appearance (Literal['media' | 'light' | 'dark']): 'media': auto detect OS theme. - spec (str): chart config data. config id, json, remote file url - use_kernel_calc(bool): Whether to use kernel compute for datas, Default to None, automatically determine whether to use kernel calculation. - kanaries_api_key (str): kanaries api key, Default to "". @@ -117,7 +116,7 @@ def render( Kargs: - theme_key ('vega' | 'g2'): theme type. - - dark (Literal['media' | 'light' | 'dark']): 'media': auto detect OS theme. + - appearance (Literal['media' | 'light' | 'dark']): 'media': auto detect OS theme. - kernel_computation(bool): Whether to use kernel compute for datas, Default to None. - kanaries_api_key (str): kanaries api key, Default to "". """ @@ -160,7 +159,7 @@ def table( Kargs: - theme_key ('vega' | 'g2'): theme type. - - dark (Literal['media' | 'light' | 'dark']): 'media': auto detect OS theme. + - appearance (Literal['media' | 'light' | 'dark']): 'media': auto detect OS theme. - kernel_computation(bool): Whether to use kernel compute for datas, Default to None. - kanaries_api_key (str): kanaries api key, Default to "". """ diff --git a/pygwalker/api/streamlit.py b/pygwalker/api/streamlit.py index a2b0507..b7d8071 100644 --- a/pygwalker/api/streamlit.py +++ b/pygwalker/api/streamlit.py @@ -78,7 +78,7 @@ def __init__( Kargs: - field_specs (List[FieldSpec], optional): Specifications of some fields. They'll been automatically inferred from `df` if some fields are not specified. - theme_key ('vega' | 'g2'): theme type. - - dark (Literal['media' | 'light' | 'dark']): 'media': auto detect OS theme. + - appearance (Literal['media' | 'light' | 'dark']): 'media': auto detect OS theme. - spec (str): chart config data. config id, json, remote file url - spec_io_mode (ISpecIOMode): spec io mode, Default to "r", "r" for read, "rw" for read and write. - kernel_computation(bool): Whether to use kernel compute for datas, Default to True. @@ -301,7 +301,7 @@ def get_streamlit_html( Kargs: - field_specs (List[FieldSpec], optional): Specifications of some fields. They'll been automatically inferred from `df` if some fields are not specified. - theme_key ('vega' | 'g2'): theme type. - - dark (Literal['media' | 'light' | 'dark']): 'media': auto detect OS theme. + - appearance (Literal['media' | 'light' | 'dark']): 'media': auto detect OS theme. - spec (str): chart config data. config id, json, remote file url - kernel_computation(bool): Whether to use kernel compute for datas, Default to None. - use_kernel_calc(bool): Deprecated, use kernel_computation instead. diff --git a/tests/main-modin.ipynb b/tests/main-modin.ipynb index 5b1e4ec..023e820 100644 --- a/tests/main-modin.ipynb +++ b/tests/main-modin.ipynb @@ -12,7 +12,7 @@ " from modin import pandas as pd\n", " import pygwalker as pyg\n", " df = pd.read_csv('./bike_sharing_dc.csv',parse_dates=['date'])\n", - " pyg.walk(df, theme_key='vega', dark='dark')" + " pyg.walk(df, theme_key='vega', appearance='dark')" ] }, {