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

For Test and Review: React component work all merged in single PR. #1992

Merged
merged 88 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
bae3962
Kedro viz as react component documentation
jitu5 Jun 21, 2024
b04bfed
Viz doc added
jitu5 Jun 21, 2024
6444897
Standalone Example Repository section added
jitu5 Jun 23, 2024
ac80476
save file details added
jitu5 Jun 24, 2024
badef39
Merge branch 'main' into doc/react-component
jitu5 Jun 24, 2024
3f320de
Section rearrangement
jitu5 Jun 24, 2024
a935cc1
README.md file path is changed for PyPI
jitu5 Jun 24, 2024
f5e4ab4
Restoring existing README.md to root
jitu5 Jun 28, 2024
0fba958
Merge branch 'main' into doc/react-component
jitu5 Jun 28, 2024
5182b31
works
rashidakanchwala Jun 28, 2024
b3b8354
sidebar display
rashidakanchwala Jun 28, 2024
e49ebc6
Code review suggestion
jitu5 Jul 1, 2024
083d5a6
preview removed
jitu5 Jul 1, 2024
cbdd0cc
metadataPanel prop added
jitu5 Jul 1, 2024
e8710d7
test fix
jitu5 Jul 1, 2024
0a847ee
Release note added
jitu5 Jul 1, 2024
3300cd2
Update RELEASE.md
jitu5 Jul 1, 2024
b41ee0b
toggleNodeClick added back
jitu5 Jul 2, 2024
1bbe9c5
Parent div element as wrapper added
jitu5 Jul 2, 2024
d8d75ae
Merge branch 'main' into doc/react-component
jitu5 Jul 2, 2024
f3d2cd8
Update README.md
jitu5 Jul 2, 2024
2215cc1
Update README.npm.md
jitu5 Jul 2, 2024
5ec32dc
Generic actions for a redux state update
jitu5 Jul 3, 2024
8ed9b3b
Refactor code
jitu5 Jul 4, 2024
339f32a
Alignment fix
jitu5 Jul 4, 2024
dc86138
Test fix
jitu5 Jul 5, 2024
34b8b63
test fix
jitu5 Jul 5, 2024
f5e7952
test fix
jitu5 Jul 5, 2024
ffdc857
Merge branch 'main' into react-component-props
jitu5 Jul 5, 2024
e1989de
Update src/actions/index.js
jitu5 Jul 5, 2024
a1e6e13
Variable renaming
jitu5 Jul 5, 2024
c85ca56
Updating url on node click
jitu5 Jul 8, 2024
a6508ff
Merge branch 'main' into feature/metadata-component
jitu5 Jul 8, 2024
689d28c
updated readme for npm
jitu5 Jul 9, 2024
88b516e
Annotation image updated with metadataPanel
jitu5 Jul 9, 2024
18b1c1d
Annotation image url updated in npm readme.
jitu5 Jul 9, 2024
5701450
Missing react import added
jitu5 Jul 9, 2024
e4607cf
Merge branch 'main' into react-component-props
jitu5 Jul 9, 2024
4b02d24
props replace by options
jitu5 Jul 9, 2024
36b10f1
Props replaced by options
jitu5 Jul 9, 2024
b618de2
Merge branch 'main' into doc/react-component
jitu5 Jul 9, 2024
690f1fc
Release note added
jitu5 Jul 9, 2024
e940b21
Release note added
jitu5 Jul 9, 2024
d8b9043
Code review suggestions
jitu5 Jul 10, 2024
7764e5f
Merge branch 'main' into doc/react-component
jitu5 Jul 10, 2024
691f5da
Merge branch 'main' into react-component-props
jitu5 Jul 10, 2024
ab8798e
Rebuild
jitu5 Jul 10, 2024
7d95668
Fix doc build error
jitu5 Jul 10, 2024
2fe1029
comment removed
jitu5 Jul 10, 2024
e9f45bd
code block type changed to jsx
jitu5 Jul 10, 2024
718eee5
Release note updated
jitu5 Jul 10, 2024
4ee4ccc
Code review suggestion added
jitu5 Jul 10, 2024
bd56a02
Stateful url updates on props change
jitu5 Jul 15, 2024
18e6b1d
annotation image update
jitu5 Jul 15, 2024
a5c34fd
UPDATE_STATE_FROM_OPTIONS test added
jitu5 Jul 16, 2024
9ba7058
Minimap prop refactor
jitu5 Jul 16, 2024
0446855
Props updated
jitu5 Jul 17, 2024
f0a3645
kedro viz annotation updates
jitu5 Jul 17, 2024
2f602cd
propTypes added
jitu5 Jul 17, 2024
c819182
pipelineBtn renamed to expandPipelinesBtn
jitu5 Jul 18, 2024
47b7414
Moving zoomToolbar into display
jitu5 Jul 18, 2024
c41d1d8
Merge branch 'main' into feature/minimap-prop
jitu5 Jul 18, 2024
3c8fbb6
Refactor
jitu5 Jul 18, 2024
276b3d3
Fix
jitu5 Jul 18, 2024
f5cc703
globalToolbar renamed to globalNavigation
jitu5 Jul 18, 2024
ab7abc4
Test fix
jitu5 Jul 18, 2024
52c7137
Docs updated as pre new refactor work
jitu5 Jul 18, 2024
8a45d32
annotation image updated
jitu5 Jul 18, 2024
ef5309d
Test fix
jitu5 Jul 19, 2024
28a294d
Merge branch 'main' into feature/metadata-component
jitu5 Jul 19, 2024
f37560e
Merge branch 'main' into doc/react-component
jitu5 Jul 19, 2024
83bd6f8
README.md conflict resolved
jitu5 Jul 19, 2024
b8bb951
Doc copy changes.
jitu5 Jul 19, 2024
774b8c8
Merge branch 'feature/minimap-prop-refactor' into react-component-props
jitu5 Jul 19, 2024
fa94db3
Merge branch 'feature/minimap-prop' into react-component-props
jitu5 Jul 19, 2024
2ede490
Merge branch 'feature/metadata-component' into react-component-props
jitu5 Jul 19, 2024
a7bf3f4
Merge branch 'doc/react-component' into react-component-props
jitu5 Jul 19, 2024
0f9ae5f
Fix build fail
jitu5 Jul 19, 2024
6c52d9f
Merge branch 'feature/minimap-prop-refactor' into all-react-branchs
jitu5 Jul 19, 2024
1d2028f
Code review fix
jitu5 Jul 19, 2024
34ec742
Test fix
jitu5 Jul 19, 2024
022372b
Merge branch 'feature/minimap-prop-refactor' into all-react-branchs
jitu5 Jul 19, 2024
893afd0
Code review fix
jitu5 Jul 19, 2024
e644af4
Merge branch 'feature/minimap-prop-refactor' into all-react-branchs
jitu5 Jul 19, 2024
38f5258
Code review fix
jitu5 Jul 19, 2024
939e78d
Rearrange props in alphabetical order
jitu5 Jul 22, 2024
531d0f0
Merge branch 'doc/react-component' into all-react-branchs
jitu5 Jul 22, 2024
f1e7dbe
file rename
jitu5 Jul 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/img/kedro_viz_annotation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
run: |-
node -v
make build

# Renaming README.npm.md to README.md just for npm
- name: Use NPM specific README
run: mv README.npm.md README.md

- name: Publish to npm
run: npm publish
Expand Down
218 changes: 218 additions & 0 deletions README.npm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
# Kedro-Viz

<br />
<p align="center">

![Kedro-Viz Pipeline Visualisation](https://raw.githubusercontent.com/kedro-org/kedro-viz/main/.github/img/banner.png)

</p>

<p align="center">
✨ <em> Data Science Pipelines. Beautifully Designed</em> ✨

Check warning on line 11 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L11

[Kedro-viz.weaselwords] 'Beautifully' is a weasel word!
Raw output
{"message": "[Kedro-viz.weaselwords] 'Beautifully' is a weasel word!", "location": {"path": "README.npm.md", "range": {"start": {"line": 11, "column": 32}}}, "severity": "WARNING"}
<br />
Live Demo: <a href="https://demo.kedro.org/" target="_blank">https://demo.kedro.org/</a>
</p>

<br />

[![CircleCI](https://circleci.com/gh/kedro-org/kedro-viz/tree/main.svg?style=shield)](https://circleci.com/gh/kedro-org/kedro-viz/tree/main)
[![Documentation](https://readthedocs.org/projects/kedro/badge/?version=stable)](https://docs.kedro.org/en/stable/visualisation/)
[![Python Version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11-orange.svg)](https://pypi.org/project/kedro-viz/)
[![PyPI version](https://img.shields.io/pypi/v/kedro-viz.svg?color=yellow)](https://pypi.org/project/kedro-viz/)
[![Downloads](https://static.pepy.tech/badge/kedro-viz/week)](https://pepy.tech/project/kedro-viz)
[![npm version](https://img.shields.io/npm/v/@quantumblack/kedro-viz.svg?color=cc3534)](https://badge.fury.io/js/%40quantumblack%2Fkedro-viz)

Check warning on line 23 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L23

[Kedro-viz.Spellings] Did you really mean 'npm'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'npm'?", "location": {"path": "README.npm.md", "range": {"start": {"line": 23, "column": 4}}}, "severity": "WARNING"}
[![License](https://img.shields.io/badge/license-Apache%202.0-3da639.svg)](https://opensource.org/licenses/Apache-2.0)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Slack Organisation](https://img.shields.io/badge/slack-chat-blueviolet.svg?label=Kedro%20Slack&logo=slack)](https://slack.kedro.org)

## Introduction

Kedro-Viz is an interactive development tool for building data science pipelines with [Kedro](https://github.com/kedro-org/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, and more.
- 📊 Supports all types of [Plotly charts](https://plotly.com/javascript/)
- ♻️ Autoreload on code change

Check warning on line 41 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L41

[Kedro-viz.Spellings] Did you really mean 'Autoreload'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'Autoreload'?", "location": {"path": "README.npm.md", "range": {"start": {"line": 41, "column": 6}}}, "severity": "WARNING"}
- 🧪 Supports tracking and comparing runs in a Kedro project
- 🎩 Many more to come

Check warning on line 43 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L43

[Kedro-viz.weaselwords] 'Many' is a weasel word!
Raw output
{"message": "[Kedro-viz.weaselwords] 'Many' is a weasel word!", "location": {"path": "README.npm.md", "range": {"start": {"line": 43, "column": 5}}}, "severity": "WARNING"}

## Installation

- As a standalone React component (for embedding Kedro-Viz in your web application).

To install the standalone React component:

```bash
npm install @quantumblack/kedro-viz
```

## Usage

To use Kedro-Viz as a standalone React component, you can follow the example below. Please note that Kedro-Viz does not support server-side rendering (SSR). If you are using Next.js or another SSR framework, you should be aware of this limitation.

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

const MyApp = () => (
<div style={{height: `100vh`}}>
<KedroViz
data={json}
options={/* Options to configure Kedro Viz */}
/>
</div>
);
```

To use with NextJS:

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

```bash
kedro viz run --save-file=<path-to-save-kedro-viz-data-to-a-directory>
```

On successful execution of the command above, it will generate a folder at the specified directory, containing the following structure:

```
<filename>/api/
├── main
├── nodes
│ ├── 23c94afb
│ ├── 28754fab
│ ├── 2ab3579f
│ ├── 329e963c
│ ├── 369acf98
│ └── ...
└── pipelines
├── __default__
├── data_processing
├── data_science
└── ...
```

Use the `main` file as the input JSON for the `data` prop in your Kedro-Viz component.

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.

Check notice on line 113 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L113

[Kedro-viz.sentencelength] Try to keep your sentence length to 30 words or fewer.
Raw output
{"message": "[Kedro-viz.sentencelength] Try to keep your sentence length to 30 words or fewer.", "location": {"path": "README.npm.md", "range": {"start": {"line": 113, "column": 1}}}, "severity": "INFO"}

**_Our documentation contains [additional examples on how to visualise with Kedro-Viz.](https://docs.kedro.org/en/stable/visualisation/index.html)_**

## Configure Kedro-viz with `options`

The example below demonstrates how to configure your kedro-viz using different `options`.

```
<KedroViz
data={json}
options={{
display: {
expandPipelinesBtn: true,
exportBtn: true,
globalNavigation: true,
labelBtn: true,
layerBtn: true,
metadataPanel: true,
miniMap: true,
sidebar: true,
zoomToolbar: true,
},
expandAllPipelines: false,
nodeType: {
disabled: {parameters: true}
},
tag: {
enabled: {companies: true}
},
theme: "dark"
}}
/>

```

| Name | Type | Default | Description |
| ------------ | ------- | ------- | ----------- |
| `data` | `{ edges: array (required), layers: array, nodes: array (required), tags: array }` | - | Pipeline data to be displayed on the chart |
| options.display | | | |
| `expandPipelinesBtn` | boolean | true | Show/Hide expand pipelines button |

Check warning on line 153 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L153

[Kedro-viz.Spellings] Did you really mean 'boolean'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'boolean'?", "location": {"path": "README.npm.md", "range": {"start": {"line": 153, "column": 26}}}, "severity": "WARNING"}
| `exportBtn` | boolean | true | Show/Hide export button |

Check warning on line 154 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L154

[Kedro-viz.Spellings] Did you really mean 'boolean'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'boolean'?", "location": {"path": "README.npm.md", "range": {"start": {"line": 154, "column": 17}}}, "severity": "WARNING"}
| `globalNavigation` | boolean | true | Show/Hide global navigation |

Check warning on line 155 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L155

[Kedro-viz.Spellings] Did you really mean 'boolean'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'boolean'?", "location": {"path": "README.npm.md", "range": {"start": {"line": 155, "column": 24}}}, "severity": "WARNING"}
| `labelBtn` | boolean | true | Show/Hide label button |

Check warning on line 156 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L156

[Kedro-viz.Spellings] Did you really mean 'boolean'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'boolean'?", "location": {"path": "README.npm.md", "range": {"start": {"line": 156, "column": 16}}}, "severity": "WARNING"}
| `layerBtn` | boolean | true | Show/Hide layer button |

Check warning on line 157 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L157

[Kedro-viz.Spellings] Did you really mean 'boolean'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'boolean'?", "location": {"path": "README.npm.md", "range": {"start": {"line": 157, "column": 16}}}, "severity": "WARNING"}
| `metadataPanel` | boolean | true | Show/Hide Metadata Panel |

Check warning on line 158 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L158

[Kedro-viz.Spellings] Did you really mean 'boolean'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'boolean'?", "location": {"path": "README.npm.md", "range": {"start": {"line": 158, "column": 21}}}, "severity": "WARNING"}
| `miniMap` | boolean | true | Show/Hide Mini map and mini map button |

Check warning on line 159 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L159

[Kedro-viz.Spellings] Did you really mean 'boolean'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'boolean'?", "location": {"path": "README.npm.md", "range": {"start": {"line": 159, "column": 15}}}, "severity": "WARNING"}
| `sidebar` | boolean | true | Show/Hide Sidebar and action toolbar |

Check warning on line 160 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L160

[Kedro-viz.Spellings] Did you really mean 'boolean'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'boolean'?", "location": {"path": "README.npm.md", "range": {"start": {"line": 160, "column": 15}}}, "severity": "WARNING"}
| `zoomToolbar` | boolean | true | Show/Hide zoom-in, zoom-out and zoom reset buttons together |

Check warning on line 161 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L161

[Kedro-viz.Spellings] Did you really mean 'boolean'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'boolean'?", "location": {"path": "README.npm.md", "range": {"start": {"line": 161, "column": 19}}}, "severity": "WARNING"}
| options.expandAllPipelines | boolean | false | Expand/Collapse Modular pipelines on first load |

Check warning on line 162 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L162

[Kedro-viz.Spellings] Did you really mean 'boolean'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'boolean'?", "location": {"path": "README.npm.md", "range": {"start": {"line": 162, "column": 32}}}, "severity": "WARNING"}
| options.nodeType | `{disabled: {parameters: boolean,task: boolean,data: boolean}}` | `{disabled: {parameters: true,task: false,data: false}}` | Configuration for node type options |
| options.tag | `{enabled: {<tagName>: boolean}}` | - | Configuration for tag options |
| options.theme | string | dark | select `Kedro-Viz` theme : dark/light |


### Note
When `display.sidebar` is `false`, `display.miniMap` prop will be ignored.

All components are annotated to understand their positions in the Kedro-Viz UI.

![Kedro-Viz component annotation](https://raw.githubusercontent.com/kedro-org/kedro-viz/main/.github/img/kedro_viz_annotation.png)


## Standalone Example Repository

Check warning on line 176 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L176

[Kedro-viz.headings] 'Standalone Example Repository' should use sentence-style capitalization.
Raw output
{"message": "[Kedro-viz.headings] 'Standalone Example Repository' should use sentence-style capitalization.", "location": {"path": "README.npm.md", "range": {"start": {"line": 176, "column": 4}}}, "severity": "WARNING"}

We have created a [kedro-viz-standalone](https://github.com/kedro-org/kedro-viz-standalone.git) repository to demonstrate how to use Kedro-Viz in standalone mode or embedded in a React application.

Check warning on line 178 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L178

[Kedro-viz.toowordy] 'demonstrate' is too wordy
Raw output
{"message": "[Kedro-viz.toowordy] 'demonstrate' is too wordy", "location": {"path": "README.npm.md", "range": {"start": {"line": 178, "column": 111}}}, "severity": "WARNING"}

This repository provides a fully functional example of Kedro-Viz, showcasing how to integrate it into your projects. The example includes setup instructions and demonstrates various features of Kedro-Viz.

To get started, clone the repository, install the dependencies and run the example React application:

```
git clone https://github.com/kedro-org/kedro-viz-standalone.git
cd kedro-viz-standalone
npm install
npm start
```

## Feature Flags

Check warning on line 191 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L191

[Kedro-viz.headings] 'Feature Flags' should use sentence-style capitalization.
Raw output
{"message": "[Kedro-viz.headings] 'Feature Flags' should use sentence-style capitalization.", "location": {"path": "README.npm.md", "range": {"start": {"line": 191, "column": 4}}}, "severity": "WARNING"}

Kedro-Viz uses feature flags to roll out some experimental features. We have the following flags -

| Flag | Description |
| ------------------ | --------------------------------------------------------------------------------------- |
| sizewarning | From release v3.9.1. Show a warning before rendering very large graphs (default `true`) |

Check warning on line 197 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L197

[Kedro-viz.Spellings] Did you really mean 'sizewarning'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'sizewarning'?", "location": {"path": "README.npm.md", "range": {"start": {"line": 197, "column": 3}}}, "severity": "WARNING"}

Check warning on line 197 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L197

[Kedro-viz.weaselwords] 'very' is a weasel word!
Raw output
{"message": "[Kedro-viz.weaselwords] 'very' is a weasel word!", "location": {"path": "README.npm.md", "range": {"start": {"line": 197, "column": 77}}}, "severity": "WARNING"}

Check warning on line 197 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L197

[Kedro-viz.words] Use '' instead of 'very'.
Raw output
{"message": "[Kedro-viz.words] Use '' instead of 'very'.", "location": {"path": "README.npm.md", "range": {"start": {"line": 197, "column": 77}}}, "severity": "WARNING"}
| expandAllPipelines | From 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](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools#The_JavaScript_console) to show the available flags and their values as currently set on your machine.

Check warning on line 202 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L202

[Kedro-viz.weaselwords] 'currently' is a weasel word!
Raw output
{"message": "[Kedro-viz.weaselwords] 'currently' is a weasel word!", "location": {"path": "README.npm.md", "range": {"start": {"line": 202, "column": 238}}}, "severity": "WARNING"}

## Maintainers

Kedro-Viz is maintained by the [Kedro team](https://docs.kedro.org/en/stable/contribution/technical_steering_committee.html#kedro-maintainers) and a number of [contributors from across the world](https://github.com/kedro-org/Kedro-Viz/contributors).

Check warning on line 206 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L206

[Kedro-viz.words] Use 'few', 'several', or 'many' instead of 'a number of'.
Raw output
{"message": "[Kedro-viz.words] Use 'few', 'several', or 'many' instead of 'a number of'.", "location": {"path": "README.npm.md", "range": {"start": {"line": 206, "column": 148}}}, "severity": "WARNING"}

Check warning on line 206 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L206

[Kedro-viz.toowordy] 'a number of' is too wordy
Raw output
{"message": "[Kedro-viz.toowordy] 'a number of' is too wordy", "location": {"path": "README.npm.md", "range": {"start": {"line": 206, "column": 148}}}, "severity": "WARNING"}

## Contribution

If you want to contribute to Kedro-Viz, please check out our [contributing guide](./CONTRIBUTING.md).

Check warning on line 210 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L210

[Kedro-viz.words] Use '' instead of 'please'.
Raw output
{"message": "[Kedro-viz.words] Use '' instead of 'please'.", "location": {"path": "README.npm.md", "range": {"start": {"line": 210, "column": 41}}}, "severity": "WARNING"}

## License

Kedro-Viz is licensed under the [Apache 2.0](https://github.com/kedro-org/kedro-viz/blob/main/LICENSE.md) 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](https://doi.org/10.5281/zenodo.4277218).

Check warning on line 218 in README.npm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.npm.md#L218

[Kedro-viz.Spellings] Did you really mean 'Zenodo'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'Zenodo'?", "location": {"path": "README.npm.md", "range": {"start": {"line": 218, "column": 168}}}, "severity": "WARNING"}
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ Please follow the established format:
- Enable/disable preview for all the datasets when publishing Kedro-Viz from UI. (#1895)
- Display published URLs. (#1907)
- Conditionally move session store and stats file to .viz directory. (#1915)
- Introduce `metadataPanel` in `display` prop in Kedro-Viz react component. (#1965)
- Refactor namespace pipelines. (#1897)
- Expose the internal Redux state through `options` prop while using Kedro-Viz as a React component. (#1969)
- Enhance documentation for the Kedro-Viz standalone React component. (#1954)

## Bug fixes and other changes

Expand Down
15 changes: 14 additions & 1 deletion docs/source/kedro-viz_visualisation.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,17 @@
```

![Open your project's Kedro Viz inside a new tab](./images/run_viz_with_args.png)
![Kedro Viz inside a new tab](./images/viz_running_in_new_tab.png)
![Kedro Viz inside a new tab](./images/viz_running_in_new_tab.png)

## As a standalone React component

To use Kedro-Viz as a standalone React component (for embedding Kedro-Viz in your web application), you can follow the example below:

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

const MyApp = () => <div style={{height: `100vh`}}><KedroViz data={json} options={options} /></div>;
```

For more information on how to use kedro as React component with all possible props please refer to [Kedro-Viz on npm](https://www.npmjs.com/package/@quantumblack/kedro-viz)

Check warning on line 241 in docs/source/kedro-viz_visualisation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/kedro-viz_visualisation.md#L241

[Kedro-viz.words] Use '' instead of 'please'.
Raw output
{"message": "[Kedro-viz.words] Use '' instead of 'please'.", "location": {"path": "docs/source/kedro-viz_visualisation.md", "range": {"start": {"line": 241, "column": 85}}}, "severity": "WARNING"}

Check warning on line 241 in docs/source/kedro-viz_visualisation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/kedro-viz_visualisation.md#L241

[Kedro-viz.words] Use 'see', 'read', or 'follow' instead of 'refer to'.
Raw output
{"message": "[Kedro-viz.words] Use 'see', 'read', or 'follow' instead of 'refer to'.", "location": {"path": "docs/source/kedro-viz_visualisation.md", "range": {"start": {"line": 241, "column": 92}}}, "severity": "WARNING"}

Check warning on line 241 in docs/source/kedro-viz_visualisation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/kedro-viz_visualisation.md#L241

[Kedro-viz.Spellings] Did you really mean 'npm'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'npm'?", "location": {"path": "docs/source/kedro-viz_visualisation.md", "range": {"start": {"line": 241, "column": 115}}}, "severity": "WARNING"}
11 changes: 10 additions & 1 deletion package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,14 @@ To use Kedro-Viz as a standalone React component, you can follow the example bel
import KedroViz from '@quantumblack/kedro-viz';
import '@quantumblack/kedro-viz/lib/styles/styles.min.css';

const MyApp = () => <KedroViz data={json} />;
const MyApp = () => (
<div style={{height: `100vh`}}>
<KedroViz
data={json}
options={/* Options to configure Kedro Viz */}
/>
</div>
);
```

To use with NextJS:
Expand All @@ -261,6 +268,8 @@ 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.

For more information on how to use Kedro-Viz as a React component, follow this [guide](https://www.npmjs.com/package/@quantumblack/kedro-viz)

**_Our documentation contains [additional examples on how to visualise with Kedro-Viz.](https://docs.kedro.org/en/stable/visualisation/index.html)_**

## Feature Flags
Expand Down
13 changes: 13 additions & 0 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,16 @@ export function updateRunNotes(notes, runId) {
runId,
};
}

export const UPDATE_STATE_FROM_OPTIONS = 'UPDATE_STATE_FROM_OPTIONS';

/**
* Update state with latest options prop coming from the react component
* @param {Object} updatedOptions
*/
export const updateStateFromOptions = (updatedOptions) => {
return {
type: UPDATE_STATE_FROM_OPTIONS,
payload: updatedOptions,
};
};
9 changes: 3 additions & 6 deletions src/actions/pipelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ export function loadInitialPipelineData() {
const url = getUrl('main');
// obtain the status of expandAllPipelines to decide whether it needs to overwrite the
// list of visible nodes
const expandAllPipelines =
state.display.expandAllPipelines || state.expandAllPipelines;
const expandAllPipelines = state.expandAllPipelines;
let newState = await loadJsonData(url).then((data) =>
preparePipelineState(data, true, expandAllPipelines)
);
Expand All @@ -122,7 +121,7 @@ export function loadInitialPipelineData() {
*/
export function loadPipelineData(pipelineID) {
return async function (dispatch, getState) {
const { dataSource, pipeline, display, expandAllPipelines } = getState();
const { dataSource, pipeline, expandAllPipelines } = getState();

if (pipelineID && pipelineID === pipeline.active) {
return;
Expand All @@ -136,10 +135,8 @@ export function loadPipelineData(pipelineID) {
active: pipelineID,
});

const shouldExpandAllPipelines =
display.expandAllPipelines || expandAllPipelines;
const newState = await loadJsonData(url).then((data) =>
preparePipelineState(data, false, shouldExpandAllPipelines)
preparePipelineState(data, false, expandAllPipelines)
);

// Set active pipeline here rather than dispatching two separate actions,
Expand Down
Loading
Loading