Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: slicing pipeline in kedro-viz #2043

Merged
merged 18 commits into from
Sep 5, 2024
Binary file added docs/source/images/slice_pipeline_full_view.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ Take a look at the <a href="https://demo.kedro.org/" target="_blank" rel="noopen
kedro-viz_visualisation
share_kedro_viz
preview_datasets
slice_a_pipeline
experiment_tracking
```
32 changes: 32 additions & 0 deletions docs/source/slice_a_pipeline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Slice a pipeline

Slicing a pipeline refers to creating a subset of a pipeline's nodes, which can help in focusing on specific parts of the pipeline. There are two primary ways to achieve this in Kedro:
Huongg marked this conversation as resolved.
Show resolved Hide resolved

1. **Programmatically with the Kedro CLI.** This method is ideal for those comfortable with command-line tools. Detailed steps on how to achieve this are available in the kedro documentation: [Slice a Pipeline](https://docs.kedro.org/en/0.19.5/nodes_and_pipelines/slice_a_pipeline.html).
Huongg marked this conversation as resolved.
Show resolved Hide resolved

2. **Visually through Kedro-Viz:** This approach allows you to visually choose and slice pipeline nodes, which then generates a run command for executing the slice within your Kedro project.
Huongg marked this conversation as resolved.
Show resolved Hide resolved

## Benefits of Kedro-Viz slicing

- **Visual Representation:** View the relationships between nodes and identify which ones are part of your slice.
- **Immediate Command Generation:** Get a ready-to-use CLI command for executing the sliced pipeline.
- **Interactive Control:** Visually select and reset slices with a couple of clicks.

## Steps to slice in Kedro-Viz

Kedro-Viz offers a user-friendly visual interface for slicing pipelines. Follow these steps to use the slicing feature:

1. **Select elements in the flowchart:** In Kedro-Viz, choose two elements to set the boundaries for your slice:
Huongg marked this conversation as resolved.
Show resolved Hide resolved
- Click on the first node you want to include.
- Hold the Shift key and select the second node.

![](./images/slice_pipeline_full_view.gif)
Huongg marked this conversation as resolved.
Show resolved Hide resolved


2. **Highlighted selection:** The flowchart will highlight all nodes between the selected elements, and the corresponding nodes in the list on the left will also be highlighted.

3. **View the run command:** After selecting the nodes, Kedro-Viz generates a CLI command for the sliced pipeline. You can copy this command and use it directly in your Kedro project to run the slice.

4. **Slice the pipeline:** When you're ready, click the "Slice" button. This opens a new view where you can directly interact with the sliced pipeline.
Huongg marked this conversation as resolved.
Show resolved Hide resolved

5. **Reset:** To discard your selection and return to the full pipeline view, click the "Reset" button. This will clear the slice and restore the default view.
Loading