@@ -14,7 +14,8 @@ import {
1414 PlotsComparisonData ,
1515 DEFAULT_PLOT_HEIGHT ,
1616 DEFAULT_NB_ITEMS_PER_ROW ,
17- DEFAULT_PLOT_WIDTH
17+ DEFAULT_PLOT_WIDTH ,
18+ ComparisonPlotImg
1819} from '../../../plots/webview/contract'
1920import { join } from '../../util/path'
2021import { copyOriginalColors } from '../../../experiments/model/status/colors'
@@ -375,10 +376,14 @@ const getMultiImageData = (
375376 url : string
376377 } [ ]
377378 } = { }
379+
378380 for ( let i = 0 ; i < 15 ; i ++ ) {
379381 const key = joinFunc ( 'plots' , 'image' , `${ i } .jpg` )
380382 const values = [ ]
381383 for ( const revision of revisions ) {
384+ if ( revision === 'exp-83425' && i % 2 === 0 ) {
385+ continue
386+ }
382387 values . push ( {
383388 type : PlotsType . IMAGE ,
384389 revisions : [ revision ] ,
@@ -770,6 +775,11 @@ export const getManyTemplatePlotsWebviewMessage = (
770775
771776export const MOCK_IMAGE_MTIME = 946684800000
772777
778+ const getIndFromComparisonMultiImgPath = ( path : string ) => {
779+ const pathIndMatches = path . match ( / ( \d + ) \. j p g $ / )
780+ return Number ( ( pathIndMatches as string [ ] ) [ 1 ] )
781+ }
782+
773783export const getComparisonWebviewMessage = (
774784 baseUrl : string ,
775785 joinFunc : ( ...args : string [ ] ) => string = join
@@ -779,7 +789,8 @@ export const getComparisonWebviewMessage = (
779789 } = { }
780790
781791 for ( const [ path , plots ] of Object . entries ( getImageData ( baseUrl , joinFunc ) ) ) {
782- const pathLabel = path . includes ( 'image' ) ? join ( 'plots' , 'image' ) : path
792+ const isMulti = path . includes ( 'image' )
793+ const pathLabel = isMulti ? join ( 'plots' , 'image' ) : path
783794
784795 if ( ! plotAcc [ pathLabel ] ) {
785796 plotAcc [ pathLabel ] = {
@@ -801,11 +812,17 @@ export const getComparisonWebviewMessage = (
801812 }
802813 }
803814
804- plotAcc [ pathLabel ] . revisions [ id ] . imgs . push ( {
815+ const img : ComparisonPlotImg = {
805816 url : `${ url } ?${ MOCK_IMAGE_MTIME } ` ,
806817 errors : undefined ,
807818 loading : false
808- } )
819+ }
820+
821+ if ( isMulti ) {
822+ img . ind = getIndFromComparisonMultiImgPath ( path )
823+ }
824+
825+ plotAcc [ pathLabel ] . revisions [ id ] . imgs . push ( img )
809826 }
810827 }
811828
0 commit comments