From cf738296ef1bc0a92b4fcc2c753fb02b02fa5c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Mon, 26 Feb 2024 23:37:11 +0100 Subject: [PATCH 01/11] Remove direct invokations of setup.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juan Luis Cano Rodríguez --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 270d5d9252..f8172e6be0 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,8 @@ package: find . -regex ".*/__pycache__" -exec rm -rf {} + find . -regex ".*\.egg-info" -exec rm -rf {} + test -f package/kedro_viz/html/index.html || (echo "Built npm package not found; packaging process cancelled."; exit 1) - cd package && python setup.py clean --all - cd package && python setup.py sdist bdist_wheel + cd package && rm -rf build/ dist/ + cd package && python -m build build: rm -rf build package/build package/dist package/kedro_viz/html pip-wheel-metadata package/kedro_viz.egg-info From 445386139e6453901dfd73aead7fee6029c05c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Mon, 26 Feb 2024 22:23:55 +0100 Subject: [PATCH 02/11] Migrate to pyproject.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix gh-1527 Co-authored-by: Mehdi Naderi Varandi Signed-off-by: Juan Luis Cano Rodríguez --- package/pyproject.toml | 72 ++++++++++++++++++++++++++++++++++++++++++ package/setup.cfg | 12 ------- package/setup.py | 45 +++----------------------- 3 files changed, 77 insertions(+), 52 deletions(-) create mode 100644 package/pyproject.toml delete mode 100644 package/setup.cfg diff --git a/package/pyproject.toml b/package/pyproject.toml new file mode 100644 index 0000000000..a94b7f63fa --- /dev/null +++ b/package/pyproject.toml @@ -0,0 +1,72 @@ +[build-system] +requires = ["setuptools>=65.5.1"] +build-backend = "setuptools.build_meta" + +[project] +name = "kedro-viz" +authors = [ + {name = "Kedro"} +] +description = "Kedro-Viz helps visualise Kedro data and analytics pipelines" +requires-python = ">=3.9" +keywords = [ + "pipelines", + "machine learning", + "data pipelines", + "data science", + "data engineering", + "visualisation", +] +license = {text = "Apache Software License (Apache 2.0)"} +dynamic = ["dependencies", "readme", "version"] + +[project.urls] +Homepage = "https://kedro.org" +Source = "https://github.com/kedro-org/kedro-viz" +Documentation = "https://docs.kedro.org" +Tracker = "https://github.com/kedro-org/kedro-viz/issues" + +[project.optional-dependencies] +docs = [ + "myst-parser<2.1,>=1.0", + "sphinx-notfound-page", + "sphinx<7.3,>=5.3", + "sphinx_copybutton==0.5.2", + "sphinx_rtd_theme==1.3.0" +] +aws = ["s3fs>=2021.4"] +azure = ["adlfs>=2021.4"] +gcp = ["gcsfs>=2021.4"] + +[project.entry-points."kedro.global_commands"] +kedro-viz = "kedro_viz.launchers.cli:viz_cli" + +[project.entry-points."kedro.line_magic"] +line_magic = "kedro_viz.launchers.jupyter:run_viz" + +[project.entry-points."kedro.hooks"] +kedro-dataset-stats = "kedro_viz.integrations.kedro.hooks:dataset_stats_hook" + +[tool.setuptools] +zip-safe = false + +[tools.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + +[tool.setuptools.packages.find] +include = ["kedro_viz*"] +exclude=["tests*", "features*"] + +[tool.pytest.ini_options] +addopts =""" +--verbose -ra +--cov-report xml:coverage.xml +--cov-report term-missing +--cov kedro_viz +--ignore package/tests +--no-cov-on-fail +-ra +--asyncio-mode auto""" +testpaths = [ + "tests" +] diff --git a/package/setup.cfg b/package/setup.cfg deleted file mode 100644 index 41b22260f8..0000000000 --- a/package/setup.cfg +++ /dev/null @@ -1,12 +0,0 @@ -[aliases] -test=pytest - -[tool:pytest] -addopts=--verbose -ra - --cov-report xml:coverage.xml - --cov-report term-missing - --cov kedro_viz - --ignore package/tests - --no-cov-on-fail - -ra - --asyncio-mode auto diff --git a/package/setup.py b/package/setup.py index d2257d6f6d..25b38017b3 100644 --- a/package/setup.py +++ b/package/setup.py @@ -1,13 +1,10 @@ # type: ignore import json import os -from os import path -from setuptools import find_packages, setup - -name = "kedro-viz" -here = path.abspath(path.dirname(__file__)) +from setuptools import setup +here = os.path.abspath(os.path.dirname(__file__)) jsbuild = [ os.path.join(dirpath, f) @@ -17,49 +14,17 @@ files = map(lambda x: x.replace("kedro_viz/", "", 1), jsbuild) -with open(path.join(here, path.pardir, "package.json")) as data: +with open(os.path.join(here, os.path.pardir, "package.json")) as data: obj = json.load(data) version = obj["version"] -with open("requirements.txt", "r", encoding="utf-8") as f: - requires = [x.strip() for x in f if x.strip()] - -with open(path.join(here, "../README.md"), encoding="utf-8") as f: +# Static pyproject.toml cannot access anything above current directory +with open(os.path.join(here, "../README.md"), encoding="utf-8") as f: readme = f.read() - setup( - name=name, version=version, - description="Kedro-Viz helps visualise Kedro data and analytics pipelines", long_description=readme, long_description_content_type="text/markdown", - license="Apache Software License (Apache 2.0)", - url="https://github.com/kedro-org/kedro-viz", - python_requires=">=3.9", - install_requires=requires, - keywords="pipelines, machine learning, data pipelines, data science, data engineering, visualisation", - author="Kedro", - packages=find_packages(exclude=["tests*", "features*"]), package_data={"kedro_viz": list(files)}, - zip_safe=False, - entry_points={ - "kedro.global_commands": ["kedro-viz = kedro_viz.launchers.cli:viz_cli"], - "kedro.line_magic": ["line_magic = kedro_viz.launchers.jupyter:run_viz"], - "kedro.hooks": [ - "kedro-dataset-stats = kedro_viz.integrations.kedro.hooks:dataset_stats_hook" - ], - }, - extras_require={ - "docs": [ - "sphinx>=5.3,<7.3", - "sphinx_copybutton==0.5.2", - "sphinx-notfound-page", - "sphinx_rtd_theme==1.3.0", - "myst-parser>=1.0,<2.1", - ], - "aws": ["s3fs>=2021.4"], - "azure": ["adlfs>=2021.4"], - "gcp": ["gcsfs>=2021.4"], - }, ) From 495a54b1ac908eaf2a017d0c3f0e594c04e7e588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Mon, 26 Feb 2024 23:14:41 +0100 Subject: [PATCH 03/11] Migrate to hatchling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juan Luis Cano Rodríguez --- package/pyproject.toml | 26 ++++++++++++++++---------- package/setup.py | 30 ------------------------------ 2 files changed, 16 insertions(+), 40 deletions(-) delete mode 100644 package/setup.py diff --git a/package/pyproject.toml b/package/pyproject.toml index a94b7f63fa..90f88b35d0 100644 --- a/package/pyproject.toml +++ b/package/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["setuptools>=65.5.1"] -build-backend = "setuptools.build_meta" +requires = ["hatchling", "hatch-requirements-txt"] +build-backend = "hatchling.build" [project] name = "kedro-viz" @@ -8,6 +8,7 @@ authors = [ {name = "Kedro"} ] description = "Kedro-Viz helps visualise Kedro data and analytics pipelines" +readme = {file = "../README.md", content-type = "text/markdown"} requires-python = ">=3.9" keywords = [ "pipelines", @@ -18,7 +19,7 @@ keywords = [ "visualisation", ] license = {text = "Apache Software License (Apache 2.0)"} -dynamic = ["dependencies", "readme", "version"] +dynamic = ["dependencies", "version"] [project.urls] Homepage = "https://kedro.org" @@ -47,15 +48,20 @@ line_magic = "kedro_viz.launchers.jupyter:run_viz" [project.entry-points."kedro.hooks"] kedro-dataset-stats = "kedro_viz.integrations.kedro.hooks:dataset_stats_hook" -[tool.setuptools] -zip-safe = false +[tool.hatch.version] +path = "kedro_viz/__init__.py" -[tools.setuptools.dynamic] -dependencies = {file = ["requirements.txt"]} +[tool.hatch.build.targets.sdist] +include = [ + "requirements.txt", + "/kedro_viz", +] +exclude = [ + "/kedro_viz/docs", +] -[tool.setuptools.packages.find] -include = ["kedro_viz*"] -exclude=["tests*", "features*"] +[tool.hatch.metadata.hooks.requirements_txt] +files = ["requirements.txt"] [tool.pytest.ini_options] addopts =""" diff --git a/package/setup.py b/package/setup.py deleted file mode 100644 index 25b38017b3..0000000000 --- a/package/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -# type: ignore -import json -import os - -from setuptools import setup - -here = os.path.abspath(os.path.dirname(__file__)) - -jsbuild = [ - os.path.join(dirpath, f) - for dirpath, dirnames, files in os.walk("kedro_viz/html/") - for f in files -] - -files = map(lambda x: x.replace("kedro_viz/", "", 1), jsbuild) - -with open(os.path.join(here, os.path.pardir, "package.json")) as data: - obj = json.load(data) - version = obj["version"] - -# Static pyproject.toml cannot access anything above current directory -with open(os.path.join(here, "../README.md"), encoding="utf-8") as f: - readme = f.read() - -setup( - version=version, - long_description=readme, - long_description_content_type="text/markdown", - package_data={"kedro_viz": list(files)}, -) From 59438bb15f5b486f7f0ae733657d0b5855be5f7e Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Mon, 26 Feb 2024 12:12:36 -0600 Subject: [PATCH 04/11] fix lint issue on main Signed-off-by: ravi-kumar-pilla --- .circleci/continue_config.yml | 2 ++ package/kedro_viz/data_access/repositories/graph.py | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/continue_config.yml b/.circleci/continue_config.yml index 6a9a8b0cac..13a40c5f45 100755 --- a/.circleci/continue_config.yml +++ b/.circleci/continue_config.yml @@ -351,6 +351,7 @@ workflows: only: - main - demo + - fix/win-lint - unit_tests: matrix: parameters: @@ -364,6 +365,7 @@ workflows: only: - main - demo + - fix/win-lint - lint: matrix: parameters: diff --git a/package/kedro_viz/data_access/repositories/graph.py b/package/kedro_viz/data_access/repositories/graph.py index 2d4b02ac6a..90f734ec1d 100644 --- a/package/kedro_viz/data_access/repositories/graph.py +++ b/package/kedro_viz/data_access/repositories/graph.py @@ -43,8 +43,7 @@ def __init__(self): self.edges_list: Set[GraphEdge] = set() def __iter__(self) -> Generator: - for edge in self.edges_list: - yield edge + yield from self.edges_list def remove_edge(self, edge: GraphEdge): """Remove an edge from this edge repository. From e22a6ba0df118d2941ec26770cc1f8d59704db68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Tue, 27 Feb 2024 07:11:36 +0100 Subject: [PATCH 05/11] Move README to package/ directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juan Luis Cano Rodríguez --- README.md | 245 +--------------------------------------------- package/README.md | 244 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 245 insertions(+), 244 deletions(-) mode change 100644 => 120000 README.md create mode 100644 package/README.md diff --git a/README.md b/README.md deleted file mode 100644 index 961da37c73..0000000000 --- a/README.md +++ /dev/null @@ -1,244 +0,0 @@ -# Kedro-Viz - -
-

- -![Kedro-Viz Pipeline Visualisation](https://raw.githubusercontent.com/kedro-org/kedro-viz/main/.github/img/banner.png) - -

- -

-✨ Data Science Pipelines. Beautifully Designed ✨ -
-Live Demo: https://demo.kedro.org/ -

- -
- -[![CircleCI](https://circleci.com/gh/kedro-org/kedro-viz/tree/main.svg?style=shield)](https://circleci.com/gh/kedro-org/kedro-viz/tree/main) -[![Documentation](https://readthedocs.org/projects/kedro/badge/?version=stable)](https://docs.kedro.org/en/stable/visualisation/) -[![Python Version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11-orange.svg)](https://pypi.org/project/kedro-viz/) -[![PyPI version](https://img.shields.io/pypi/v/kedro-viz.svg?color=yellow)](https://pypi.org/project/kedro-viz/) -[![Downloads](https://static.pepy.tech/badge/kedro-viz/week)](https://pepy.tech/project/kedro-viz) -[![npm version](https://img.shields.io/npm/v/@quantumblack/kedro-viz.svg?color=cc3534)](https://badge.fury.io/js/%40quantumblack%2Fkedro-viz) -[![License](https://img.shields.io/badge/license-Apache%202.0-3da639.svg)](https://opensource.org/licenses/Apache-2.0) -[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier) -[![Slack Organisation](https://img.shields.io/badge/slack-chat-blueviolet.svg?label=Kedro%20Slack&logo=slack)](https://slack.kedro.org) - -## Introduction - -Kedro-Viz is an interactive development tool for building data science pipelines with [Kedro](https://github.com/kedro-org/kedro). Kedro-Viz also allows users to view and compare different runs in the Kedro project. - -## Features - -- ✨ Complete visualisation of a Kedro project and its pipelines -- 🎨 Supports light & dark themes out of the box -- 🚀 Scales to big pipelines with hundreds of nodes -- 🔎 Highly interactive, filterable and searchable -- 🔬 Focus mode for modular pipeline visualisation -- 📊 Rich metadata side panel to display parameters, plots, etc. -- 📊 Supports all types of [Plotly charts](https://plotly.com/javascript/) -- ♻️ Autoreload on code change -- 🧪 Supports tracking and comparing runs in a Kedro project -- 🎩 Many more to come - -## Installation - -There are two ways you can use Kedro-Viz: - -- As a [Kedro plugin](https://docs.kedro.org/en/stable/extend_kedro/plugins.html) (the most common way). - - To install Kedro-Viz as a Kedro plugin: - - ```bash - pip install kedro-viz - ``` - -- As a standalone React component (for embedding Kedro-Viz in your web application). - - To install the standalone React component: - - ```bash - npm install @quantumblack/kedro-viz - ``` - -## Usage - -#### Compatibility with Kedro - -Ensure your Kedro-Viz and Kedro versions are compatible by referencing the following table: - -| Kedro-Viz version | Kedro version | -| ----------------- | ----------------- | -| >=4.7 | >=0.17.5 | -| >=3.8.0, <4.7 | >=0.16.6, <0.17.5 | -| <3.8.0 | <0.16.6 | - -For **Python 3.6** users, the last supported version of Kedro-Viz is **3.16.0** - -### CLI Usage - -To launch Kedro-Viz from the command line as a Kedro plugin, use the following command from the root folder of your Kedro project: - -```bash -kedro viz run -``` - -A browser tab opens automatically to serve the visualisation at `http://127.0.0.1:4141/`. - -Kedro-Viz also supports the following additional arguments on the command line: - -```bash -Usage: kedro viz run [OPTIONS] - - Visualise a Kedro pipeline using Kedro-Viz. - -Options: - --host TEXT Host that viz will listen to. Defaults to - localhost. - - --port INTEGER TCP port that viz will listen to. Defaults to - 4141. - - --browser / --no-browser Whether to open viz interface in the default - browser or not. Browser will only be opened if - host is localhost. Defaults to True. - - --load-file FILE Path to load kedro-viz data from a directory - --save-file FILE Path to save kedro-viz data to a directory - --pipeline TEXT Name of the registered pipeline to visualise. If not - set, the default pipeline is visualised - - -e, --env TEXT Kedro configuration environment. If not specified, - catalog config in `local` will be used - - --autoreload Autoreload viz server when a Python or YAML file change in - the Kedro project - - --ignore-plugins A flag to ignore all installed plugins in the Kedro Project - - --params TEXT Specify extra parameters that you want to pass to - the context initializer. Items must be separated - by comma, keys - by colon, example: - param1:value1,param2:value2. Each parameter is - split by the first comma, so parameter values are - allowed to contain colons, parameter keys are not. - To pass a nested dictionary as parameter, separate - keys by '.', example: param_group.param1:value1. - - -h, --help Show this message and exit. -``` - -To deploy Kedro-Viz from the command line as a Kedro plugin, use the following command from the root folder of your Kedro project: - -```bash -kedro viz deploy -``` - -```bash -Usage: kedro viz deploy [OPTIONS] - - Deploy and host Kedro Viz on AWS S3. - -Options: - --region TEXT AWS region where your S3 bucket is located [required] - --bucket-name TEXT AWS S3 bucket name where Kedro Viz will be hosted - [required] - -h, --help Show this message and exit. -``` - -To create a build directory of your local Kedro-Viz instance with static data from the command line, use the following command from the root folder of your Kedro project: - -```bash -kedro viz build -``` - -### Experiment Tracking usage - -To enable [experiment tracking](https://docs.kedro.org/en/stable/experiment_tracking/index.html) in Kedro-Viz, you need to add the Kedro-Viz `SQLiteStore` to your Kedro project. - -This can be done by adding the below code to `settings.py` in the `src` folder of your Kedro project. - -```python -from kedro_viz.integrations.kedro.sqlite_store import SQLiteStore -from pathlib import Path -SESSION_STORE_CLASS = SQLiteStore -SESSION_STORE_ARGS = {"path": str(Path(__file__).parents[2] / "data")} -``` - -Once the above set-up is complete, tracking datasets can be used to track relevant data for Kedro runs. More information on how to use tracking datasets can be found in the [experiment tracking documentation](https://docs.kedro.org/en/stable/experiment_tracking/index.html) - -**Notes:** - -- Experiment Tracking is only available for Kedro-Viz >= 4.0.2 and Kedro >= 0.17.5 -- Prior to Kedro 0.17.6, when using tracking datasets, you will have to explicitly mark the datasets as `versioned` for it to show up properly in Kedro-Viz experiment tracking tab. From Kedro >= 0.17.6, this is done automatically: - -```yaml -train_evaluation.r2_score_linear_regression: - type: tracking.MetricsDataset - filepath: ${base_location}/09_tracking/linear_score.json - versioned: true -``` - -### Standalone React component usage - -To use Kedro-Viz as a standalone React component, you can follow the example below. However, please note that Kedro-Viz does not support server-side rendering (SSR). If you're using Next.js or another SSR framework, you should be aware of this limitation. - -```javascript -import KedroViz from '@quantumblack/kedro-viz'; -import '@quantumblack/kedro-viz/lib/styles/styles.min.css'; - -const MyApp = () => ; -``` - -To use with NextJS: - -```javascript -import '@quantumblack/kedro-viz/lib/styles/styles.min.css'; -import dynamic from 'next/dynamic'; - -const NoSSRKedro = dynamic(() => import('@quantumblack/kedro-viz'), { - ssr: false, -}); - -const MyApp = () => ; -``` - -The JSON can be obtained by running: - -```bash -kedro viz run --save-file=filename -``` - -We also recommend wrapping the `Kedro-Viz` component with a parent HTML/JSX element that has a specified height (as seen in the above example) in order for Kedro-Viz to be styled properly. - -**_Our documentation contains [additional examples on how to visualise with Kedro-Viz.](https://docs.kedro.org/en/stable/visualisation/index.html)_** - -## Feature Flags - -Kedro-Viz uses features flags to roll out some experimental features. The following flags are currently in use: - -| Flag | Description | -| ------------------ | --------------------------------------------------------------------------------------- | -| sizewarning | From release v3.9.1. Show a warning before rendering very large graphs (default `true`) | -| expandAllPipelines | From release v4.3.2. Expand all modular pipelines on first load (default `false`) | - -To enable or disable a flag, click on the settings icon in the toolbar and toggle the flag on/off. - -Kedro-Viz also logs a message in your browser's [developer console](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools#The_JavaScript_console) to show the available flags and their values as currently set on your machine. - -## Maintainers - -Kedro-Viz is maintained by the [Kedro team](https://docs.kedro.org/en/stable/contribution/technical_steering_committee.html#kedro-maintainers) and a number of [contributors from across the world](https://github.com/kedro-org/Kedro-Viz/contributors). - -## Contribution - -If you want to contribute to Kedro-Viz, please check out our [contributing guide](./CONTRIBUTING.md). - -## License - -Kedro-Viz is licensed under the [Apache 2.0](https://github.com/kedro-org/kedro-viz/blob/main/LICENSE.md) License. - -## Citation - -If you're an academic, Kedro-Viz can also help you, for example, as a tool to visualise how your publication's pipeline is structured. Find our citation reference on [Zenodo](https://doi.org/10.5281/zenodo.4277218). diff --git a/README.md b/README.md new file mode 120000 index 0000000000..89d5ef5f22 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +package/README.md \ No newline at end of file diff --git a/package/README.md b/package/README.md new file mode 100644 index 0000000000..961da37c73 --- /dev/null +++ b/package/README.md @@ -0,0 +1,244 @@ +# Kedro-Viz + +
+

+ +![Kedro-Viz Pipeline Visualisation](https://raw.githubusercontent.com/kedro-org/kedro-viz/main/.github/img/banner.png) + +

+ +

+✨ Data Science Pipelines. Beautifully Designed ✨ +
+Live Demo: https://demo.kedro.org/ +

+ +
+ +[![CircleCI](https://circleci.com/gh/kedro-org/kedro-viz/tree/main.svg?style=shield)](https://circleci.com/gh/kedro-org/kedro-viz/tree/main) +[![Documentation](https://readthedocs.org/projects/kedro/badge/?version=stable)](https://docs.kedro.org/en/stable/visualisation/) +[![Python Version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11-orange.svg)](https://pypi.org/project/kedro-viz/) +[![PyPI version](https://img.shields.io/pypi/v/kedro-viz.svg?color=yellow)](https://pypi.org/project/kedro-viz/) +[![Downloads](https://static.pepy.tech/badge/kedro-viz/week)](https://pepy.tech/project/kedro-viz) +[![npm version](https://img.shields.io/npm/v/@quantumblack/kedro-viz.svg?color=cc3534)](https://badge.fury.io/js/%40quantumblack%2Fkedro-viz) +[![License](https://img.shields.io/badge/license-Apache%202.0-3da639.svg)](https://opensource.org/licenses/Apache-2.0) +[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier) +[![Slack Organisation](https://img.shields.io/badge/slack-chat-blueviolet.svg?label=Kedro%20Slack&logo=slack)](https://slack.kedro.org) + +## Introduction + +Kedro-Viz is an interactive development tool for building data science pipelines with [Kedro](https://github.com/kedro-org/kedro). Kedro-Viz also allows users to view and compare different runs in the Kedro project. + +## Features + +- ✨ Complete visualisation of a Kedro project and its pipelines +- 🎨 Supports light & dark themes out of the box +- 🚀 Scales to big pipelines with hundreds of nodes +- 🔎 Highly interactive, filterable and searchable +- 🔬 Focus mode for modular pipeline visualisation +- 📊 Rich metadata side panel to display parameters, plots, etc. +- 📊 Supports all types of [Plotly charts](https://plotly.com/javascript/) +- ♻️ Autoreload on code change +- 🧪 Supports tracking and comparing runs in a Kedro project +- 🎩 Many more to come + +## Installation + +There are two ways you can use Kedro-Viz: + +- As a [Kedro plugin](https://docs.kedro.org/en/stable/extend_kedro/plugins.html) (the most common way). + + To install Kedro-Viz as a Kedro plugin: + + ```bash + pip install kedro-viz + ``` + +- As a standalone React component (for embedding Kedro-Viz in your web application). + + To install the standalone React component: + + ```bash + npm install @quantumblack/kedro-viz + ``` + +## Usage + +#### Compatibility with Kedro + +Ensure your Kedro-Viz and Kedro versions are compatible by referencing the following table: + +| Kedro-Viz version | Kedro version | +| ----------------- | ----------------- | +| >=4.7 | >=0.17.5 | +| >=3.8.0, <4.7 | >=0.16.6, <0.17.5 | +| <3.8.0 | <0.16.6 | + +For **Python 3.6** users, the last supported version of Kedro-Viz is **3.16.0** + +### CLI Usage + +To launch Kedro-Viz from the command line as a Kedro plugin, use the following command from the root folder of your Kedro project: + +```bash +kedro viz run +``` + +A browser tab opens automatically to serve the visualisation at `http://127.0.0.1:4141/`. + +Kedro-Viz also supports the following additional arguments on the command line: + +```bash +Usage: kedro viz run [OPTIONS] + + Visualise a Kedro pipeline using Kedro-Viz. + +Options: + --host TEXT Host that viz will listen to. Defaults to + localhost. + + --port INTEGER TCP port that viz will listen to. Defaults to + 4141. + + --browser / --no-browser Whether to open viz interface in the default + browser or not. Browser will only be opened if + host is localhost. Defaults to True. + + --load-file FILE Path to load kedro-viz data from a directory + --save-file FILE Path to save kedro-viz data to a directory + --pipeline TEXT Name of the registered pipeline to visualise. If not + set, the default pipeline is visualised + + -e, --env TEXT Kedro configuration environment. If not specified, + catalog config in `local` will be used + + --autoreload Autoreload viz server when a Python or YAML file change in + the Kedro project + + --ignore-plugins A flag to ignore all installed plugins in the Kedro Project + + --params TEXT Specify extra parameters that you want to pass to + the context initializer. Items must be separated + by comma, keys - by colon, example: + param1:value1,param2:value2. Each parameter is + split by the first comma, so parameter values are + allowed to contain colons, parameter keys are not. + To pass a nested dictionary as parameter, separate + keys by '.', example: param_group.param1:value1. + + -h, --help Show this message and exit. +``` + +To deploy Kedro-Viz from the command line as a Kedro plugin, use the following command from the root folder of your Kedro project: + +```bash +kedro viz deploy +``` + +```bash +Usage: kedro viz deploy [OPTIONS] + + Deploy and host Kedro Viz on AWS S3. + +Options: + --region TEXT AWS region where your S3 bucket is located [required] + --bucket-name TEXT AWS S3 bucket name where Kedro Viz will be hosted + [required] + -h, --help Show this message and exit. +``` + +To create a build directory of your local Kedro-Viz instance with static data from the command line, use the following command from the root folder of your Kedro project: + +```bash +kedro viz build +``` + +### Experiment Tracking usage + +To enable [experiment tracking](https://docs.kedro.org/en/stable/experiment_tracking/index.html) in Kedro-Viz, you need to add the Kedro-Viz `SQLiteStore` to your Kedro project. + +This can be done by adding the below code to `settings.py` in the `src` folder of your Kedro project. + +```python +from kedro_viz.integrations.kedro.sqlite_store import SQLiteStore +from pathlib import Path +SESSION_STORE_CLASS = SQLiteStore +SESSION_STORE_ARGS = {"path": str(Path(__file__).parents[2] / "data")} +``` + +Once the above set-up is complete, tracking datasets can be used to track relevant data for Kedro runs. More information on how to use tracking datasets can be found in the [experiment tracking documentation](https://docs.kedro.org/en/stable/experiment_tracking/index.html) + +**Notes:** + +- Experiment Tracking is only available for Kedro-Viz >= 4.0.2 and Kedro >= 0.17.5 +- Prior to Kedro 0.17.6, when using tracking datasets, you will have to explicitly mark the datasets as `versioned` for it to show up properly in Kedro-Viz experiment tracking tab. From Kedro >= 0.17.6, this is done automatically: + +```yaml +train_evaluation.r2_score_linear_regression: + type: tracking.MetricsDataset + filepath: ${base_location}/09_tracking/linear_score.json + versioned: true +``` + +### Standalone React component usage + +To use Kedro-Viz as a standalone React component, you can follow the example below. However, please note that Kedro-Viz does not support server-side rendering (SSR). If you're using Next.js or another SSR framework, you should be aware of this limitation. + +```javascript +import KedroViz from '@quantumblack/kedro-viz'; +import '@quantumblack/kedro-viz/lib/styles/styles.min.css'; + +const MyApp = () => ; +``` + +To use with NextJS: + +```javascript +import '@quantumblack/kedro-viz/lib/styles/styles.min.css'; +import dynamic from 'next/dynamic'; + +const NoSSRKedro = dynamic(() => import('@quantumblack/kedro-viz'), { + ssr: false, +}); + +const MyApp = () => ; +``` + +The JSON can be obtained by running: + +```bash +kedro viz run --save-file=filename +``` + +We also recommend wrapping the `Kedro-Viz` component with a parent HTML/JSX element that has a specified height (as seen in the above example) in order for Kedro-Viz to be styled properly. + +**_Our documentation contains [additional examples on how to visualise with Kedro-Viz.](https://docs.kedro.org/en/stable/visualisation/index.html)_** + +## Feature Flags + +Kedro-Viz uses features flags to roll out some experimental features. The following flags are currently in use: + +| Flag | Description | +| ------------------ | --------------------------------------------------------------------------------------- | +| sizewarning | From release v3.9.1. Show a warning before rendering very large graphs (default `true`) | +| expandAllPipelines | From release v4.3.2. Expand all modular pipelines on first load (default `false`) | + +To enable or disable a flag, click on the settings icon in the toolbar and toggle the flag on/off. + +Kedro-Viz also logs a message in your browser's [developer console](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools#The_JavaScript_console) to show the available flags and their values as currently set on your machine. + +## Maintainers + +Kedro-Viz is maintained by the [Kedro team](https://docs.kedro.org/en/stable/contribution/technical_steering_committee.html#kedro-maintainers) and a number of [contributors from across the world](https://github.com/kedro-org/Kedro-Viz/contributors). + +## Contribution + +If you want to contribute to Kedro-Viz, please check out our [contributing guide](./CONTRIBUTING.md). + +## License + +Kedro-Viz is licensed under the [Apache 2.0](https://github.com/kedro-org/kedro-viz/blob/main/LICENSE.md) License. + +## Citation + +If you're an academic, Kedro-Viz can also help you, for example, as a tool to visualise how your publication's pipeline is structured. Find our citation reference on [Zenodo](https://doi.org/10.5281/zenodo.4277218). From a8f01e9b3286d1de94e0f8f965046fdbae77089b Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Tue, 9 Jul 2024 16:10:27 -0500 Subject: [PATCH 06/11] adjust file permissions and circleci Signed-off-by: ravi-kumar-pilla --- .circleci/continue_config.yml | 415 ------------------ .github/CODEOWNERS | 0 .../linear_score.json | 0 demo-project/src/demo_project/requirements.in | 0 package/kedro_viz/launchers/cli.py | 0 package/requirements.txt | 0 .../test_api/test_graphql/test_queries.py | 0 .../tests/test_data_access/test_managers.py | 0 .../settings-modal/settings-modal.js | 0 .../shareable-url-modal.scss | 0 src/components/ui/button/button.js | 0 src/components/ui/menu-option/menu-option.js | 0 src/utils/data-source.js | 0 tools/test-lib/react-app/app.js | 0 14 files changed, 415 deletions(-) delete mode 100755 .circleci/continue_config.yml mode change 100755 => 100644 .github/CODEOWNERS mode change 100755 => 100644 demo-project/data/09_tracking/linear_score.json/2023-01-16T15.55.27.850Z/linear_score.json mode change 100755 => 100644 demo-project/src/demo_project/requirements.in mode change 100755 => 100644 package/kedro_viz/launchers/cli.py mode change 100755 => 100644 package/requirements.txt mode change 100755 => 100644 package/tests/test_api/test_graphql/test_queries.py mode change 100755 => 100644 package/tests/test_data_access/test_managers.py mode change 100755 => 100644 src/components/settings-modal/settings-modal.js mode change 100755 => 100644 src/components/shareable-url-modal/shareable-url-modal.scss mode change 100755 => 100644 src/components/ui/button/button.js mode change 100755 => 100644 src/components/ui/menu-option/menu-option.js mode change 100755 => 100644 src/utils/data-source.js mode change 100755 => 100644 tools/test-lib/react-app/app.js diff --git a/.circleci/continue_config.yml b/.circleci/continue_config.yml deleted file mode 100755 index 13a40c5f45..0000000000 --- a/.circleci/continue_config.yml +++ /dev/null @@ -1,415 +0,0 @@ -version: 2.1 - -# Backend CI jobs are the heavy ones, so we only run them if the backend -# or CI config has changed. -parameters: - backend_change: - type: boolean - default: false - ci_change: - type: boolean - default: false - frontend_change: - type: boolean - default: false - -orbs: - win: circleci/windows@2.4.1 - node: circleci/node@5.0.3 - -# No windows executor is listed here since windows builds use win/default and modify -# the Python version through the conda environment. -executors: - docker: - parameters: - python_version: - type: string - docker: - - image: cimg/python:<>-node - working_directory: ~/repo - -commands: - setup_python_env: - steps: - - run: - name: Install Python dependencies - command: | - pip install git+https://github.com/kedro-org/kedro@main - pip install -r package/test_requirements.txt -r demo-project/src/docker_requirements.txt -U - - run: - name: Echo package versions - command: | - python -V - pip freeze - - install_node_dependencies: - steps: - - node/install: - node-version: '16.13.2' - # using install-packages command from node orb - - node/install-packages - - nvm_use_npm_install: - steps: - - run: - name: Use NVM to run Node v16 - command: | - nvm install v16.13.2 - node -v - nvm alias default v16.13.2 - nvm use v16.13.2 - - run: - name: Install Node dependencies - command: | - node -v - npm install - - npm_build: - steps: - - run: - name: Build React application - command: | - node -v - make build - - win_setup_python_env: - # Miniconda3 is pre-installed on the machine: - # https://circleci.com/docs/2.0/hello-world-windows/ - parameters: - python_version: - type: string - steps: - - run: - name: Initialize conda - command: conda init powershell - - run: - name: Create 'kedro-viz' conda environment - command: conda create --name kedro-viz python=<> -y - - run: - name: Install Kedro-Viz dependencies - command: | - conda activate kedro-viz - pip install git+https://github.com/kedro-org/kedro@main - pip install -r package/test_requirements.txt -U - - run: - name: Echo package versions - command: | - conda activate kedro-viz - python -V - pip freeze - - run: - name: Install 'make' command - command: choco install make - - setup: - steps: - - checkout - - setup_python_env - - install_node_dependencies - - npm_build - - win_setup: - parameters: - python_version: - type: string - executor: - steps: - - checkout - - win_setup_python_env: - python_version: <> - - nvm_use_npm_install - - npm_build - - setup_cypress_requirements: - description: Install cypress requirements and dependencies - steps: - - run: - name: Install cypress system dependencies - command: | - sudo sed -i 's/archive.ubuntu.com/us-east-1.ec2.archive.ubuntu.com/g' /etc/apt/sources.list - sudo apt-get update - sudo apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb - -jobs: - e2e_tests: - parameters: - python_version: - type: string - executor: - name: docker - python_version: <> - steps: - - setup - - run: - name: Run all end to end tests - command: make e2e-tests - - win_e2e_tests: - parameters: - python_version: - type: string - executor: win/default - steps: - - win_setup: - python_version: <> - - run: - name: Run all end to end tests on Windows - command: conda activate kedro-viz; make e2e-tests - - unit_tests: - parameters: - python_version: - type: string - executor: - name: docker - python_version: <> - steps: - - setup - - run: - name: Run Python tests - command: make pytest - - win_unit_tests: - parameters: - python_version: - type: string - executor: win/default - steps: - - win_setup: - python_version: <> - - run: - name: Run Python tests on Windows - command: conda activate kedro-viz; make pytest - - lint: - parameters: - python_version: - type: string - executor: - name: docker - python_version: <> - steps: - - checkout - - setup_python_env - - run: - name: Run secret scan - command: make secret-scan - - run: - name: Run security scan - command: make security-scan - - run: - name: Verify GraphQL schema is up to date - command: make schema-check - - run: - name: Run Python formatters and linters - command: make format-check lint-check - - javascript_lint_and_tests: - executor: - name: docker - python_version: '3.9' - steps: - - checkout - - setup_python_env - - install_node_dependencies - - setup_cypress_requirements - - run: - name: Test lib transpilation - command: npm run lib - - run: - name: Test JS library imports - command: | - npm run lib-test:setup - cd tools/test-lib/react-app - npm run test:ci - - run: - name: Run Eslint - command: npm run lint - - run: - name: Run JavaScript tests - command: npm run test:ci - - run: - name: Run Javascript end to end tests - command: npm run cy:ci - - release_to_npm: - executor: - name: docker - python_version: '3.9' - steps: - - checkout - - install_node_dependencies - - npm_build - - run: - name: Authenticate with registry - command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc - - run: - name: Publish to npm - command: npm publish - - release_to_pypi: - executor: - name: docker - python_version: '3.9' - steps: - - setup - - run: - name: Make Python package - command: make package - - run: - name: Install twine - command: python -m pip install -U twine - - run: - name: Publish to PyPI - command: python -m twine upload package/dist/* - - deploy_demo: - executor: - name: docker - python_version: '3.9' - steps: - - checkout - - setup_remote_docker - - run: - name: Setup environment - command: | - cd demo-project - echo "AWS_ECR_URL=public.ecr.aws/g0x0s3o2/kedro-viz-live-demo" >> $BASH_ENV - echo "KEDRO_VIZ_VERSION=$(cat .version)" >> $BASH_ENV - echo "cd demo-project" >> $BASH_ENV - - run: - name: Install AWS CLI - command: pip3 install awscli - - run: - name: Build demo container image - command: | - echo "kedro_viz==$KEDRO_VIZ_VERSION" >> src/docker_requirements.txt - docker build -t $AWS_ECR_URL:$KEDRO_VIZ_VERSION . - aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws - docker push $AWS_ECR_URL:$KEDRO_VIZ_VERSION - - run: - name: Create a new lightsail deployment - command: | - # install lightsail cli - # run https://docs.aws.amazon.com/cli/latest/reference/lightsail/create-container-service-deployment.html#create-container-service-deployment - aws lightsail create-container-service-deployment --region eu-west-2 --cli-input-json file://./lightsail.json - - all_circleci_checks_succeeded: - docker: - - image: circleci/python # any light-weight image - steps: - - run: - name: Success! - command: echo "All checks passed" - -release_filter: &release_filter - filters: - tags: - only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ - branches: - ignore: /.*/ - -workflows: - version: 2.1 - - deploy_demo: - jobs: - - deploy_demo: - context: - - kedro-ecr-publish - filters: - branches: - only: demo - - build_frontend: - when: - or: - - <> - - <> - jobs: - - javascript_lint_and_tests - - all_circleci_checks_succeeded: - requires: - - javascript_lint_and_tests - - build_backend: - when: - or: - - <> - - <> - jobs: - - e2e_tests: - matrix: - parameters: - python_version: ['3.9', '3.10', '3.11'] - - win_e2e_tests: - matrix: - parameters: - python_version: ['3.9', '3.10', '3.11'] - filters: - branches: - only: - - main - - demo - - fix/win-lint - - unit_tests: - matrix: - parameters: - python_version: ['3.9', '3.10', '3.11'] - - win_unit_tests: - matrix: - parameters: - python_version: ['3.9', '3.10', '3.11'] - filters: - branches: - only: - - main - - demo - - fix/win-lint - - lint: - matrix: - parameters: - python_version: ['3.9', '3.10', '3.11'] - - all_circleci_checks_succeeded: - requires: - - e2e_tests - - unit_tests - - lint - - release: - jobs: - - release_to_npm: - <<: *release_filter - - release_to_pypi: - <<: *release_filter - - daily: - triggers: - - schedule: - cron: '0 1 * * *' - filters: - branches: - only: - - main - jobs: - - e2e_tests: - matrix: - parameters: - python_version: ['3.9', '3.10', '3.11'] - - win_e2e_tests: - matrix: - parameters: - python_version: ['3.9', '3.10', '3.11'] - - unit_tests: - matrix: - parameters: - python_version: ['3.9', '3.10', '3.11'] - - win_unit_tests: - matrix: - parameters: - python_version: ['3.9', '3.10', '3.11'] - - lint: - matrix: - parameters: - python_version: ['3.9', '3.10', '3.11'] - - javascript_lint_and_tests diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS old mode 100755 new mode 100644 diff --git a/demo-project/data/09_tracking/linear_score.json/2023-01-16T15.55.27.850Z/linear_score.json b/demo-project/data/09_tracking/linear_score.json/2023-01-16T15.55.27.850Z/linear_score.json old mode 100755 new mode 100644 diff --git a/demo-project/src/demo_project/requirements.in b/demo-project/src/demo_project/requirements.in old mode 100755 new mode 100644 diff --git a/package/kedro_viz/launchers/cli.py b/package/kedro_viz/launchers/cli.py old mode 100755 new mode 100644 diff --git a/package/requirements.txt b/package/requirements.txt old mode 100755 new mode 100644 diff --git a/package/tests/test_api/test_graphql/test_queries.py b/package/tests/test_api/test_graphql/test_queries.py old mode 100755 new mode 100644 diff --git a/package/tests/test_data_access/test_managers.py b/package/tests/test_data_access/test_managers.py old mode 100755 new mode 100644 diff --git a/src/components/settings-modal/settings-modal.js b/src/components/settings-modal/settings-modal.js old mode 100755 new mode 100644 diff --git a/src/components/shareable-url-modal/shareable-url-modal.scss b/src/components/shareable-url-modal/shareable-url-modal.scss old mode 100755 new mode 100644 diff --git a/src/components/ui/button/button.js b/src/components/ui/button/button.js old mode 100755 new mode 100644 diff --git a/src/components/ui/menu-option/menu-option.js b/src/components/ui/menu-option/menu-option.js old mode 100755 new mode 100644 diff --git a/src/utils/data-source.js b/src/utils/data-source.js old mode 100755 new mode 100644 diff --git a/tools/test-lib/react-app/app.js b/tools/test-lib/react-app/app.js old mode 100755 new mode 100644 From c08a8eb609198aade48512da8d7fdc2d5ba201ca Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Tue, 9 Jul 2024 16:17:14 -0500 Subject: [PATCH 07/11] testing symlink Signed-off-by: ravi-kumar-pilla --- README.md | 1 + ...d~d157f82bf03fc53f952f4fb2f2542e862e534631 | 293 ------------------ 2 files changed, 1 insertion(+), 293 deletions(-) create mode 120000 README.md delete mode 100644 README.md~d157f82bf03fc53f952f4fb2f2542e862e534631 diff --git a/README.md b/README.md new file mode 120000 index 0000000000..89d5ef5f22 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +package/README.md \ No newline at end of file diff --git a/README.md~d157f82bf03fc53f952f4fb2f2542e862e534631 b/README.md~d157f82bf03fc53f952f4fb2f2542e862e534631 deleted file mode 100644 index 8b7158c12e..0000000000 --- a/README.md~d157f82bf03fc53f952f4fb2f2542e862e534631 +++ /dev/null @@ -1,293 +0,0 @@ -# Kedro-Viz - -
-

- -![Kedro-Viz Pipeline Visualisation](https://raw.githubusercontent.com/kedro-org/kedro-viz/main/.github/img/banner.png) - -

- -

-✨ Data Science Pipelines. Beautifully Designed ✨ -
-Live Demo: https://demo.kedro.org/ -

- -
- -[![CircleCI](https://circleci.com/gh/kedro-org/kedro-viz/tree/main.svg?style=shield)](https://circleci.com/gh/kedro-org/kedro-viz/tree/main) -[![Documentation](https://readthedocs.org/projects/kedro/badge/?version=stable)](https://docs.kedro.org/en/stable/visualisation/) -[![Python Version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11-orange.svg)](https://pypi.org/project/kedro-viz/) -[![PyPI version](https://img.shields.io/pypi/v/kedro-viz.svg?color=yellow)](https://pypi.org/project/kedro-viz/) -[![Downloads](https://static.pepy.tech/badge/kedro-viz/week)](https://pepy.tech/project/kedro-viz) -[![npm version](https://img.shields.io/npm/v/@quantumblack/kedro-viz.svg?color=cc3534)](https://badge.fury.io/js/%40quantumblack%2Fkedro-viz) -[![License](https://img.shields.io/badge/license-Apache%202.0-3da639.svg)](https://opensource.org/licenses/Apache-2.0) -[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier) -[![Slack Organisation](https://img.shields.io/badge/slack-chat-blueviolet.svg?label=Kedro%20Slack&logo=slack)](https://slack.kedro.org) - -## Introduction - -Kedro-Viz is an interactive development tool for building data science pipelines with [Kedro](https://github.com/kedro-org/kedro). Kedro-Viz also allows users to view and compare different runs in the Kedro project. - -## Features - -- ✨ Complete visualisation of a Kedro project and its pipelines -- 🎨 Supports light & dark themes out of the box -- 🚀 Scales to big pipelines with hundreds of nodes -- 🔎 Highly interactive, filterable and searchable -- 🔬 Focus mode for modular pipeline visualisation -- 📊 Rich metadata side panel to display parameters, plots, etc. -- 📊 Supports all types of [Plotly charts](https://plotly.com/javascript/) -- ♻️ Autoreload on code change -- 🧪 Supports tracking and comparing runs in a Kedro project -- 🎩 Many more to come - -## Installation - -There are two ways you can use Kedro-Viz: - -- As a [Kedro plugin](https://docs.kedro.org/en/stable/extend_kedro/plugins.html) (the most common way). - - To install Kedro-Viz as a Kedro plugin: - - ```bash - pip install kedro-viz - ``` - -- As a standalone React component (for embedding Kedro-Viz in your web application). - - To install the standalone React component: - - ```bash - npm install @quantumblack/kedro-viz - ``` - -## Usage - -#### Compatibility with Kedro and Kedro-datasets - -Ensure your `Kedro`, `Kedro-Viz` and `Kedro-datasets` versions are supported by referencing the following table: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Python VersionLast Supported
KedroKedro-VizKedro-datasets
3.60.17.74.1.1-
3.70.18.146.7.01.8.0
3.8Latest7.1.01.8.0
>= 3.9LatestLatestLatest
​ - - -### CLI Usage - -To launch Kedro-Viz from the command line as a Kedro plugin, use the following command from the root folder of your Kedro project: - -```bash -kedro viz run -``` - -A browser tab opens automatically to serve the visualisation at `http://127.0.0.1:4141/`. - -Kedro-Viz also supports the following additional arguments on the command line: - -```bash -Usage: kedro viz run [OPTIONS] - - Visualise a Kedro pipeline using Kedro-Viz. - -Options: - --host TEXT Host that viz will listen to. Defaults to - localhost. - - --port INTEGER TCP port that viz will listen to. Defaults to - 4141. - - --browser / --no-browser Whether to open viz interface in the default - browser or not. Browser will only be opened if - host is localhost. Defaults to True. - - --load-file FILE Path to load Kedro-Viz data from a directory - --save-file FILE Path to save Kedro-Viz data to a directory - -p, --pipeline TEXT Name of the registered pipeline to visualise. If not - set, the default pipeline is visualised - - -e, --env TEXT Kedro configuration environment. If not specified, - catalog config in `local` will be used - - --autoreload Autoreload viz server when a Python or YAML file change in - the Kedro project - - --include-hooks A flag to include all registered hooks in your - Kedro Project - - --params TEXT Specify extra parameters that you want to pass to - the context initializer. Items must be separated - by comma, keys - by colon, example: - param1:value1,param2:value2. Each parameter is - split by the first comma, so parameter values are - allowed to contain colons, parameter keys are not. - To pass a nested dictionary as parameter, separate - keys by '.', example: param_group.param1:value1. - - -h, --help Show this message and exit. -``` - -To deploy Kedro-Viz from the command line as a Kedro plugin, use the following command from the root folder of your Kedro project: - -```bash -kedro viz deploy -``` - -```bash -Usage: kedro viz deploy [OPTIONS] - - Deploy and host Kedro Viz on AWS S3. - -Options: - --platform TEXT Supported Cloud Platforms like ('aws', 'azure', 'gcp') - to host Kedro Viz [required] - --endpoint TEXT Static Website hosted endpoint.(eg., For AWS - http://.s3-website..amazonaws.com/) - [required] - --bucket-name TEXT Bucket name where Kedro Viz will be hosted [required] - --include-hooks A flag to include all registered hooks in your Kedro - Project - --include-previews A flag to include preview for all the datasets - -h, --help Show this message and exit. -``` - -To create a build directory of your local Kedro-Viz instance with static data from the command line, use the following command from the root folder of your Kedro project: - -```bash -kedro viz build -``` - -```bash -Usage: kedro viz build [OPTIONS] - - Create build directory of local Kedro Viz instance with Kedro project data - -Options: - --include-hooks A flag to include all registered hooks in your Kedro - Project - --include-previews A flag to include preview for all the datasets - -h, --help Show this message and exit. -``` - -### Experiment Tracking usage - -To enable [experiment tracking](https://docs.kedro.org/en/stable/experiment_tracking/index.html) in Kedro-Viz, you need to add the Kedro-Viz `SQLiteStore` to your Kedro project. - -This can be done by adding the below code to `settings.py` in the `src` folder of your Kedro project. - -```python -from kedro_viz.integrations.kedro.sqlite_store import SQLiteStore -from pathlib import Path -SESSION_STORE_CLASS = SQLiteStore -SESSION_STORE_ARGS = {"path": str(Path(__file__).parents[2] / "data")} -``` - -Once the above set-up is complete, tracking datasets can be used to track relevant data for Kedro runs. More information on how to use tracking datasets can be found in the [experiment tracking documentation](https://docs.kedro.org/en/stable/experiment_tracking/index.html) - -**Notes:** - -- Experiment Tracking is only available for Kedro-Viz >= 4.0.2 and Kedro >= 0.17.5 -- Prior to Kedro 0.17.6, when using tracking datasets, you will have to explicitly mark the datasets as `versioned` for it to show up properly in Kedro-Viz experiment tracking tab. From Kedro >= 0.17.6, this is done automatically: - -```yaml -train_evaluation.r2_score_linear_regression: - type: tracking.MetricsDataset - filepath: ${base_location}/09_tracking/linear_score.json - versioned: true -``` - -### Standalone React component usage - -To use Kedro-Viz as a standalone React component, you can follow the example below. However, please note that Kedro-Viz does not support server-side rendering (SSR). If you're using Next.js or another SSR framework, you should be aware of this limitation. - -```javascript -import KedroViz from '@quantumblack/kedro-viz'; -import '@quantumblack/kedro-viz/lib/styles/styles.min.css'; - -const MyApp = () => ; -``` - -To use with NextJS: - -```javascript -import '@quantumblack/kedro-viz/lib/styles/styles.min.css'; -import dynamic from 'next/dynamic'; - -const NoSSRKedro = dynamic(() => import('@quantumblack/kedro-viz'), { - ssr: false, -}); - -const MyApp = () => ; -``` - -The JSON can be obtained by running: - -```bash -kedro viz run --save-file=filename -``` - -We also recommend wrapping the `Kedro-Viz` component with a parent HTML/JSX element that has a specified height (as seen in the above example) in order for Kedro-Viz to be styled properly. - -**_Our documentation contains [additional examples on how to visualise with Kedro-Viz.](https://docs.kedro.org/en/stable/visualisation/index.html)_** - -## Feature Flags - -Kedro-Viz uses features flags to roll out some experimental features. The following flags are currently in use: - -| Flag | Description | -| ------------------ | --------------------------------------------------------------------------------------- | -| sizewarning | From release v3.9.1. Show a warning before rendering very large graphs (default `true`) | -| expandAllPipelines | From release v4.3.2. Expand all modular pipelines on first load (default `false`) | - -To enable or disable a flag, click on the settings icon in the toolbar and toggle the flag on/off. - -Kedro-Viz also logs a message in your browser's [developer console](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools#The_JavaScript_console) to show the available flags and their values as currently set on your machine. - -## Maintainers - -Kedro-Viz is maintained by the [Kedro team](https://docs.kedro.org/en/stable/contribution/technical_steering_committee.html#kedro-maintainers) and a number of [contributors from across the world](https://github.com/kedro-org/Kedro-Viz/contributors). - -## Contribution - -If you want to contribute to Kedro-Viz, please check out our [contributing guide](./CONTRIBUTING.md). - -## License - -Kedro-Viz is licensed under the [Apache 2.0](https://github.com/kedro-org/kedro-viz/blob/main/LICENSE.md) License. - -## Citation - -If you're an academic, Kedro-Viz can also help you, for example, as a tool to visualise how your publication's pipeline is structured. Find our citation reference on [Zenodo](https://doi.org/10.5281/zenodo.4277218). From 8bad79155d262b76a37ca763c9e41c9938f27993 Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Tue, 9 Jul 2024 17:05:06 -0500 Subject: [PATCH 08/11] adjust Readme file path Signed-off-by: ravi-kumar-pilla --- package/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/pyproject.toml b/package/pyproject.toml index 90f88b35d0..bb8e52fbba 100644 --- a/package/pyproject.toml +++ b/package/pyproject.toml @@ -8,7 +8,7 @@ authors = [ {name = "Kedro"} ] description = "Kedro-Viz helps visualise Kedro data and analytics pipelines" -readme = {file = "../README.md", content-type = "text/markdown"} +readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.9" keywords = [ "pipelines", @@ -24,7 +24,7 @@ dynamic = ["dependencies", "version"] [project.urls] Homepage = "https://kedro.org" Source = "https://github.com/kedro-org/kedro-viz" -Documentation = "https://docs.kedro.org" +Documentation = "https://docs.kedro.org/projects/kedro-viz" Tracker = "https://github.com/kedro-org/kedro-viz/issues" [project.optional-dependencies] From 6811aa14309832f36973f0a6ecec1eda8cb2c9ba Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Tue, 9 Jul 2024 17:15:49 -0500 Subject: [PATCH 09/11] fix docs Signed-off-by: ravi-kumar-pilla --- package/pyproject.toml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/package/pyproject.toml b/package/pyproject.toml index bb8e52fbba..1c4e4ca1f0 100644 --- a/package/pyproject.toml +++ b/package/pyproject.toml @@ -29,11 +29,7 @@ Tracker = "https://github.com/kedro-org/kedro-viz/issues" [project.optional-dependencies] docs = [ - "myst-parser<2.1,>=1.0", - "sphinx-notfound-page", - "sphinx<7.3,>=5.3", - "sphinx_copybutton==0.5.2", - "sphinx_rtd_theme==1.3.0" + "kedro-sphinx-theme==2024.4.0", ] aws = ["s3fs>=2021.4"] azure = ["adlfs>=2021.4"] From d7beadf5dbeb81c1a36eb8062f76e158b7caaa1f Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Tue, 9 Jul 2024 17:41:03 -0500 Subject: [PATCH 10/11] update release note Signed-off-by: ravi-kumar-pilla --- RELEASE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE.md b/RELEASE.md index 6a0c444866..fe8f4679c4 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -22,6 +22,7 @@ Please follow the established format: - Add "-p" flag to kedro-viz to match kedro run. (#1960) - Fix bug related to nested namespace pipelines. (#1897) - Migrate from `toposort` to `graphlib`. (#1942) +- Fix packaging. (#1766) # Release 9.1.0 From 5193c1ffa832352afb6cc945a321f1304f6c3272 Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Wed, 10 Jul 2024 18:41:02 -0500 Subject: [PATCH 11/11] fix flaky e2e test --- cypress/tests/ui/flowchart/menu.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/tests/ui/flowchart/menu.cy.js b/cypress/tests/ui/flowchart/menu.cy.js index 276acd7ef3..dd7eb452c7 100644 --- a/cypress/tests/ui/flowchart/menu.cy.js +++ b/cypress/tests/ui/flowchart/menu.cy.js @@ -53,7 +53,7 @@ describe('Flowchart Menu', () => { it('verifies that users can search/filter for a flowchart component using the search box. #TC-17', () => { const searchInput = 'Ingestion'; - cy.get('.search-input__field').type(searchInput); + cy.get('.search-input__field').type(searchInput, { force: true }); // Pipeline Label in the Menu cy.get('.pipeline-nodelist__row__label')