kedro-org / kedro-viz

Visualise your Kedro data and machine-learning pipelines and track your experiments.
https://demo.kedro.org
Apache License 2.0
647 stars 106 forks source link

Exposing internal state via Kedro Viz React component props #1969

Open jitu5 opened 2 days ago

jitu5 commented 2 days ago

Description

This PR aims to enhance the flexibility and functionality of the Kedro Viz React component by exposing internal Redux state to component users through props. Existing props structure:

<KedroViz
    data={json}
    display={
      globalToolbar: false,
      miniMap: false,
      expandAllPipelines: false,
      sidebar: false
    }}
    visible={
      labelBtn: false,
      layerBtn: false,
      exportBtn: false,
      pipelineBtn: false,
      sidebar: false,
    }}
    theme="dark"
 />

New props structure:

<KedroViz
    data={json}
    props={
      display: {
        globalToolbar: true,
        sidebar: true,
        miniMap: true,
        expandAllPipelines: false,
      }
      visible: {
        exportBtn: true,
        labelBtn: true,
        layerBtn: true,
        pipelineBtn: true,
        sidebar: true,        
      }
      theme: "dark",
      tag: {
        enabled: {companies: true}
      },
      nodeType: {
        disabled: {parameters: true}
      }
    }
 />

The new structure consolidates display, visible, and other settings under a single props object, making the component's API more organized and scalable.

Development notes

Checklist