diff --git a/RELEASE.md b/RELEASE.md index 9068a6cb2b..3fe5a10a3d 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -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 diff --git a/docs/source/cli-docs.md b/docs/source/cli-docs.md index d4cf784317..72ea1b8af8 100644 --- a/docs/source/cli-docs.md +++ b/docs/source/cli-docs.md @@ -64,6 +64,9 @@ kedro viz run [OPTIONS] - `--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. diff --git a/docs/source/kedro-viz_visualisation.md b/docs/source/kedro-viz_visualisation.md index dd3baa76ec..83bb473709 100644 --- a/docs/source/kedro-viz_visualisation.md +++ b/docs/source/kedro-viz_visualisation.md @@ -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: diff --git a/package/README.md b/package/README.md index bd4d1764ce..cd8998d2e9 100644 --- a/package/README.md +++ b/package/README.md @@ -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. ``` diff --git a/package/kedro_viz/integrations/kedro/data_loader.py b/package/kedro_viz/integrations/kedro/data_loader.py index ce8e5be48f..2bfa405076 100644 --- a/package/kedro_viz/integrations/kedro/data_loader.py +++ b/package/kedro_viz/integrations/kedro/data_loader.py @@ -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()), ) diff --git a/package/kedro_viz/launchers/cli/run.py b/package/kedro_viz/launchers/cli/run.py index 87b2722330..9988214261 100644 --- a/package/kedro_viz/launchers/cli/run.py +++ b/package/kedro_viz/launchers/cli/run.py @@ -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( diff --git a/src/actions/pipelines.js b/src/actions/pipelines.js index c93598227a..05a9c23539 100644 --- a/src/actions/pipelines.js +++ b/src/actions/pipelines.js @@ -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'; /** diff --git a/src/reducers/index.js b/src/reducers/index.js index 914e45c65b..eedf86d3aa 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -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'; @@ -123,8 +123,7 @@ const combinedReducer = combineReducers({ true, TOGGLE_SHOW_DATASET_PREVIEWS, 'showDatasetPreviews' -), - + ), }); const rootReducer = (state, action) => {