flowchart

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package flowchart provides a simple way to create flowcharts in mermaid syntax.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flowchart

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

Flowchart is a flowchart builder.

func NewFlowchart

func NewFlowchart(w io.Writer, opts ...Option) *Flowchart

NewFlowchart returns a new Flowchart.

func (*Flowchart) AsymmetricNode

func (f *Flowchart) AsymmetricNode(name, text string) *Flowchart

AsymmetricNode adds a node with asymmetric shape to the flowchart.

func (*Flowchart) Build

func (f *Flowchart) Build() error

Build writes the flowchart body to the output destination.

func (*Flowchart) CircleNode

func (f *Flowchart) CircleNode(name, text string) *Flowchart

CircleNode adds a node with circle shape to the flowchart.

func (*Flowchart) CylindricalNode

func (f *Flowchart) CylindricalNode(name, text string) *Flowchart

CylindricalNode adds a node with cylindrical shape to the flowchart.

func (*Flowchart) DatabaseNode

func (f *Flowchart) DatabaseNode(name, text string) *Flowchart

DatabaseNode adds a node with database shape to the flowchart. This method is same as CylindricalShapeNode()

func (f *Flowchart) DottedLink(from, to string) *Flowchart

DottedLink adds a dotted link to the flowchart.

func (*Flowchart) DottedLinkWithText

func (f *Flowchart) DottedLinkWithText(from, to, text string) *Flowchart

DottedLinkWithText adds a dotted link with text to the flowchart.

func (*Flowchart) DoubleCircleNode

func (f *Flowchart) DoubleCircleNode(name, text string) *Flowchart

DoubleCircleNode adds a node with double circle shape to the flowchart.

func (*Flowchart) HexagonNode

func (f *Flowchart) HexagonNode(name, text string) *Flowchart

HexagonNode adds a node with hexagon shape to the flowchart.

func (f *Flowchart) InvisibleLink(from, to string) *Flowchart

InvisibleLink adds an invisible link to the flowchart.

func (*Flowchart) LinkWithArrowHead

func (f *Flowchart) LinkWithArrowHead(from, to string) *Flowchart

LinkWithArrowHead adds a link with an arrow head to the flowchart.

func (*Flowchart) LinkWithArrowHeadAndText

func (f *Flowchart) LinkWithArrowHeadAndText(from, to, text string) *Flowchart

LinkWithArrowHeadAndText adds a link with an arrow head and text to the flowchart.

func (*Flowchart) Node

func (f *Flowchart) Node(name string) *Flowchart

Node adds a node to the flowchart.

func (*Flowchart) NodeWithMarkdown

func (f *Flowchart) NodeWithMarkdown(name, markdownText string) *Flowchart

NodeWithMarkdown adds a node with markdown text to the flowchart.

func (*Flowchart) NodeWithNewLines

func (f *Flowchart) NodeWithNewLines(name, textWithNewLines string) *Flowchart

NodeWithNewLines adds a node with new lines to the flowchart.

func (*Flowchart) NodeWithText

func (f *Flowchart) NodeWithText(name, text string) *Flowchart

NodeWithText adds a node with text to the flowchart. Unicode characters are supported.

func (f *Flowchart) OpenLink(from, to string) *Flowchart

OpenLink adds an open link to the flowchart.

func (*Flowchart) OpenLinkWithText

func (f *Flowchart) OpenLinkWithText(from, to, text string) *Flowchart

OpenLinkWithText adds an open link with text to the flowchart.

func (*Flowchart) ParallelogramAltNode

func (f *Flowchart) ParallelogramAltNode(name, text string) *Flowchart

ParallelogramAltNode adds a node with parallelogram shape to the flowchart.

func (*Flowchart) ParallelogramNode

func (f *Flowchart) ParallelogramNode(name, text string) *Flowchart

ParallelogramNode adds a node with parallelogram shape to the flowchart.

func (*Flowchart) RhombusNode

func (f *Flowchart) RhombusNode(name, text string) *Flowchart

RhombusNode adds a node with rhombus shape to the flowchart.

func (*Flowchart) RoundEdgesNode

func (f *Flowchart) RoundEdgesNode(name, text string) *Flowchart

RoundEdgesNode adds a node with round edges to the flowchart.

func (*Flowchart) StadiumNode

func (f *Flowchart) StadiumNode(name, text string) *Flowchart

StadiumNode adds a node with stadium shape to the flowchart.

func (*Flowchart) String

func (f *Flowchart) String() string

String returns the flowchart body.

func (*Flowchart) SubroutineNode

func (f *Flowchart) SubroutineNode(name, text string) *Flowchart

SubroutineNode adds a node with subroutine shape to the flowchart.

func (f *Flowchart) ThickLink(from, to string) *Flowchart

ThickLink adds a thick link to the flowchart.

func (*Flowchart) ThickLinkWithText

func (f *Flowchart) ThickLinkWithText(from, to, text string) *Flowchart

ThickLinkWithText adds a thick link with text to the flowchart.

func (*Flowchart) TrapezoidAltNode

func (f *Flowchart) TrapezoidAltNode(name, text string) *Flowchart

TrapezoidAltNode adds a node with trapezoid shape to the flowchart.

func (*Flowchart) TrapezoidNode

func (f *Flowchart) TrapezoidNode(name, text string) *Flowchart

TrapezoidNode adds a node with trapezoid shape to the flowchart.

type Option

type Option func(*config)

Option sets the options for the Flowchart struct.

func WithOrientalBottomToTop

func WithOrientalBottomToTop() Option

WithOrientalBottomToTop sets the oriental configuration to bottom to top.

func WithOrientalLeftToRight

func WithOrientalLeftToRight() Option

WithOrientalLeftToRight sets the oriental configuration to left to right.

func WithOrientalRightToLeft

func WithOrientalRightToLeft() Option

WithOrientalRightToLeft sets the oriental configuration to right to left.

func WithOrientalTopDown

func WithOrientalTopDown() Option

WithOrientalTopDown sets the oriental configuration to top down. Same as top to bottom.

func WithOrientalTopToBottom

func WithOrientalTopToBottom() Option

WithOrientalTopToBottom sets the oriental configuration to top to bottom.

func WithTitle

func WithTitle(title string) Option

WithTitle sets the title configuration.

Jump to

Keyboard shortcuts

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