@@ -15,10 +15,16 @@ import { LineageGraph } from '../../types/api'
1515import { Zoom } from '@visx/zoom'
1616import { bindActionCreators } from 'redux'
1717import { connect } from 'react-redux'
18- import { fetchLineage , resetLineage , setSelectedNode } from '../../store/actionCreators'
18+ import {
19+ fetchLineage ,
20+ resetLineage ,
21+ setLineageGraphDepth ,
22+ setSelectedNode
23+ } from '../../store/actionCreators'
1924import { generateNodeId } from '../../helpers/nodes'
2025import { localPoint } from '@visx/event'
2126import { useParams } from 'react-router-dom'
27+ import DepthConfig from './components/depth-config/DepthConfig'
2228import Edge from './components/edge/Edge'
2329import MqEmpty from '../core/empty/MqEmpty'
2430import MqText from '../core/text/MqText'
@@ -33,6 +39,7 @@ const DOUBLE_CLICK_MAGNIFICATION = 1.1
3339interface StateProps {
3440 lineage : LineageGraph
3541 selectedNode : string
42+ depth : number
3643}
3744
3845interface LineageState {
@@ -85,7 +92,6 @@ export function buildGraphAll(g: graphlib.Graph<MqNode>, graph: LineageNode[], c
8592 callBack ( g )
8693}
8794
88-
8995export function getSelectedPaths ( g : graphlib . Graph < MqNode > , selectedNode : string ) {
9096 const paths = [ ] as Array < [ string , string ] >
9197
@@ -165,7 +171,8 @@ const Lineage: React.FC<LineageProps> = (props: LineageProps) => {
165171 props . fetchLineage (
166172 nodeType . toUpperCase ( ) as JobOrDataset ,
167173 namespace ,
168- nodeName
174+ nodeName ,
175+ props . depth
169176 )
170177 }
171178 mounted . current = true
@@ -188,7 +195,8 @@ const Lineage: React.FC<LineageProps> = (props: LineageProps) => {
188195 props . fetchLineage (
189196 nodeType ?. toUpperCase ( ) as JobOrDataset ,
190197 namespace || '' ,
191- nodeName || ''
198+ nodeName || '' ,
199+ props . depth
192200 )
193201 getEdges ( )
194202 }
@@ -228,6 +236,7 @@ const Lineage: React.FC<LineageProps> = (props: LineageProps) => {
228236 </ MqEmpty >
229237 </ Box >
230238 ) }
239+ < DepthConfig depth = { props . depth } />
231240 { state ?. graph && (
232241 < ParentSize >
233242 { parent => (
@@ -306,15 +315,17 @@ const Lineage: React.FC<LineageProps> = (props: LineageProps) => {
306315
307316const mapStateToProps = ( state : IState ) => ( {
308317 lineage : state . lineage . lineage ,
309- selectedNode : state . lineage . selectedNode
318+ selectedNode : state . lineage . selectedNode ,
319+ depth : state . lineage . depth
310320} )
311321
312322const mapDispatchToProps = ( dispatch : Redux . Dispatch ) =>
313323 bindActionCreators (
314324 {
315325 setSelectedNode : setSelectedNode ,
316326 fetchLineage : fetchLineage ,
317- resetLineage : resetLineage
327+ resetLineage : resetLineage ,
328+ setDepth : setLineageGraphDepth
318329 } ,
319330 dispatch
320331 )
0 commit comments