d2render

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 34 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package d2render draws a Scene with D2. It is the only package that imports D2; nothing of D2 crosses the render.Renderer boundary.

The adapter prepares what D2 is given (the script and the measured size of every label) and settles the contents of each card. Where D2 puts the cards, the lines, and the labels of the lines is drawn as D2 gives it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Version

func Version() string

Version is the version of the D2 module linked into the binary, or unknown for a binary that carries no module information.

Types

type Renderer

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

func New

func New(set assets.Set) (*Renderer, error)

New gives a Renderer that draws with the icons of set and with the fonts of the first set a Renderer of the process was made with. The tool has one set.

func (*Renderer) Render

func (r *Renderer) Render(ctx context.Context, scene *view.Scene, opts render.Options) (*render.Result, error)

Jump to

Keyboard shortcuts

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