11import omit from 'lodash.omit'
22import { TopLevelSpec } from 'vega-lite'
3+ import { getRevisionFirstThreeColumns } from './util'
34import {
45 ColorScale ,
56 CheckpointPlotValues ,
@@ -647,28 +648,41 @@ export const collectBranchRevisionDetails = (
647648
648649const getRevision = (
649650 displayColor : Color ,
650- { logicalGroupName, id, label } : Experiment
651- ) : Revision => ( {
652- displayColor,
653- fetched : true ,
654- group : logicalGroupName ,
655- id,
656- revision : label
657- } )
651+ experiment : Experiment ,
652+ firstThreeColumns : string [ ]
653+ ) : Revision => {
654+ const { logicalGroupName, id, label } = experiment
655+ return {
656+ displayColor,
657+ fetched : true ,
658+ firstThreeColumns : getRevisionFirstThreeColumns (
659+ firstThreeColumns ,
660+ experiment
661+ ) ,
662+ group : logicalGroupName ,
663+ id,
664+ revision : label
665+ }
666+ }
658667
659668const overrideWithWorkspace = (
660669 orderMapping : { [ label : string ] : string } ,
661670 selectedWithOverrides : Revision [ ] ,
662671 displayColor : Color ,
663- label : string
672+ label : string ,
673+ firstThreeColumns : string [ ]
664674) : void => {
665675 orderMapping [ label ] = EXPERIMENT_WORKSPACE_ID
666676 selectedWithOverrides . push (
667- getRevision ( displayColor , {
668- id : EXPERIMENT_WORKSPACE_ID ,
669- label : EXPERIMENT_WORKSPACE_ID ,
670- logicalGroupName : undefined
671- } )
677+ getRevision (
678+ displayColor ,
679+ {
680+ id : EXPERIMENT_WORKSPACE_ID ,
681+ label : EXPERIMENT_WORKSPACE_ID ,
682+ logicalGroupName : undefined
683+ } ,
684+ firstThreeColumns
685+ )
672686 )
673687}
674688
@@ -686,26 +700,33 @@ const isExperimentThatWillDisappearAtEnd = (
686700const getMostRecentFetchedCheckpointRevision = (
687701 selectedRevision : SelectedExperimentWithColor ,
688702 fetchedRevs : Set < string > ,
689- checkpoints : Experiment [ ] | undefined
703+ checkpoints : Experiment [ ] | undefined ,
704+ firstThreeColumns : string [ ]
690705) : Revision => {
691706 const mostRecent =
692707 checkpoints ?. find ( ( { label } ) => fetchedRevs . has ( label ) ) || selectedRevision
693- return getRevision ( selectedRevision . displayColor , mostRecent )
708+ return getRevision (
709+ selectedRevision . displayColor ,
710+ mostRecent ,
711+ firstThreeColumns
712+ )
694713}
695714
696715const overrideRevisionDetail = (
697716 orderMapping : { [ label : string ] : string } ,
698717 selectedWithOverrides : Revision [ ] ,
699718 selectedRevision : SelectedExperimentWithColor ,
700719 fetchedRevs : Set < string > ,
701- checkpoints : Experiment [ ] | undefined
720+ checkpoints : Experiment [ ] | undefined ,
721+ firstThreeColumns : string [ ]
702722) => {
703723 const { label } = selectedRevision
704724
705725 const mostRecent = getMostRecentFetchedCheckpointRevision (
706726 selectedRevision ,
707727 fetchedRevs ,
708- checkpoints
728+ checkpoints ,
729+ firstThreeColumns
709730 )
710731 orderMapping [ label ] = mostRecent . revision
711732 selectedWithOverrides . push ( mostRecent )
@@ -717,7 +738,8 @@ const collectRevisionDetail = (
717738 selectedRevision : SelectedExperimentWithColor ,
718739 fetchedRevs : Set < string > ,
719740 unfinishedRunningExperiments : { [ id : string ] : string } ,
720- getCheckpoints : ( id : string ) => Experiment [ ] | undefined
741+ getCheckpoints : ( id : string ) => Experiment [ ] | undefined ,
742+ firstThreeColumns : string [ ]
721743) => {
722744 const { label, status, id, displayColor } = selectedRevision
723745
@@ -729,7 +751,8 @@ const collectRevisionDetail = (
729751 orderMapping ,
730752 selectedWithOverrides ,
731753 displayColor ,
732- label
754+ label ,
755+ firstThreeColumns
733756 )
734757 }
735758
@@ -746,20 +769,24 @@ const collectRevisionDetail = (
746769 selectedWithOverrides ,
747770 selectedRevision ,
748771 fetchedRevs ,
749- getCheckpoints ( id )
772+ getCheckpoints ( id ) ,
773+ firstThreeColumns
750774 )
751775 }
752776
753777 orderMapping [ label ] = label
754- selectedWithOverrides . push ( getRevision ( displayColor , selectedRevision ) )
778+ selectedWithOverrides . push (
779+ getRevision ( displayColor , selectedRevision , firstThreeColumns )
780+ )
755781}
756782
757783export const collectOverrideRevisionDetails = (
758784 comparisonOrder : string [ ] ,
759785 selectedRevisions : SelectedExperimentWithColor [ ] ,
760786 fetchedRevs : Set < string > ,
761787 unfinishedRunningExperiments : { [ id : string ] : string } ,
762- getCheckpoints : ( id : string ) => Experiment [ ] | undefined
788+ getCheckpoints : ( id : string ) => Experiment [ ] | undefined ,
789+ firstThreeColumns : string [ ]
763790) : {
764791 overrideComparison : Revision [ ]
765792 overrideRevisions : Revision [ ]
@@ -774,7 +801,8 @@ export const collectOverrideRevisionDetails = (
774801 selectedRevision ,
775802 fetchedRevs ,
776803 unfinishedRunningExperiments ,
777- getCheckpoints
804+ getCheckpoints ,
805+ firstThreeColumns
778806 )
779807 }
780808
0 commit comments