d2ascii

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MPL-2.0 Imports: 17 Imported by: 4 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

Set DEBUG_ASCII=1 environment variable to enable verbose ASCII rendering debug logs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASCIIartist

type ASCIIartist struct {
	FW float64
	FH float64

	SCALE float64
	// contains filtered or unexported fields
}

func NewASCIIartist

func NewASCIIartist() *ASCIIartist

func (*ASCIIartist) CalibrateXY

func (a *ASCIIartist) CalibrateXY(x, y float64) (float64, float64)

func (*ASCIIartist) GetBoundary

func (a *ASCIIartist) GetBoundary(s d2target.Shape) (Point, Point)

func (*ASCIIartist) GetBoundaryForShape

func (a *ASCIIartist) GetBoundaryForShape(s d2target.Shape) (asciiroute.Point, asciiroute.Point)

func (*ASCIIartist) GetCanvas

func (a *ASCIIartist) GetCanvas() *asciicanvas.Canvas

func (*ASCIIartist) GetChars

func (a *ASCIIartist) GetChars() charset.Set

func (*ASCIIartist) GetContext

func (a *ASCIIartist) GetContext() context.Context

func (*ASCIIartist) GetDiagram

func (a *ASCIIartist) GetDiagram() *d2target.Diagram

func (*ASCIIartist) GetFontHeight

func (a *ASCIIartist) GetFontHeight() float64

func (*ASCIIartist) GetFontWidth

func (a *ASCIIartist) GetFontWidth() float64

func (*ASCIIartist) GetScale

func (a *ASCIIartist) GetScale() float64

func (*ASCIIartist) Render

func (a *ASCIIartist) Render(ctx context.Context, diagram *d2target.Diagram, opts *RenderOpts) ([]byte, error)

type Boundary

type Boundary = asciiroute.Boundary

func NewBoundary deprecated

func NewBoundary(tl, br Point) *Boundary

NewBoundary constructs an ASCII routing boundary.

Deprecated: use asciiroute.NewBoundary. This forwarding function will be removed after one compatibility release.

type Point

type Point = asciiroute.Point

type RenderOpts

type RenderOpts struct {
	Scale   *float64
	Charset charset.Type
	// MaxCells bounds the dense canvas allocation. Zero leaves the size unrestricted.
	MaxCells int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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