package d2sketch

Import Path
	github.com/pancsta/d2/d2renderers/d2sketch (on go.dev)

Dependency Relation
	imports 16 packages, and imported by 2 packages

Involved Source Files scene.go scene_connection.go sketch.go
Package-Level Type Names (total 2)
/* sort by: | */
SceneLimits bounds conversion work after rough-go has generated a drawable. D2 callers must additionally charge the generated commands against their document-wide scene/path budget. MaxOps int MaxSets int func CompileScenePaths(ctx context.Context, drawable rough.Drawable, limits SceneLimits) ([]ScenePath, error) func ConnectionDrawable(ctx context.Context, path d2scene.Path, limits SceneLimits) (rough.Drawable, error)
ScenePath is the renderer-neutral form of one ordered rough-go operation set. Paint remains a string so callers can resolve D2 theme colors before constructing scene paint. Dash []float64 DashOffset float64 Fill string Path d2scene.Path Stroke string StrokeWidth float64 func CompileScenePaths(ctx context.Context, drawable rough.Drawable, limits SceneLimits) ([]ScenePath, error)
Package-Level Functions (total 14)
ArrowheadDrawables returns the bounded, structured rough-go geometry for one D2 arrowhead. Every generator input has a fixed number of points, and each endpoint gets a fresh seeded generator so output is independent of object or frame traversal order.
func Arrowheads(connection d2target.Connection, srcAdj, dstAdj *geo.Point) (string, error)
func Class(shape d2target.Shape) (string, error)
CompileScenePaths translates the rough-go operation types emitted by D2 into typed scene paths. It rejects path2D operation sets.
Connection is retained for source compatibility. Its legacy textual attribute list is parsed and re-serialized before use. Deprecated: use ConnectionWithAttributes.
ConnectionDrawable converts a typed connection path into deterministic rough-go operations without serializing or parsing SVG path data. Cubics are flattened at a fixed resolution before roughening; this keeps generation work predictable while retaining the route's rounded/curved silhouette. limits bound the rough intermediate before any expanded point slice is allocated. Long routes are generated in fixed-size sets so cancellation is observed between bounded rough-go calls.
func ConnectionWithAttributes(connection d2target.Connection, path string, attributes []svg.Attribute) (string, error)
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(shape d2target.Shape, diagramHash string) (string, error)
func DoubleRect(shape d2target.Shape, diagramHash string) (string, error)
func Oval(shape d2target.Shape, diagramHash string) (string, error)
TODO need to personalize this per shape like we do in Terrastruct app
func Rect(shape d2target.Shape, diagramHash string) (string, error)
TODO cleanup
Package-Level Constants (total 2)
const BG_COLOR = "N7"
const FG_COLOR = "N1"