Documentation
¶
Index ¶
- Constants
- func HSVToRGB(h, s, v float64) (r, g, b uint8)
- func Render(files []string, parser graph.NodeParser[*language.FileInfo], cfg RenderConfig) error
- type DirTree
- func (d *DirTree) AddDirs(dirs []string)
- func (d *DirTree) AddDirsFromFileInfo(info *language.FileInfo)
- func (d *DirTree) ColorForDir(dirs []string, format colorFormat) []float64
- func (d *DirTree) ColorForFileInfo(info *language.FileInfo, format colorFormat) []float64
- func (d *DirTree) GroupingsForDir(dirs []string) []string
- func (d *DirTree) GroupingsForFileInfo(info *language.FileInfo) []string
- type DirTreeEntry
- type Graph
- type Link
- type Node
- type RenderConfig
Constants ¶
View Source
const ( HSV colorFormat = iota RGB )
View Source
const ReplacePrefix = "const DATA = "
View Source
const ToReplace = "const DATA = {}"
Variables ¶
This section is empty.
Functions ¶
func HSVToRGB ¶
HSVToRGB converts an HSV triple to an RGB triple. taken from https://github.com/Crazy3lf/colorconv/blob/master/colorconv.go
func Render ¶
func Render(files []string, parser graph.NodeParser[*language.FileInfo], cfg RenderConfig) error
Types ¶
type DirTree ¶
type DirTree orderedmap.OrderedMap[string, DirTreeEntry]
func NewDirTree ¶
func NewDirTree() *DirTree
func (*DirTree) AddDirsFromFileInfo ¶ added in v0.19.6
func (*DirTree) ColorForDir ¶ added in v0.19.2
ColorForDir smartly assigns a color for the specified dir based on all the dir tree that the codebase has. Files in the same folder will receive the same color, and colors for each sub folder will be assigned evenly following a radial distribution in an HSV wheel. As it goes deeper into more sub folders, colors fade, but the distribution rules are the same.
func (*DirTree) ColorForFileInfo ¶ added in v0.19.6
func (*DirTree) GroupingsForDir ¶ added in v0.19.2
type DirTreeEntry ¶
type DirTreeEntry struct {
// contains filtered or unexported fields
}
type Node ¶
type Node struct { Id int64 `json:"id"` IsEntrypoint bool `json:"isEntrypoint"` FileName string `json:"fileName"` Group string `json:"group,omitempty"` DirName string `json:"dirName"` Loc int `json:"loc"` Size int `json:"size"` Color []int `json:"color,omitempty"` IsDir bool `json:"isDir"` IsPackage bool `json:"isPackage"` }
type RenderConfig ¶
Click to show internal directories.
Click to hide internal directories.