Dagger
Search

diagrams

This module provides you the ability to pass in your diagram script language and get an image back.

The first language supported is D2 (https://d2lang.com/). Mermaid support is in progress.

Installation

dagger install github.com/marvinmartian/daggerverse/diagrams@abdd0af1688d8de443435c811eed3ba6bb53a081

Entrypoint

Return Type
Diagrams
Example
func (m *myModule) example() *Diagrams  {
	return dag.
			Diagrams()
}

Types

Diagrams 🔗

build() 🔗

Build the base images

Return Type
Container !
Example
func (m *myModule) example() *Container  {
	return dag.
			Diagrams().
			Build()
}

base() 🔗

Setup base image

Return Type
Container !
Example
func (m *myModule) example() *Container  {
	return dag.
			Diagrams().
			Base()
}

d2() 🔗

Generate diagram using D2

Return Type
D2 !
Example
func (m *myModule) example() *DiagramsD2  {
	return dag.
			Diagrams().
			D2()
}

D2 🔗

container() 🔗

Return Type
Container !
Example
func (m *myModule) example() *Container  {
	return dag.
			Diagrams().
			D2().
			Container()
}

render() 🔗

Render diagram text to image

Return Type
File !
Arguments
NameTypeDefault ValueDescription
fileFile !-File to render with D2
themeString !"100"Theme to use for render
formatString !"svg"Export format
animateIntervalString -Animation interval timing for animated SVG exports
Example
func (m *myModule) example(file *File, theme string, format string) *File  {
	return dag.
			Diagrams().
			D2().
			Render(file, theme, format)
}

themes() 🔗

List available themes

Return Type
String !
Example
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Diagrams().
			D2().
			Themes(ctx)
}