@@ -56,10 +56,10 @@ function getLabelColorIdentifier(historyItem: ISCMHistoryItem, colorMap: Map<str
56
56
return undefined ;
57
57
}
58
58
59
- function createPath ( colorIdentifier : string ) : SVGPathElement {
59
+ function createPath ( colorIdentifier : string , strokeWidth = 1 ) : SVGPathElement {
60
60
const path = document . createElementNS ( 'http://www.w3.org/2000/svg' , 'path' ) ;
61
61
path . setAttribute ( 'fill' , 'none' ) ;
62
- path . setAttribute ( 'stroke-width' , '1px' ) ;
62
+ path . setAttribute ( 'stroke-width' , ` ${ strokeWidth } px` ) ;
63
63
path . setAttribute ( 'stroke-linecap' , 'round' ) ;
64
64
path . style . stroke = asCssVariable ( colorIdentifier ) ;
65
65
@@ -80,8 +80,8 @@ function drawCircle(index: number, radius: number, strokeWidth: number, colorIde
80
80
return circle ;
81
81
}
82
82
83
- function drawVerticalLine ( x1 : number , y1 : number , y2 : number , color : string ) : SVGPathElement {
84
- const path = createPath ( color ) ;
83
+ function drawVerticalLine ( x1 : number , y1 : number , y2 : number , color : string , strokeWidth = 1 ) : SVGPathElement {
84
+ const path = createPath ( color , strokeWidth ) ;
85
85
path . setAttribute ( 'd' , `M ${ x1 } ${ y1 } V ${ y2 } ` ) ;
86
86
87
87
return path ;
@@ -240,14 +240,15 @@ export function renderSCMHistoryItemGraph(historyItemViewModel: ISCMHistoryItemV
240
240
return svg ;
241
241
}
242
242
243
- export function renderSCMHistoryGraphPlaceholder ( columns : ISCMHistoryItemGraphNode [ ] ) : HTMLElement {
243
+ export function renderSCMHistoryGraphPlaceholder ( columns : ISCMHistoryItemGraphNode [ ] , highlightIndex ?: number ) : HTMLElement {
244
244
const elements = svgElem ( 'svg' , {
245
245
style : { height : `${ SWIMLANE_HEIGHT } px` , width : `${ SWIMLANE_WIDTH * ( columns . length + 1 ) } px` , }
246
246
} ) ;
247
247
248
248
// Draw |
249
249
for ( let index = 0 ; index < columns . length ; index ++ ) {
250
- const path = drawVerticalLine ( SWIMLANE_WIDTH * ( index + 1 ) , 0 , SWIMLANE_HEIGHT , columns [ index ] . color ) ;
250
+ const strokeWidth = index === highlightIndex ? 3 : 1 ;
251
+ const path = drawVerticalLine ( SWIMLANE_WIDTH * ( index + 1 ) , 0 , SWIMLANE_HEIGHT , columns [ index ] . color , strokeWidth ) ;
251
252
elements . root . append ( path ) ;
252
253
}
253
254
@@ -354,18 +355,13 @@ export function toISCMHistoryItemViewModelArray(
354
355
return viewModels ;
355
356
}
356
357
357
- export function getHistoryItemColor ( historyItemViewModel : ISCMHistoryItemViewModel ) : string {
358
+ export function getHistoryItemIndex ( historyItemViewModel : ISCMHistoryItemViewModel ) : number {
358
359
const historyItem = historyItemViewModel . historyItem ;
359
360
const inputSwimlanes = historyItemViewModel . inputSwimlanes ;
360
- const outputSwimlanes = historyItemViewModel . outputSwimlanes ;
361
361
362
362
// Find the history item in the input swimlanes
363
363
const inputIndex = inputSwimlanes . findIndex ( node => node . id === historyItem . id ) ;
364
364
365
365
// Circle index - use the input swimlane index if present, otherwise add it to the end
366
- const circleIndex = inputIndex !== - 1 ? inputIndex : inputSwimlanes . length ;
367
-
368
- // Circle color - use the output swimlane color if present, otherwise the input swimlane color
369
- return circleIndex < outputSwimlanes . length ? outputSwimlanes [ circleIndex ] . color :
370
- circleIndex < inputSwimlanes . length ? inputSwimlanes [ circleIndex ] . color : historyItemRefColor ;
366
+ return inputIndex !== - 1 ? inputIndex : inputSwimlanes . length ;
371
367
}
0 commit comments