{"modulePath":"github.com/nsgo-dev/nsgo","version":"v0.4.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package commitgraph\n\nPackage commitgraph is base/commitgraph's styled form: a repository's commits as a virtualized list beside their revision graph, in the look of Onegit's All Commits page.\n\n## Types\n\n```go\ntype Commit struct {\n\tHash string\n\t// Parents are the commit's parents' hashes, the first parent first.\n\tParents []string\n\t// Short is the abbreviated hash, the first 7 characters of Hash when\n\t// empty.\n\tShort   string\n\tSubject string\n\t// More tells that the message goes on after Subject.\n\tMore bool\n\t// Avatar is the URL of the author's picture; without it the author's\n\t// initials show.\n\tAvatar string\n\tAuthor string\n\tDate   time.Time\n\tRefs   []Ref\n\t// Head marks the checked out commit, whose subject is bold.\n\tHead bool\n}\n```\nCommit is a row of a View.\n\n```go\ntype Ref struct {\n\tName    string\n\tKind    RefKind\n\tCurrent bool\n}\n```\nRef is a label at a commit. Current marks in bold what the checkout is on, such as its upstream; a RefHead always is.\n\n```go\ntype RefKind uint8\n```\nRefKind is what a ref names.\n\n```go\nconst (\n\t// RefBranch is a local branch.\n\tRefBranch RefKind = iota\n\t// RefRemote is a remote's branch.\n\tRefRemote\n\t// RefTag is a tag.\n\tRefTag\n\t// RefHead is the checkout: its branch, or HEAD detached.\n\tRefHead\n)\n```\n\n```go\ntype View struct {\n\tCommits func() []Commit\n\t// Selection holds the chosen commits' hashes.\n\tSelection *ui.Selection\n\t// OnActivate receives the commit Enter or a double click activates.\n\tOnActivate func(Commit)\n\t// OnLoadMore runs as the end of the rows comes near, for the next page.\n\tOnLoadMore func()\n\t// Empty shows while there are no commits.\n\tEmpty core.Node\n\t// Label names the list for assistive technology.\n\tLabel  string\n\tRef    *core.Ref\n\tTestID string\n\tStyle  core.Style\n}\n```\nView lists Commits, newest first with each after its children as \\`git log --date-order\\` lists them, beside their revision graph. A merge's node collapses or expands the commits it brings in. Rows narrower than 560 points show only the author's avatar after the subject, leaving out the author's name, hash and date. Give it a height, or let it fill what the app sizes.\n\n```go\nfunc (v View) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n","path":"github.com/nsgo-dev/nsgo/ui/commitgraph","name":"commitgraph","synopsis":"Package commitgraph is base/commitgraph's styled form: a repository's commits as a virtualized list beside their revision graph, in the look of Onegit's All Commits page.","isRedistributable":true}
