d2sketch

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MPL-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

View Source
const (
	BG_COLOR = color.N7
	FG_COLOR = color.N1
)

Variables

This section is empty.

Functions

func ArrowheadJS added in v0.1.6

func ArrowheadJS(r *Runner, arrowhead d2target.Arrowhead, stroke string, strokeWidth int) (arrowJS, extraJS string)

func Arrowheads added in v0.1.6

func Arrowheads(r *Runner, connection d2target.Connection, srcAdj, dstAdj *geo.Point) (string, error)

func Class

func Class(r *Runner, shape d2target.Shape) (string, error)

func Connection

func Connection(r *Runner, connection d2target.Connection, path, attrs string) (string, error)

func DefineFillPatterns added in v0.2.1

func DefineFillPatterns(buf *bytes.Buffer)

DefineFillPatterns adds reusable patterns that are overlayed on shapes with fill. This gives it a subtle streaky effect that subtly looks hand-drawn but not distractingly so.

func DoubleOval added in v0.2.0

func DoubleOval(r *Runner, shape d2target.Shape) (string, error)

func DoubleRect added in v0.2.0

func DoubleRect(r *Runner, shape d2target.Shape) (string, error)

func Oval

func Oval(r *Runner, shape d2target.Shape) (string, error)

func Paths

func Paths(r *Runner, shape d2target.Shape, paths []string) (string, error)

TODO need to personalize this per shape like we do in Terrastruct app

func Rect

func Rect(r *Runner, shape d2target.Shape) (string, error)

func Table

func Table(r *Runner, shape d2target.Shape) (string, error)

TODO cleanup

Types

type Runner

type Runner goja.Runtime

func InitSketchVM

func InitSketchVM() (*Runner, error)

Jump to

Keyboard shortcuts

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