From 69caab407ee88a00579fd2fc684fb38f9dc50481 Mon Sep 17 00:00:00 2001 From: Jitendra Gundaniya <38945204+jitu5@users.noreply.github.com> Date: Thu, 10 Oct 2024 11:48:37 +0100 Subject: [PATCH] Improve `kedro viz build` usage documentation (#2126) * Updated build related docs Signed-off-by: Jitendra Gundaniya * Release note added Signed-off-by: Jitendra Gundaniya * Update docs/source/platform_agnostic_sharing_with_kedro_viz.md Co-authored-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> Signed-off-by: Jitendra Gundaniya <38945204+jitu5@users.noreply.github.com> * review suggestion. Signed-off-by: Jitendra Gundaniya --------- Signed-off-by: Jitendra Gundaniya Signed-off-by: Jitendra Gundaniya <38945204+jitu5@users.noreply.github.com> Co-authored-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> --- RELEASE.md | 2 ++ ...latform_agnostic_sharing_with_kedro_viz.md | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/RELEASE.md b/RELEASE.md index b93010273a..e68596830b 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -14,8 +14,10 @@ Please follow the established format: ## Bug fixes and other changes +- Improve `kedro viz build` usage documentation (#2126) - Fix unserializable parameters value (#2122) + # Release 10.0.0 ## Major features and improvements diff --git a/docs/source/platform_agnostic_sharing_with_kedro_viz.md b/docs/source/platform_agnostic_sharing_with_kedro_viz.md index 228e875d42..a08c1adac4 100644 --- a/docs/source/platform_agnostic_sharing_with_kedro_viz.md +++ b/docs/source/platform_agnostic_sharing_with_kedro_viz.md @@ -46,6 +46,34 @@ Starting from Kedro-Viz 9.2.0, `kedro viz build` will not include dataset previe This creates a `build` folder containing your Kedro-Viz app package in your project directory. +## Running Kedro-Viz Locally + +When you generate the build folder using the command `kedro viz build`, it creates a build directory with an `index.html` file, which serves as the entry point for visualizing your pipeline. + + +To view your pipeline visualization correctly, you need to serve `index.html` using an HTTP server. Here are a few simple ways to do this: + +1. Python's Built-in HTTP Server: + - Navigate to the build directory and run: + ```bash + python -m http.server + ``` + - This starts a web server at `http://localhost:8000`, which you can use to view index.html. + +2. Node's http-server: + - First, install it globally: + ```bash + npm install -g http-server + ``` + - Then, run it from the build directory: + ```bash + http-server + ``` + +```{warning} +Simply opening `index.html` using the `file://` protocol is not supported due to Cross-Origin Resource Sharing (CORS) policies in modern browsers. +``` + ## Static website hosting platforms such as GitHub Pages Follow the steps [listed in the GitHub pages documentation](https://docs.github.com/en/pages/quickstart) to create a Git repository that supports GitHub Pages. On completion, push the contents of the previously created `build` folder to this new repository. Your site will be available at the following URL: `http://.github.io`