diff --git a/.gitignore b/.gitignore index b053fc2..b5b40da 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ examples/*.html # mkdocs .cache + +# python +.venv diff --git a/ngql/magic.py b/ngql/magic.py index bf3171c..d4ee20d 100644 --- a/ngql/magic.py +++ b/ngql/magic.py @@ -264,13 +264,22 @@ def _stylized(self, result): except ImportError: raise ImportError("Please install pandas to use STYLE_PANDAS") + pd.set_option("display.max_columns", None) + pd.set_option("display.max_colwidth", None) + pd.set_option("display.max_rows", 300) + pd.set_option("display.expand_frame_repr", False) + columns = result.keys() d: Dict[str, list] = {} for col_num in range(result.col_size()): col_name = columns[col_num] col_list = result.column_values(col_name) d[col_name] = [x.cast() for x in col_list] - return pd.DataFrame(d) + df = pd.DataFrame(d) + df.style.set_table_styles( + [{"selector": "table", "props": [("overflow-x", "scroll")]}] + ) + return df elif self.ngql_result_style == STYLE_RAW: return result else: diff --git a/requirements.txt b/requirements.txt index 689cb88..3e19f68 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Jinja2 -nebula3-python>=3.5.1 +nebula3-python>=3.8.0 pandas tqdm pyvis diff --git a/setup.py b/setup.py index 132e274..d99b7ef 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ python_requires=">=3.6", install_requires=[ "Jinja2", - "nebula3-python>=3.5.1", + "nebula3-python>=3.8.0", "pandas", "tqdm", "pyvis", diff --git a/setup_ipython.py b/setup_ipython.py index 4017469..6aaef24 100644 --- a/setup_ipython.py +++ b/setup_ipython.py @@ -25,7 +25,7 @@ python_requires=">=3.6", install_requires=[ "Jinja2", - "nebula3-python>=3.5.1", + "nebula3-python>=3.8.0", "pandas", "tqdm", "pyvis",