Skip to content

Commit

Permalink
Documentation for Kedro Viz Lite (#2077)
Browse files Browse the repository at this point in the history
* sync remote

* docs for viz lite initial draft

* fix file permission

* update release note

* address PR comments

* fix permissions

* address PR comments
  • Loading branch information
ravi-kumar-pilla authored Sep 17, 2024
1 parent 807bab2 commit 28a2fd0
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 9 deletions.
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Please follow the established format:
## Major features and improvements

- Introduce `onActionCallback` prop in Kedro-Viz react component. (#2022)
- Introduce `kedro viz --lite`, which allows users to run Kedro-Viz without installing Kedro project dependencies. (#1966, #2077)
- Slice a pipeline functionality. (#2036)

## Bug fixes and other changes
Expand Down
3 changes: 3 additions & 0 deletions docs/source/cli-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ kedro viz run [OPTIONS]
- `--params <params>`
- Specify extra parameters for the Kedro Viz run. This option supports the same format as the `params` option in the Kedro CLI.

- `--lite`
- An experimental flag to open Kedro-Viz without Kedro project dependencies.


```{note}
When running Kedro Viz locally with the `--autoreload` option, the server will automatically restart whenever there are changes to Python, YAML, or JSON files in the Kedro project. This is particularly useful during development.
Expand Down
16 changes: 16 additions & 0 deletions docs/source/kedro-viz_visualisation.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,22 @@ If a visualisation panel opens up and a pipeline is not visible, refresh the vie

To exit the visualisation, close the browser tab. To regain control of the terminal, enter `^+c` on Mac or `Ctrl+c` on Windows or Linux machines.

## Visualise a Kedro project without installing project dependencies

You can use the experimental `--lite` flag to visualise your pipelines without installing Kedro project dependencies. Add the flag to the command you use to start Kedro-Viz:

```bash
kedro viz run --lite
```
> [!Important]
> Since this is an experimental feature, Kedro-Viz will run with limited functionality and you should see a warning message in your terminal informing you about any missing dependencies.
Some of the known limitations while using `--lite` flag:

* If the datasets are not resolved, they will be defaulted to a custom dataset `UnavailableDataset`.
* The flowchart will not show the layers information for the datasets.
* Experiment Tracking will not work if the pre-requisite of having kedro-datasets version 2.1.0 and above is not met.

## Automatic visualisation updates

You can use the `--autoreload` flag to autoreload Kedro-Viz when a `Python` or `YAML` file changes in the project. Add the flag to the command you use to start Kedro-Viz:
Expand Down
3 changes: 3 additions & 0 deletions package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ Options:
To pass a nested dictionary as parameter, separate
keys by '.', example: param_group.param1:value1.
--lite An experimental flag to open Kedro-Viz without Kedro
project dependencies.
-h, --help Show this message and exit.
```
Expand Down
8 changes: 4 additions & 4 deletions package/kedro_viz/integrations/kedro/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ def load_data(
sys_modules_patch.update(mocked_modules)

logger.warning(
"Kedro-Viz has mocked the following dependencies for lite-mode.\n"
"%s \n"
"In order to get a complete experience of Viz, "
"please install the missing Kedro project dependencies\n",
"Kedro-Viz is running with limited functionality. "
"For the best experience with full functionality, please\n"
"install the missing Kedro project dependencies:\n"
"%s \n",
list(mocked_modules.keys()),
)

Expand Down
2 changes: 1 addition & 1 deletion package/kedro_viz/launchers/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
@click.option(
"--lite",
is_flag=True,
help="A flag to load an experimental light-weight Kedro Viz",
help="An experimental flag to open Kedro-Viz without Kedro project dependencies",
)
# pylint: disable=import-outside-toplevel, too-many-locals
def run(
Expand Down
5 changes: 4 additions & 1 deletion src/actions/pipelines.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { getUrl } from '../utils';
import loadJsonData from '../store/load-data';
import {parseUrlParameters, preparePipelineState} from '../store/initial-state';
import {
parseUrlParameters,
preparePipelineState,
} from '../store/initial-state';
import { resetData } from './index';

/**
Expand Down
5 changes: 2 additions & 3 deletions src/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
UPDATE_ZOOM,
TOGGLE_EXPAND_ALL_PIPELINES,
UPDATE_STATE_FROM_OPTIONS,
TOGGLE_SHOW_DATASET_PREVIEWS
TOGGLE_SHOW_DATASET_PREVIEWS,
} from '../actions';
import { TOGGLE_PARAMETERS_HOVERED } from '../actions';

Expand Down Expand Up @@ -123,8 +123,7 @@ const combinedReducer = combineReducers({
true,
TOGGLE_SHOW_DATASET_PREVIEWS,
'showDatasetPreviews'
),

),
});

const rootReducer = (state, action) => {
Expand Down

0 comments on commit 28a2fd0

Please sign in to comment.