entropy

package
v0.19.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ReplacePrefix = "const DATA = "
View Source
const ToReplace = "const DATA = {}"

Variables

This section is empty.

Functions

func HSVToRGB

func HSVToRGB(h, s, v float64) (r, g, b uint8)

HSVToRGB converts an HSV triple to an RGB triple. taken from https://github.com/Crazy3lf/colorconv/blob/master/colorconv.go

func Render

func Render(parser language.NodeParser, files []string, cfg RenderConfig) error

Types

type DirTree

type DirTree orderedmap.OrderedMap[string, DirTreeEntry]

func NewDirTree

func NewDirTree() *DirTree

func (*DirTree) AddDirs

func (d *DirTree) AddDirs(dir string)

func (*DirTree) ColorFor

func (d *DirTree) ColorFor(dir string) []int

ColorFor 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.

type DirTreeEntry

type DirTreeEntry struct {
	// contains filtered or unexported fields
}

type Graph

type Graph struct {
	Nodes     []Node `json:"nodes"`
	Links     []Link `json:"links"`
	EnableGui bool   `json:"enableGui"`
}
type Link struct {
	From     int64 `json:"from"`
	To       int64 `json:"to"`
	IsDir    bool  `json:"isDir"`
	IsCyclic bool  `json:"isCyclic"`
}

type Node

type Node struct {
	Id       int64  `json:"id"`
	FileName string `json:"fileName"`
	DirName  string `json:"dirName"`
	Loc      int    `json:"loc"`
	Size     int    `json:"size"`
	Color    []int  `json:"color,omitempty"`
	IsDir    bool   `json:"isDir"`
}

type RenderConfig

type RenderConfig struct {
	NoOpen    bool
	EnableGui bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL