d2ascii

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: MPL-2.0 Imports: 10 Imported by: 1

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

func NewBoundary(tl, br Point) *Boundary

type Point

type Point = asciiroute.Point

type RenderOpts

type RenderOpts struct {
	Scale   *float64
	Charset charset.Type
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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