mermaid

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT Imports: 4 Imported by: 0

README

mermaid package

Very basic Mermaid support. Currently limited to flowcharts without any settings.

Documentation

Index

Constants

View Source
const HTMLScript = `` /* 146-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	From *Node // Pointer to the Node where the Edge starts.
	To   *Node // Pointer to the Node where the Edge ends.
}

type Flowchart

type Flowchart struct {
	Direction string
	Nodes     map[string]*Node
	Edges     []*Edge
	Settings  *Settings
}

func NewFlowchart

func NewFlowchart(settings *Settings) *Flowchart

func (*Flowchart) AddBasicNode

func (flowchart *Flowchart) AddBasicNode(name string)

func (*Flowchart) AddEdgeByNames

func (flowchart *Flowchart) AddEdgeByNames(from string, to string)

func (*Flowchart) RenderString

func (flowchart *Flowchart) RenderString() string

type GanttSettings

type GanttSettings struct {
	LabelColumn     string
	StartDateColumn string
	DurationColumn  string
	StatusColumn    string
}

type Ganttchart

type Ganttchart struct {
	Settings   *Settings
	Title      string
	DateFormat string
	AxisFormat string
	Sections   map[string]*GanttchartSection
}

func NewGanttchart

func NewGanttchart(settings *Settings) *Ganttchart

func (*Ganttchart) GetDefaultSection

func (chart *Ganttchart) GetDefaultSection() *GanttchartSection

func (*Ganttchart) RenderString

func (chart *Ganttchart) RenderString() string

type GanttchartSection

type GanttchartSection struct {
	Title string
	Tasks []GanttchartTask
}

func (*GanttchartSection) AddTask

func (section *GanttchartSection) AddTask(title string, startdate string, duration string, status string)

type GanttchartTask

type GanttchartTask struct {
	Title     string
	StartDate string
	Duration  string
	Status    string
}

type MermaidChart

type MermaidChart interface {
	RenderString() string
}

type Node

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

type PieChart

type PieChart struct {
	Settings *Settings
	Title    string
	Values   []PieChartValue
	ShowData bool
}

func NewPiechart

func NewPiechart(settings *Settings) *PieChart

func (*PieChart) AddValue

func (piechart *PieChart) AddValue(label string, value float64)

func (*PieChart) RenderString

func (piechart *PieChart) RenderString() string

type PieChartValue

type PieChartValue struct {
	Label string
	Value float64
}

type Settings

type Settings struct {
	AddMarkdown   bool
	AddHTML       bool
	ChartType     string
	GanttSettings *GanttSettings
}

func (*Settings) Footer

func (settings *Settings) Footer() string

func (*Settings) Header

func (settings *Settings) Header() string

func (*Settings) HtmlFooter

func (settings *Settings) HtmlFooter() string

func (*Settings) HtmlHeader

func (settings *Settings) HtmlHeader() string

func (*Settings) MarkdownFooter

func (settings *Settings) MarkdownFooter() string

func (*Settings) MarkdownHeader

func (settings *Settings) MarkdownHeader() string

Jump to

Keyboard shortcuts

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