trees

package
v0.0.0-...-93b4288 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GraphOpts = []*discordgo.ApplicationCommandOption{
	{
		Type:        discordgo.ApplicationCommandOptionString,
		Name:        "output_type",
		Description: "The output type of the graph!",
		Required:    false,
		Choices: []*discordgo.ApplicationCommandOptionChoice{
			{
				Name:  "PNG",
				Value: "PNG",
			},
			{
				Name:  "SVG",
				Value: "SVG",
			},
			{
				Name:  "Text",
				Value: "Text",
			},
			{
				Name:  "DOT",
				Value: "DOT",
			},
		},
	},
	{
		Type:        discordgo.ApplicationCommandOptionString,
		Name:        "layout",
		Description: "The layout engine to use for rendering images!",
		Choices: []*discordgo.ApplicationCommandOptionChoice{
			{
				Name:  "Dot",
				Value: "Dot",
			},
			{
				Name:  "Twopi",
				Value: "Twopi",
			},
		},
	},
	{
		Type:        discordgo.ApplicationCommandOptionBoolean,
		Name:        "distinct",
		Description: "Whether to style the primary elements of the graph differently",
	},
}

Functions

func CalcTree

func CalcTree(db *eodb.DB, elem int) (string, bool, string)

Tree calculation utilities

func CalcTreeCat

func CalcTreeCat(db *eodb.DB, elems map[int]types.Empty) (string, bool, string)

func ElemCreateSize

func ElemCreateSize(parents []int, db *eodb.DB) (int, bool, string)

func NewNotationTree

func NewNotationTree(db *eodb.DB) *notationTree

Types

type BreakDownTree

type BreakDownTree struct {
	Added     map[int]types.Empty
	DB        *eodb.DB
	Breakdown map[string]int // map[userid]count
	Total     int
	Tree      bool
}

func (*BreakDownTree) AddElem

func (b *BreakDownTree) AddElem(elem int, noerror ...bool) (bool, string)

func (*BreakDownTree) GetStringArr

func (b *BreakDownTree) GetStringArr() []string

type Graph

type Graph struct {
	DB *eodb.DB
	// contains filtered or unexported fields
}

func NewGraph

func NewGraph(db *eodb.DB) (*Graph, error)

func (*Graph) AddElem

func (g *Graph) AddElem(elem int, special bool) (string, bool)

func (*Graph) Close

func (g *Graph) Close(special bool, splines string)

func (*Graph) NodeCount

func (g *Graph) NodeCount() int

func (*Graph) Render

func (g *Graph) Render(special bool, layout graphviz.Layout, format graphviz.Format) (*bytes.Buffer, error)

func (*Graph) String

func (g *Graph) String(special bool, splines string) string

type InfoTree

type InfoTree struct {
	Total int
	Found int

	DB *eodb.DB
	// contains filtered or unexported fields
}

func CalcElemInfo

func CalcElemInfo(elem int, user string, db *eodb.DB) (bool, string, InfoTree)

func (*InfoTree) AddElem

func (i *InfoTree) AddElem(elem int, unlock ...bool) (bool, string)

type SizeTree

type SizeTree struct {
	Size int
	// contains filtered or unexported fields
}

func NewSizeTree

func NewSizeTree(db *eodb.DB) *SizeTree

func (*SizeTree) AddElem

func (s *SizeTree) AddElem(elem int, notoplevel ...bool) (bool, string)

type Tree

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

Tree calculator

func (*Tree) AddElem

func (t *Tree) AddElem(elem int) (bool, string)

type WordTree

type WordTree struct {
	CalcTree bool
	// contains filtered or unexported fields
}

func NewWordTree

func NewWordTree(db *eodb.DB) *WordTree

func (*WordTree) AddElem

func (w *WordTree) AddElem(elem int, notoplevel ...bool) (bool, string)

func (*WordTree) Render

func (w *WordTree) Render(width, height int) image.Image

Jump to

Keyboard shortcuts

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