33 * any form or by any electronic or mechanical means without written permission from LabKey Corporation.
44 */
55import { immerable , produce } from 'immer' ;
6- import { List , Map , Record as ImmutableRecord } from 'immutable' ;
6+ import { Record as ImmutableRecord , List , Map } from 'immutable' ;
77import { DataSet } from 'vis-data' ;
88import { Edge , IdType , Node } from 'vis-network' ;
99
@@ -159,9 +159,9 @@ export interface LineageIOWithMetadata extends LineageIOConfig {
159159 objectOutputs ?: LineageItemWithMetadata [ ] ;
160160}
161161
162- export interface LineageItemWithIOMetadata extends LineageItemWithMetadata , LineageIOWithMetadata { }
162+ export interface LineageItemWithIOMetadata extends LineageIOWithMetadata , LineageItemWithMetadata { }
163163
164- export interface LineageRunStepConfig extends Experiment . LineageRunStepBase , LineageItemWithIOMetadata { }
164+ export interface LineageRunStepConfig extends LineageItemWithIOMetadata , Experiment . LineageRunStepBase { }
165165
166166export class LineageRunStep implements LineageRunStepConfig {
167167 [ immerable ] = true ;
@@ -170,6 +170,7 @@ export class LineageRunStep implements LineageRunStepConfig {
170170 readonly activityDate : string ;
171171 readonly activitySequence : number ;
172172 readonly container : string ;
173+ readonly containerPath : string ;
173174 readonly created : string ;
174175 readonly createdBy : string ;
175176 readonly dataInputs : LineageIO [ ] ;
@@ -202,6 +203,7 @@ export class LineageIO implements LineageItemWithMetadata {
202203 [ immerable ] = true ;
203204
204205 readonly container : string ;
206+ readonly containerPath : string ;
205207 readonly created : string ;
206208 readonly createdBy : string ;
207209 readonly expType : string ;
@@ -246,15 +248,15 @@ export class LineageIO implements LineageItemWithMetadata {
246248}
247249
248250interface LineageNodeConfig
249- extends Omit < Experiment . LineageNodeBase , 'children' | 'parents' | 'steps' > ,
250- LineageItemWithIOMetadata {
251- children : List < LineageLink > | LineageLink [ ] | ILineageLink [ ] ;
251+ extends LineageItemWithIOMetadata ,
252+ Omit < Experiment . LineageNodeBase , 'children' | 'parents' | 'steps' > {
253+ children : ILineageLink [ ] | LineageLink [ ] | List < LineageLink > ;
252254 // computed properties
253255 distance : number ;
254256 listURL : string ;
255257
256258 meta : LineageNodeMetadata ;
257- parents : List < LineageLink > | LineageLink [ ] | ILineageLink [ ] ;
259+ parents : ILineageLink [ ] | LineageLink [ ] | List < LineageLink > ;
258260 steps : List < LineageRunStep > ;
259261}
260262
@@ -394,11 +396,11 @@ export class LineageResult extends ImmutableRecord({
394396 } ) ;
395397 }
396398
397- filterIn ( field : string , value : undefined | string | string [ ] ) : LineageResult {
399+ filterIn ( field : string , value : string | string [ ] | undefined ) : LineageResult {
398400 return LineageResult . _filter ( this , field , value , true ) ;
399401 }
400402
401- filterOut ( field : string , value : undefined | string | string [ ] ) : LineageResult {
403+ filterOut ( field : string , value : string | string [ ] | undefined ) : LineageResult {
402404 return LineageResult . _filter ( this , field , value , false ) ;
403405 }
404406
@@ -412,7 +414,7 @@ export class LineageResult extends ImmutableRecord({
412414 private static _filter (
413415 result : LineageResult ,
414416 field : string ,
415- value : undefined | string | string [ ] ,
417+ value : string | string [ ] | undefined ,
416418 filterIn : boolean
417419 ) : LineageResult {
418420 if ( field === undefined ) throw new Error ( 'field must not be undefined' ) ;
@@ -459,7 +461,7 @@ export class LineageResult extends ImmutableRecord({
459461 private static _matches (
460462 node : LineageNode ,
461463 field : string ,
462- value : undefined | string | string [ ] ,
464+ value : string | string [ ] | undefined ,
463465 filterIn : boolean
464466 ) : boolean {
465467 if ( filterIn ) {
@@ -510,7 +512,7 @@ export class LineageResult extends ImmutableRecord({
510512 value : any ,
511513 filterIn : boolean ,
512514 walked : Record < string , string >
513- ) : Array < { lsid : string ; role : string } > {
515+ ) : { lsid : string ; role : string } [ ] {
514516 let heritage = [ ] ;
515517 const lsid = edge . lsid ;
516518 const toNode = nodes . get ( lsid ) ;
@@ -631,7 +633,7 @@ export class Lineage {
631633export class LineageGridModel {
632634 [ immerable ] = true ;
633635
634- readonly columns : List < string | GridColumn > = LINEAGE_GRID_COLUMNS ;
636+ readonly columns : List < GridColumn | string > = LINEAGE_GRID_COLUMNS ;
635637 readonly data : List < LineageNode > = List ( ) ;
636638 readonly distance : number = DEFAULT_LINEAGE_DISTANCE ;
637639 readonly isError : boolean = false ;
@@ -690,7 +692,7 @@ interface VisGraphClusterNode {
690692 nodesInCluster : VisGraphNodeType [ ] ;
691693}
692694
693- export type VisGraphNodeType = VisGraphNode | VisGraphCombinedNode | VisGraphClusterNode ;
695+ export type VisGraphNodeType = VisGraphClusterNode | VisGraphCombinedNode | VisGraphNode ;
694696
695697export function isBasicNode ( item : VisGraphNodeType ) : item is VisGraphNode {
696698 return item && item . kind === 'node' ;
@@ -709,7 +711,7 @@ export class VisGraphOptions {
709711
710712 readonly edges : DataSet < Edge > ;
711713 readonly initialSelection : string [ ] ;
712- readonly nodes : DataSet < VisGraphNode | VisGraphCombinedNode > ;
714+ readonly nodes : DataSet < VisGraphCombinedNode | VisGraphNode > ;
713715 readonly options : Record < string , any > ;
714716
715717 constructor ( config ?: Partial < VisGraphOptions > ) {
@@ -730,7 +732,7 @@ function makeEdgeId(fromId: IdType, toId: IdType): string {
730732type EdgesRecord = Record < string , Edge > ;
731733type LineageNodesRecord = Record < string , LineageNode > ;
732734type NodesInCombinedNode = Record < string , string [ ] > ;
733- type VisNodesRecord = Record < string , VisGraphNode | VisGraphCombinedNode > ;
735+ type VisNodesRecord = Record < string , VisGraphCombinedNode | VisGraphNode > ;
734736
735737/**
736738 * Create an edge between fromId -> toId when dir === Child.
@@ -986,7 +988,7 @@ export interface LineageNodeCollection {
986988 queryName : string ;
987989}
988990
989- export function isAliquotNode ( node : LineageNodeCollection | LineageNode ) : boolean {
991+ export function isAliquotNode ( node : LineageNode | LineageNodeCollection ) : boolean {
990992 return node . materialLineageType === 'Aliquot' ;
991993}
992994
@@ -1149,7 +1151,7 @@ function groupingBoundary(
11491151 grouping : LineageGroupingOptions ,
11501152 depth : number ,
11511153 dir : LINEAGE_DIRECTIONS ,
1152- depthSets : Array < Record < string , string > >
1154+ depthSets : Record < string , string > [ ]
11531155) : boolean {
11541156 if ( grouping ) {
11551157 // Nearest only examines the first parent and child generations (depth = 1) from seed
@@ -1206,7 +1208,7 @@ function level(depth: number, dir: LINEAGE_DIRECTIONS, combined: boolean): numbe
12061208 * level, however, after further walking the graph it could be that this node needs to be moved to a different level
12071209 * given a parent/child at a higher/lower depth. See Issue 51425.
12081210 */
1209- function reprocessLevel ( visNode : VisGraphNode | VisGraphCombinedNode , dir : LINEAGE_DIRECTIONS , depth : number ) : void {
1211+ function reprocessLevel ( visNode : VisGraphCombinedNode | VisGraphNode , dir : LINEAGE_DIRECTIONS , depth : number ) : void {
12101212 if ( ! visNode ) return ;
12111213
12121214 const currentLevel = visNode . level ;
@@ -1261,7 +1263,7 @@ function processNodes(
12611263 nodesInCombinedNode : NodesInCombinedNode ,
12621264 depth = 0 ,
12631265 processed : Record < string , boolean > = { } ,
1264- depthSets : Array < Record < string , string > > = [ ]
1266+ depthSets : Record < string , string > [ ] = [ ]
12651267) : void {
12661268 if ( processed [ lsid ] === true ) {
12671269 // We have already seen this node, however, this now might be at a greater depth so reprocess the level
@@ -1467,7 +1469,7 @@ export function generate(result: LineageResult, options?: LineageOptions): VisGr
14671469 const { edges, nodes } = generateNodesAndEdges ( result , options ) ;
14681470
14691471 return new VisGraphOptions ( {
1470- nodes : new DataSet < VisGraphNode | VisGraphCombinedNode > ( Object . values ( nodes ) ) ,
1472+ nodes : new DataSet < VisGraphCombinedNode | VisGraphNode > ( Object . values ( nodes ) ) ,
14711473 edges : new DataSet < Edge > ( Object . values ( edges ) ) ,
14721474
14731475 // vis.js options described in detail here: https://visjs.github.io/vis-network/docs/network/
0 commit comments