Enforce branch column order and colors
See original GitHub issueFirst of all, thank you for the great project!
Currently the order of branch columns is determined by which branch comes first in commit list:
export class GraphColumns<TNode> {
private branches: Set<Branch["name"]> = new Set();
public constructor(commits: Array<Commit<TNode>>) {
commits.forEach((commit) => this.branches.add(commit.branchToDisplay));
}
// ...
}
My app has an UI which hides/shows branches based on user requests by filtering commits which get imported to gitgraph, and arbitrarily changing branch order and colors become confusing for users. I’d like to have master branch always having column index 0, first selected branch having column index 1, second branch having column index 2, … regardless of which commit comes first in the log.
What would be the easiest way to accomplish this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (10 by maintainers)
Top Results From Across the Web
Color branches of a dendrogram based on column in dataframe
It appears that it is ordering the colors from the bottom to the top of the dendrogram based on the order of the...
Read more >Adding a column to the branch listing - Atlassian Developer
Bitbucket Server provides a listing of all the branches within a repository. It is a useful view for providing relevant information associated ...
Read more >Columns: Change row colours #1813 - ocornut/imgui - GitHub
Version/Branch of Dear ImGui: 1.61 My Issue/Question: When dealing with ... Is there a way to get an x/y position of the current...
Read more >TTree Class Reference - ROOT
A TTree, often called in jargon tree, consists of a list of independent columns or branches, represented by the TBranch class. Behind each...
Read more >Learning to cook — ObjectListView 2.9.1 documentation
How do I make the sorted column have that slightly different colour? 23. How do I make a column that shows just an...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for your contribution @haizz 👋
As mentioned in the PR: I simply refactor the name to be more explicit. I went for the semantics of
Array.prototype.sort()
, thus I called itCompareBranchesOrder
instead ofBranchesOrderFunction
.I published v1.1.0-2 of @gitgraph/react & @gitgraph/core that contains the change. Let’s know if you find some issues with different ordering of branches.
@nicoespeon Thank you so much! Working great so far.