@@ -82,7 +82,7 @@ export class GitGraph {
82
82
this . barHeight = Math . max ( this . graphHeight , this . unitTime * this . commits . length + 320 ) ;
83
83
84
84
const _ref = this . commits ;
85
- for ( let _i = 0 ; _i < _ref . length ; _i ++ ) {
85
+ for ( let _i = 0 ; _i < _ref . length ; _i ++ ) {
86
86
c = _ref [ _i ] ;
87
87
this . preparedCommits [ c . id ] = c ;
88
88
}
@@ -130,8 +130,8 @@ export class GitGraph {
130
130
day = _ref [ mm ] . date ;
131
131
if (
132
132
curDay . getDate ( ) !== new Date ( day ) . getDate ( ) ||
133
- curDay . getMonth ( ) !== new Date ( day ) . getMonth ( ) ||
134
- curDay . getFullYear ( ) !== new Date ( day ) . getFullYear ( )
133
+ curDay . getMonth ( ) !== new Date ( day ) . getMonth ( ) ||
134
+ curDay . getFullYear ( ) !== new Date ( day ) . getFullYear ( )
135
135
) {
136
136
const text = document . createElementNS ( 'http://www.w3.org/2000/svg' , 'text' ) ;
137
137
const date = new Date ( day ) ;
@@ -183,7 +183,7 @@ export class GitGraph {
183
183
}
184
184
185
185
renderPartialGraph ( refName : string ) {
186
- let commit ;
186
+ let commit ;
187
187
let end ;
188
188
let i ;
189
189
let isGraphEdge ;
@@ -257,13 +257,18 @@ export class GitGraph {
257
257
style : 'clip-path: circle(50%)'
258
258
} ;
259
259
this . setNodeAttr ( img , imgAttrs ) ;
260
+
261
+ const authorText = document . createElementNS ( 'http://www.w3.org/2000/svg' , 'title' ) ;
262
+ authorText . appendChild ( document . createTextNode ( commit . author . name ) ) ;
263
+ img . appendChild ( authorText ) ;
264
+
260
265
this . svg . appendChild ( img ) ;
261
266
262
267
if ( ! this . messageBoxWidth ) {
263
268
this . messageBoxWidth = this . svg . getBoundingClientRect . width - ( avatar_box_x + 40 ) ;
264
269
}
265
270
// 画竖线
266
- let route = [ 'M' , avatar_box_x + 15 , avatar_box_y - 20 , 'L' , avatar_box_x + 15 , avatar_box_y ] ;
271
+ let route = [ 'M' , avatar_box_x + 15 , avatar_box_y - 20 , 'L' , avatar_box_x + 15 , avatar_box_y ] ;
267
272
const line1 = document . createElementNS ( 'http://www.w3.org/2000/svg' , 'path' ) ;
268
273
const lineAttrs1 = {
269
274
d : route . join ( ' ' ) ,
@@ -307,7 +312,7 @@ export class GitGraph {
307
312
commitText . appendChild ( titleText ) ;
308
313
this . svg . appendChild ( commitText ) ;
309
314
310
- ( commitText as any ) . onclick = function ( ) {
315
+ ( commitText as any ) . onclick = function ( ) {
311
316
const url = commit . customUrl || options ?. commit_url . replace ( '{commitId}' , commit . id ) ;
312
317
return window . open ( url , '_blank' ) ;
313
318
} ;
@@ -334,7 +339,7 @@ export class GitGraph {
334
339
parentX1 = this . offsetX + this . unitSpace * ( this . mspace - parentCommit . space ) ;
335
340
parentX2 = this . offsetX + this . unitSpace * ( this . mspace - parent [ 1 ] ) ;
336
341
if ( parentCommit . space <= commit . space ) {
337
- color = this . colors [ commit . space ] ;
342
+ color = this . colors [ commit . space ] ;
338
343
} else {
339
344
color = this . colors [ parentCommit . space ] ;
340
345
}
@@ -588,7 +593,7 @@ export class GitGraph {
588
593
} ) ;
589
594
}
590
595
591
- textWrap ( t : any , width : any , x : any ) {
596
+ textWrap ( t : any , width : any , x : any ) {
592
597
const content = t . children [ 0 ] . innerHTML ;
593
598
let words = content . split ( '\n' ) . filter ( ( item : any ) => item !== '' ) ;
594
599
words = words . map ( ( str : any ) => {
0 commit comments