9.0.0 โ€ข Published 11 days ago

@quantumblack/kedro-viz v9.0.0

Weekly downloads
634
License
-
Repository
github
Last release
11 days ago

Kedro-Viz

Kedro-Viz Pipeline Visualisation

CircleCI Documentation Python Version PyPI version Downloads npm version License code style: prettier Slack Organisation

Introduction

Kedro-Viz is an interactive development tool for building data science pipelines with 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
  • โ™ป๏ธ 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 (the most common way).

    To install Kedro-Viz as a Kedro plugin:

    pip install kedro-viz
  • As a standalone React component (for embedding Kedro-Viz in your web application).

    To install the standalone React component:

    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:

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:

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:

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

  --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:

kedro viz deploy
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://<b
                      ucket_name>.s3-website.<region_name>.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
  -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:

kedro viz build
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
  -h, --help       Show this message and exit.

Experiment Tracking usage

To enable experiment tracking 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.

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

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:
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.

import KedroViz from '@quantumblack/kedro-viz';
import '@quantumblack/kedro-viz/lib/styles/styles.min.css';

const MyApp = () => <KedroViz data={json} />;

To use with NextJS:

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 = () => <NoSSRKedro data={json} />;

The JSON can be obtained by running:

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.

Feature Flags

Kedro-Viz uses features flags to roll out some experimental features. The following flags are currently in use:

FlagDescription
sizewarningFrom release v3.9.1. Show a warning before rendering very large graphs (default true)
expandAllPipelinesFrom 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 to show the available flags and their values as currently set on your machine.

Maintainers

Kedro-Viz is maintained by the Kedro team and a number of contributors from across the world.

Contribution

If you want to contribute to Kedro-Viz, please check out our contributing guide.

License

Kedro-Viz is licensed under the Apache 2.0 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.

9.0.0

11 days ago

8.0.1

2 months ago

8.0.0

2 months ago

7.1.0

3 months ago

7.0.0

4 months ago

6.5.1-alpha.1

8 months ago

6.5.1-alpha.2

8 months ago

6.5.1-alpha.3

8 months ago

6.5.0

8 months ago

6.3.2

10 months ago

6.4.1-alpha.1

8 months ago

6.6.1

6 months ago

6.6.0

7 months ago

6.5.0-alpha.7

8 months ago

6.5.0-alpha.6

8 months ago

6.5.0-alpha.1

8 months ago

6.5.0-alpha.3

8 months ago

6.5.0-alpha.2

8 months ago

6.5.0-alpha.5

8 months ago

6.5.0-alpha.4

8 months ago

6.4.0

8 months ago

6.7.0

5 months ago

6.3.4

9 months ago

6.3.3

10 months ago

6.3.1

10 months ago

6.3.0

11 months ago

6.1.1

12 months ago

6.2.0

11 months ago

6.1.0

1 year ago

6.0.1

1 year ago

6.0.0

1 year ago

5.3.0

1 year ago

5.2.1

1 year ago

5.2.0

1 year ago

5.1.1

2 years ago

5.1.0

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.7.2

2 years ago

4.7.1

2 years ago

4.5.0

2 years ago

4.7.0

2 years ago

4.6.0

2 years ago

4.4.0

2 years ago

4.3.1

2 years ago

4.3.0

2 years ago

4.1.0

2 years ago

4.2.0

2 years ago

4.1.1

2 years ago

4.0.1

2 years ago

4.0.0

3 years ago

3.17.1

3 years ago

3.17.0

3 years ago

3.16.0

3 years ago

3.15.0

3 years ago

3.14.0

3 years ago

3.13.1

3 years ago

3.13.0

3 years ago

3.12.1

3 years ago

3.12.0

3 years ago

3.11.0

3 years ago

3.10.1

3 years ago

3.10.0

3 years ago

3.9.0

3 years ago

3.8.1

3 years ago

3.8.0

3 years ago

3.7.0

3 years ago

3.6.0

4 years ago

3.5.1

4 years ago

3.5.0

4 years ago

3.4.0

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.2.0

4 years ago

3.1.0

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago