Documentation
¶
Index ¶
- Constants
- Variables
- func SerializeOutput(out *Out)
- type CycleColorGen
- type IColorGenerator
- type IPoint
- type Node
- func GetInputNodesFromFile(filePath string) (nodes []*Node, err error)
- func GetInputNodesFromJSON(inputJSON []byte) (nodes []*Node, err error)
- func GetInputNodesFromRepo(dir string, order Order, limit int) (nodes []*Node, err error)
- func GetInputNodesFromRepoSeq(dir string, order Order, limit int) (nodes []*Node, err error)
- type Order
- type Out
- type PartialPath
- type Path
- type PathTest
- type Point
- type PointTest
- type SimpleColorGen
Constants ¶
const ( Pipe pointType = iota // 0: | MergeBack // 1: ┘ Fork // 2: ┐ MergeTo // 3: ┌ )
Types; to understand these constants, you need to read the graph from top to bottom. Fork is when a node fork into two paths (top -> bottom) MergeBack is when a branch merge back into a branch on its right MergeTo is when a branch on the right merge into a branch on its left
const ( BottomHalfLine = 0 TopHalfLine = 1 FullLine = 2 ForkLine = 3 MergeBackLine = 4 )
Variables ¶
var DefaultColors = []string{
"#005EBE",
"#CD3A00",
"#FF9B00",
"#007754",
"#5247A5",
"#009DB5",
"#007DFF",
"#FF6C3B",
"#FFB800",
"#3EBD90",
"#776CCB",
"#00C4E0",
}
DefaultColors Default colors
var NoOutput = false
NoOutput No output
Functions ¶
Types ¶
type CycleColorGen ¶
type CycleColorGen struct {
// contains filtered or unexported fields
}
CycleColorGen ...
func NewCycleColorGen ¶
func NewCycleColorGen(colors []string) *CycleColorGen
NewCycleColorGen creates a new CycleColorGen
func (*CycleColorGen) GetColor ¶
func (c *CycleColorGen) GetColor(idx int) string
type IColorGenerator ¶
type Node ¶
Node is the raw information for a commit
func GetInputNodesFromFile ¶
GetInputNodesFromFile creates an array of Node from json contained in a file
func GetInputNodesFromJSON ¶
GetInputNodesFromJSON Get nodes from json object
func GetInputNodesFromRepo ¶
GetInputNodesFromRepo creates an array of Node from a repository
func GetInputNodesFromRepoSeq ¶
GetInputNodesFromRepoSeq creates an array of Node from a repository. Replace sha by sequential IDs.
func (*Node) GetParents ¶
type Out ¶
type Out struct {
FirstSha string
Nodes []*Node
PartialPaths []*PartialPath
}
func GetPaginated ¶
GetPaginated gets the necessary information to render the graph for the asked page
func GetPaginatedRows ¶
GetPaginatedRows gets the information to render the graph as rows
type PartialPath ¶
type Path ¶
type Path struct {
Points []IPoint
// contains filtered or unexported fields
}
Path defines how to draw a line in between a parent and child nodes
func (*Path) GetHeightAtIdx ¶
GetHeightAtIdx Get the path x at idx
type PathTest ¶
type PathTest struct {
Points []*PointTest
// contains filtered or unexported fields
}
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
Point is one part of a path
func (*Point) MarshalJSON ¶
type SimpleColorGen ¶
type SimpleColorGen struct {
// contains filtered or unexported fields
}
SimpleColorGen is a color generator that take a static colors array, or return black when running out of colors
func NewSimpleColorGen ¶
func NewSimpleColorGen(colors []string) *SimpleColorGen
NewSimpleColorGen creates a new SimpleColorGen
func (*SimpleColorGen) GetColor ¶
func (c *SimpleColorGen) GetColor(idx int) string