gitgraph.js
                                
                                 gitgraph.js copied to clipboard
                                
                                    gitgraph.js copied to clipboard
                            
                            
                            
                        Custom styling of line between two commits
Is your feature request related to a problem? Please describe. Is there a way style the line between two commits ? I would like to have in a color different from the branch color. Also, is it possible to have a dotted line instead of a solid/filled (between two commits) ?
Describe the solution you'd like Some kind of template on the commit to override the branch default.
Describe alternatives you've considered Use before and after hooks
Hello @lroal , For now we can only customize a full branch, not just in between two commits.
All the options for branch are there https://github.com/nicoespeon/gitgraph.js/blob/5ea521c45d7fc0222e153b8161a10546d24af608/packages/gitgraph-core/src/template.ts#L48-L69
So no dotted line for now, but we are open to contributions 😁
A different style between commits should be possible but I didn't touch this codebase since a long time so I can't tell you how hard it can be to implement ^^
Roughly (if I remembered well), the branch are just points calculated from commits https://github.com/nicoespeon/gitgraph.js/blob/5ea521c45d7fc0222e153b8161a10546d24af608/packages/gitgraph-core/src/branches-paths.ts#L91 and the color is injected after https://github.com/nicoespeon/gitgraph.js/blob/5ea521c45d7fc0222e153b8161a10546d24af608/packages/gitgraph-react/src/Gitgraph.tsx#L184
Definitely a fun challenge to add this granularity 😁
As workaround, you could probably retrieve the position of the commits and draw on top of the actual branch (but I need to get back a bit more in the code to be sure that it's doable)
Thanks
This would be very useful to mark squash merges for example.