d2target

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MPL-2.0 Imports: 20 Imported by: 5 modules, 3 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

Index

Constants

View Source
const (
	PrefixPadding = 10
	PrefixWidth   = 20
	CenterPadding = 50
	// 10px of padding top and bottom so text doesn't look squished
	VerticalPadding = 20
)
View Source
const (
	DEFAULT_SHAPE_STROKE_WIDTH = 2

	DEFAULT_ICON_SIZE = 32
	MAX_ICON_SIZE     = 64

	SHADOW_SIZE_X    = 3
	SHADOW_SIZE_Y    = 5
	THREE_DEE_OFFSET = 15
	MULTIPLE_OFFSET  = 10

	INNER_BORDER_OFFSET = 5

	BG_COLOR = color.N7
	FG_COLOR = color.N1

	MIN_ARROWHEAD_STROKE_WIDTH = 2
	ARROWHEAD_PADDING          = 2.

	CONNECTION_ICON_LABEL_GAP = 8
)
View Source
const (
	MaxTweenDurationMS = 600_000
	MaxTweenFrames     = 120
)

Limits shared by D2 source compilation and callers supplying sampled targets.

View Source
const (
	ShapeRectangle       = "rectangle"
	ShapeSquare          = "square"
	ShapePage            = "page"
	ShapeParallelogram   = "parallelogram"
	ShapeDocument        = "document"
	ShapeCylinder        = "cylinder"
	ShapeQueue           = "queue"
	ShapePackage         = "package"
	ShapeStep            = "step"
	ShapeCallout         = "callout"
	ShapeStoredData      = "stored_data"
	ShapePerson          = "person"
	ShapeC4Person        = "c4-person"
	ShapeDiamond         = "diamond"
	ShapeOval            = "oval"
	ShapeCircle          = "circle"
	ShapeHexagon         = "hexagon"
	ShapeCloud           = "cloud"
	ShapeText            = "text"
	ShapeCode            = "code"
	ShapeClass           = "class"
	ShapeSQLTable        = "sql_table"
	ShapeImage           = "image"
	ShapeSequenceDiagram = "sequence_diagram"
	ShapeHierarchy       = "hierarchy"
)
View Source
const (
	NamePadding       = 10
	TypePadding       = 20
	ConstraintPadding = 20
	HeaderPadding     = 10

	// Setting table font size sets it for columns
	// The header needs to be a little larger for visual hierarchy
	HeaderFontAdd = 4
)
View Source
const (

	// MaxRenderTargetBoards includes authored boards and their tween samples.
	MaxRenderTargetBoards = 16_384
)

Variables

valid values for arrowhead.shape

View Source
var BorderOffset = geo.NewVector(5, 5)
View Source
var SHAPE_TYPE_TO_DSL_SHAPE map[string]string

Functions

func CalculateTooltipPosition

func CalculateTooltipPosition(shapeX, shapeY, shapeWidth, shapeHeight float64, tooltipWidth, tooltipHeight int, position string) (x, y float64)

func ConnectionCrossings added in v0.10.0

func ConnectionCrossings(connections []Connection, shapes map[string]Shape, sketch bool, strokeVisible func(string) bool) [][]ConnectionGap

ConnectionCrossings returns one list for each input connection in original diagram order. A higher z-index passes in front; ties use stable paint order.

func GetIconSize

func GetIconSize(box *geo.Box, position string) int

func IsShape

func IsShape(s string) bool

func StrokeWidthExtent added in v0.10.0

func StrokeWidthExtent(width int, offset float64) int

StrokeWidthExtent rounds a validated stroke outward for integer layout bounds.

func TweenFrameCount added in v0.10.0

func TweenFrameCount(durationMS int) int

TweenFrameCount samples at 25 fps up to the per-transition frame limit.

func ValidStrokeWidthOffset added in v0.10.0

func ValidStrokeWidthOffset(width int, offset float64) bool

ValidStrokeWidthOffset checks that the fractional part of an animated stroke preserves a nonnegative width and an outward bound representable as an int.

func ValidateRenderTarget added in v0.10.0

func ValidateRenderTarget(root *Diagram) error

ValidateRenderTarget checks the invariants required by renderers which consume Diagram JSON directly. Compiler output already satisfies these invariants, but callers of the public render API can construct a Diagram without going through the compiler.

Types

type Arrowhead

type Arrowhead string
const (
	NoArrowhead               Arrowhead = "none"
	ArrowArrowhead            Arrowhead = "arrow"
	UnfilledTriangleArrowhead Arrowhead = "unfilled-triangle"
	TriangleArrowhead         Arrowhead = "triangle"
	DiamondArrowhead          Arrowhead = "diamond"
	FilledDiamondArrowhead    Arrowhead = "filled-diamond"
	CircleArrowhead           Arrowhead = "circle"
	FilledCircleArrowhead     Arrowhead = "filled-circle"
	CrossArrowhead            Arrowhead = "cross"
	BoxArrowhead              Arrowhead = "box"
	FilledBoxArrowhead        Arrowhead = "filled-box"

	// For fat arrows
	LineArrowhead Arrowhead = "line"

	// Crows feet notation
	CfOne          Arrowhead = "cf-one"
	CfMany         Arrowhead = "cf-many"
	CfOneRequired  Arrowhead = "cf-one-required"
	CfManyRequired Arrowhead = "cf-many-required"

	DefaultArrowhead Arrowhead = TriangleArrowhead
)

func ToArrowhead

func ToArrowhead(arrowheadType string, filled *bool) Arrowhead

func (Arrowhead) Dimensions

func (arrowhead Arrowhead) Dimensions(strokeWidth float64) (width, height float64)

type Class

type Class struct {
	Fields  []ClassField  `json:"fields"`
	Methods []ClassMethod `json:"methods"`
}

type ClassField

type ClassField struct {
	Name       string `json:"name"`
	Type       string `json:"type"`
	Visibility string `json:"visibility"`
	Underline  bool   `json:"underline"`
}

func (ClassField) Text

func (cf ClassField) Text(fontSize int) *MText

func (ClassField) VisibilityToken

func (cf ClassField) VisibilityToken() string

type ClassMethod

type ClassMethod struct {
	Name       string `json:"name"`
	Return     string `json:"return"`
	Visibility string `json:"visibility"`
	Underline  bool   `json:"underline"`
}

func (ClassMethod) Text

func (cm ClassMethod) Text(fontSize int) *MText

func (ClassMethod) VisibilityToken

func (cm ClassMethod) VisibilityToken() string

type Config

type Config struct {
	AnimateInterval    *int64          `json:"animateInterval,omitempty"` // Milliseconds per board.
	AnimateDuration    *int64          `json:"animateDuration,omitempty"` // Milliseconds to interpolate step values.
	Scale              *float64        `json:"scale,omitempty"`
	ForceAppendix      *bool           `json:"forceAppendix,omitempty"`
	Sketch             *bool           `json:"sketch"`
	ThemeID            *int64          `json:"themeID"`
	DarkThemeID        *int64          `json:"darkThemeID"`
	Pad                *int64          `json:"pad"`
	Center             *bool           `json:"center"`
	LayoutEngine       *string         `json:"layoutEngine"`
	ThemeOverrides     *ThemeOverrides `json:"themeOverrides,omitempty"`
	DarkThemeOverrides *ThemeOverrides `json:"darkThemeOverrides,omitempty"`
	// Data is a data structure for holding user-defined data
	// useful for layout engines that allow users to configure within source code
	Data map[string]interface{} `json:"data,omitempty"`
}

func (*Config) ResolveAnimateInterval added in v0.10.0

func (c *Config) ResolveAnimateInterval(override *int64) *int64

ResolveAnimateInterval returns the explicit render setting, falling back to the source configuration. A nil result leaves the output format's default intact.

func (*Config) ResolveForceAppendix added in v0.10.0

func (c *Config) ResolveForceAppendix(override *bool) *bool

ResolveForceAppendix preserves an explicit false when the source enables footnotes.

type Connection

type Connection struct {
	ID string `json:"id"`

	MotionClip  *MotionClip  `json:"motionClip,omitempty"`
	MotionLabel *MotionLabel `json:"motionLabel,omitempty"`
	// MotionTip marks the free end of a partially drawn connection.
	MotionTip TraceEndpoint `json:"motionTip,omitempty"`
	// MotionDashOffset pins a backward trace’s dashes to its stationary end.
	MotionDashOffset float64 `json:"motionDashOffset,omitempty"`

	Classes []string `json:"classes,omitempty"`

	Src      string    `json:"src"`
	SrcArrow Arrowhead `json:"srcArrow"`
	SrcLabel *Text     `json:"srcLabel,omitempty"`

	Dst      string    `json:"dst"`
	DstArrow Arrowhead `json:"dstArrow"`
	DstLabel *Text     `json:"dstLabel,omitempty"`

	Opacity     float64 `json:"opacity"`
	StrokeDash  float64 `json:"strokeDash"`
	StrokeWidth int     `json:"strokeWidth"`
	// Tween frames retain the subpixel difference from the integer layout width.
	StrokeWidthOffset float64 `json:"strokeWidthOffset,omitempty"`
	Stroke            string  `json:"stroke"`
	Fill              string  `json:"fill,omitempty"`
	BorderRadius      float64 `json:"borderRadius,omitempty"`

	Text
	LabelPosition   string  `json:"labelPosition"`
	LabelPercentage float64 `json:"labelPercentage"`

	Link       string `json:"link"`
	PrettyLink string `json:"prettyLink,omitempty"`

	Route   []*geo.Point `json:"route"`
	IsCurve bool         `json:"isCurve,omitempty"`

	Animated         bool     `json:"animated"`
	Tooltip          string   `json:"tooltip"`
	Icon             *url.URL `json:"icon"`
	IconPosition     string   `json:"iconPosition,omitempty"`
	IconBorderRadius float64  `json:"iconBorderRadius,omitempty"`

	ZIndex int `json:"zIndex"`
}

func BaseConnection

func BaseConnection() *Connection

func (Connection) ArrowheadAdjustments added in v0.10.0

func (c Connection) ArrowheadAdjustments(shapes map[string]Shape) (src, dst *geo.Point)

ArrowheadAdjustments inset the centerline's endpoints for the strokes and markers.

func (Connection) ArrowheadAdjustmentsForWidths added in v0.10.0

func (c Connection) ArrowheadAdjustmentsForWidths(srcWidth, dstWidth float64) (src, dst *geo.Point)

ArrowheadAdjustmentsForWidths uses the current stroke widths of the two endpoint shapes.

func (Connection) CSSStyle

func (c Connection) CSSStyle() string

func (*Connection) GetArrowheadLabelPosition

func (connection *Connection) GetArrowheadLabelPosition(isDst bool) *geo.Point

func (Connection) GetFontColor

func (c Connection) GetFontColor() string

func (Connection) GetID

func (c Connection) GetID() string

func (*Connection) GetIconPosition

func (c *Connection) GetIconPosition() *geo.Point

func (*Connection) GetLabelTopLeft

func (c *Connection) GetLabelTopLeft() *geo.Point

func (Connection) GetZIndex

func (c Connection) GetZIndex() int

func (Connection) GradientBounds added in v0.10.0

func (c Connection) GradientBounds() *geo.Box

GradientBounds anchors a connection's stroke paint to its full route, before the shaft is shortened for arrowheads. Even a straight horizontal or vertical connection needs a paintable cross section for its stroke and markers.

func (Connection) PathCommands added in v0.10.0

func (c Connection) PathCommands(srcAdj, dstAdj *geo.Point) iter.Seq[ConnectionPathCommand]

PathCommands walks the final routed path, including arrowhead insets and rounded polyline corners. Consumers must first validate the render target.

func (Connection) RenderedStrokeWidth added in v0.10.0

func (c Connection) RenderedStrokeWidth() float64

type ConnectionGap added in v0.10.0

type ConnectionGap struct {
	Center geo.Point
	Radius float64
}

ConnectionGap is a transparent opening in an individual connection stroke.

type ConnectionPathCommand added in v0.10.0

type ConnectionPathCommand struct {
	Kind                    byte
	Control1, Control2, End geo.Point
}

ConnectionPathCommand is an absolute M, L, C, or S command on the rendered centerline. Cubics include both control points, including the implicit first control of an S command.

type Diagram

type Diagram struct {
	Name   string  `json:"name"`
	Config *Config `json:"config,omitempty"`
	// See docs on the same field in d2graph to understand what it means.
	IsFolderOnly   bool                `json:"isFolderOnly"`
	Description    string              `json:"description,omitempty"`
	FontFamily     *d2fonts.FontFamily `json:"fontFamily,omitempty"`
	MonoFontFamily *d2fonts.FontFamily `json:"monoFontFamily,omitempty"`

	Shapes      []Shape      `json:"shapes"`
	Connections []Connection `json:"connections"`

	Root   Shape   `json:"root"`
	Legend *Legend `json:"legend,omitempty"`

	Layers    []*Diagram `json:"layers,omitempty"`
	Scenarios []*Diagram `json:"scenarios,omitempty"`
	Steps     []*Diagram `json:"steps,omitempty"`

	// TweenFrames are samples of this board's incoming transition,
	// starting at time zero. The board itself supplies the exact endpoint.
	TweenFrames     []*Diagram `json:"tweenFrames,omitempty"`
	TweenDurationMS int        `json:"tweenDurationMS,omitempty"`
	// TweenFrameEndsMS holds exclusive sample ends for nonuniform playback.
	// The authored endpoint takes over when the final sample ends.
	// Omit it for uniformly spaced samples.
	TweenFrameEndsMS []int `json:"tweenFrameEndsMS,omitempty"`
	// GridMotion keeps a common coordinate system for raster playback as cells reflow.
	GridMotion bool `json:"gridMotion,omitempty"`
	// LayoutContinuity means the board shares layout coordinates with its
	// parent scenario base or the preceding step. Independent layers start
	// their own coordinate system.
	LayoutContinuity bool `json:"layoutContinuity,omitempty"`
}

func NewDiagram

func NewDiagram() *Diagram

func (Diagram) BoundingBox

func (diagram Diagram) BoundingBox() (topLeft, bottomRight Point)

func (Diagram) Bytes

func (diagram Diagram) Bytes() ([]byte, error)

func (*Diagram) GetBoard

func (d *Diagram) GetBoard(boardPath []string) *Diagram

func (Diagram) GetCorpus

func (diagram Diagram) GetCorpus() string

func (Diagram) GetNestedCorpus

func (diagram Diagram) GetNestedCorpus() string

func (Diagram) HasShape

func (diagram Diagram) HasShape(condition func(Shape) bool) bool

func (Diagram) HashID

func (diagram Diagram) HashID(salt *string) (string, error)

func (Diagram) NestedBoundingBox

func (diagram Diagram) NestedBoundingBox() (topLeft, bottomRight Point)

type Legend

type Legend struct {
	Label       string       `json:"label,omitempty"`
	Shapes      []Shape      `json:"shapes,omitempty"`
	Connections []Connection `json:"connections,omitempty"`
}

type MText

type MText struct {
	Text        string `json:"text"`
	FontSize    int    `json:"fontSize"`
	IsBold      bool   `json:"isBold"`
	IsItalic    bool   `json:"isItalic"`
	IsUnderline bool   `json:"isUnderline"`
	Language    string `json:"language"`
	Shape       string `json:"shape"`

	Dimensions TextDimensions `json:"dimensions,omitempty"`
}

func (MText) GetColor

func (text MText) GetColor(isItalic bool) string

type MarkdownStrikeTransition added in v0.10.0

type MarkdownStrikeTransition struct {
	From     string  `json:"from"`
	Progress float64 `json:"progress"`
	// On a plain destination these are the struck ranges of its shaped line,
	// in fractions of the total advance. Its own renderer paints the glyphs.
	PlainRanges [][2]float64 `json:"plainRanges,omitempty"`
}

MarkdownStrikeTransition retains the previous markup when only strikethrough spans change.

func (*MarkdownStrikeTransition) PlainRules added in v0.10.0

func (t *MarkdownStrikeTransition) PlainRules(left, baseline, width, fontSize float64, draw func(x, y, width, height float64))

type MotionBox added in v0.10.0

type MotionBox = MotionClip

MotionBox holds reference bounds in diagram coordinates during an animation.

type MotionClip added in v0.10.0

type MotionClip struct {
	Point
	Width  int `json:"width"`
	Height int `json:"height"`
}

MotionClip is the visible rectangle of an unfolding grid cell, in diagram coordinates.

type MotionLabel added in v0.10.0

type MotionLabel struct {
	Point
	Opacity float64 `json:"opacity"`
}

MotionLabel anchors the caption and its mask while a partial route is drawn.

type Point

type Point struct {
	X int `json:"x"`
	Y int `json:"y"`
}

func NewPoint

func NewPoint(x, y int) Point

type SQLColumn

type SQLColumn struct {
	Name       Text     `json:"name"`
	Type       Text     `json:"type"`
	Constraint []string `json:"constraint"`
	Reference  string   `json:"reference"`
}

func (SQLColumn) ConstraintAbbr

func (c SQLColumn) ConstraintAbbr() string

func (SQLColumn) Texts

func (c SQLColumn) Texts(fontSize int) []*MText

type SQLRowReveal added in v0.10.0

type SQLRowReveal struct {
	FullHeight int `json:"fullHeight"`
}

SQLRowReveal fixes row spacing at the authored height while the table's moving bottom edge uncovers each appended row.

type SQLTable

type SQLTable struct {
	Columns []SQLColumn `json:"columns"`
}

func (*SQLTable) AppendsRowsTo added in v0.10.0

func (t *SQLTable) AppendsRowsTo(old *SQLTable, oldHeight, newHeight int) bool

AppendsRowsTo reports whether adding fields preserves existing row spacing and the horizontal alignment of the type column.

type Shape

type Shape struct {
	ID   string `json:"id"`
	Type string `json:"type"`

	Classes []string `json:"classes,omitempty"`

	// Only intermediate grid frames carry a viewport, caption anchor or LaTeX scale.
	MotionScale        float64     `json:"motionScale,omitempty"`
	MotionClip         *MotionClip `json:"motionClip,omitempty"`
	MotionLabelTopLeft *Point      `json:"motionLabelTopLeft,omitempty"`
	// MotionLabelBox holds the authored body bounds for a stationary inside label.
	MotionLabelBox *MotionBox    `json:"motionLabelBox,omitempty"`
	RowReveal      *SQLRowReveal `json:"rowReveal,omitempty"`
	// OutlineProgress traces an incoming container frame in a transition sample.
	OutlineProgress *float64 `json:"outlineProgress,omitempty"`

	Pos    Point `json:"pos"`
	Width  int   `json:"width"`
	Height int   `json:"height"`

	Opacity     float64 `json:"opacity"`
	StrokeDash  float64 `json:"strokeDash"`
	StrokeWidth int     `json:"strokeWidth"`
	// Tween frames retain the subpixel difference from the integer layout width.
	StrokeWidthOffset float64 `json:"strokeWidthOffset,omitempty"`

	BorderRadius int `json:"borderRadius"`

	Fill                 string                `json:"fill"`
	FillPattern          string                `json:"fillPattern,omitempty"`
	SketchFillTransition *SketchFillTransition `json:"sketchFillTransition,omitempty"`
	Stroke               string                `json:"stroke"`

	Animated     bool `json:"animated"`
	Shadow       bool `json:"shadow"`
	ThreeDee     bool `json:"3d"`
	Multiple     bool `json:"multiple"`
	DoubleBorder bool `json:"double-border"`

	Tooltip          string   `json:"tooltip"`
	Link             string   `json:"link"`
	PrettyLink       string   `json:"prettyLink,omitempty"`
	Icon             *url.URL `json:"icon"`
	IconBorderRadius int      `json:"iconBorderRadius,omitempty"`
	IconPosition     string   `json:"iconPosition"`

	// Whether the shape should allow shapes behind it to bleed through
	// Currently just used for sequence diagram groups
	Blend bool `json:"blend"`

	Class
	SQLTable

	ContentAspectRatio *float64 `json:"contentAspectRatio,omitempty"`

	Text

	LabelPosition   string `json:"labelPosition,omitempty"`
	TooltipPosition string `json:"tooltipPosition,omitempty"`

	ZIndex int `json:"zIndex"`
	Level  int `json:"level"`

	// These are used for special shapes, sql_table and class
	PrimaryAccentColor   string `json:"primaryAccentColor,omitempty"`
	SecondaryAccentColor string `json:"secondaryAccentColor,omitempty"`
	NeutralAccentColor   string `json:"neutralAccentColor,omitempty"`
}

func BaseShape

func BaseShape() *Shape

func (Shape) AppendixLinkText added in v0.10.0

func (s Shape) AppendixLinkText() string

AppendixLinkText returns the text listed in a static export's appendix for the shape's link, or "" when the shape has no link. Every shape with a Link gets a numbered link marker, so it must also get an appendix entry: when no board label could be derived for PrettyLink (e.g. a link to the parent board), the link itself is listed so the marker and appendix numbers stay in one sequence.

func (Shape) CSSStyle

func (s Shape) CSSStyle() string

TODO remove this function, just set fields on themeable

func (*Shape) CanDrawOutline added in v0.10.0

func (s *Shape) CanDrawOutline() bool

CanDrawOutline reports whether a plain rectangular body has one visible solid contour. Rounded, double and decorated contours keep their own paint.

func (*Shape) CanShadeSketchFill added in v0.10.0

func (s *Shape) CanShadeSketchFill() bool

CanShadeSketchFill reports whether the shape has a single solid sketch surface.

func (*Shape) DrawingOutline added in v0.10.0

func (s *Shape) DrawingOutline() bool

DrawingOutline selects partial geometry for intermediate frames. A complete frame goes through the ordinary closed-stroke renderer, including its joins.

func (*Shape) DrawnOutline added in v0.10.0

func (s *Shape) DrawnOutline() []geo.Point

DrawnOutline follows two equal-length strokes from the top center down the sides. Joining them through the common origin yields one open polyline in both SVG and raster, and keeps the stroke width constant as the frame grows.

func (*Shape) Geometry added in v0.10.0

func (s *Shape) Geometry() shape.Shape

Geometry returns the same outline and inner content box used for rendering.

func (Shape) GetFontColor

func (s Shape) GetFontColor() string

func (Shape) GetID

func (s Shape) GetID() string

func (Shape) GetZIndex

func (s Shape) GetZIndex() int

func (*Shape) IconBounds added in v0.10.0

func (s *Shape) IconBounds(outline shape.Shape) *geo.Box

IconBounds returns the rendered icon rectangle for a shape with an icon.

func (*Shape) LabelTopLeft added in v0.10.0

func (s *Shape) LabelTopLeft(position label.Position, box *geo.Box) *geo.Point

LabelTopLeft resolves both ordinary captions and intermediate animation anchors.

func (*Shape) OuterLabelBox added in v0.10.0

func (s *Shape) OuterLabelBox(box *geo.Box) *geo.Box

OuterLabelBox is the painted outline used to place outside and border labels.

func (Shape) RenderedStrokeWidth added in v0.10.0

func (s Shape) RenderedStrokeWidth() float64

func (*Shape) SQLRowDivider added in v0.10.0

func (s *Shape) SQLRowDivider(index int, y, radius float64) (bottom, inset float64, last bool)

SQLRowDivider keeps the separator and moving bottom border together.

func (*Shape) SQLRowHeight added in v0.10.0

func (s *Shape) SQLRowHeight() float64

func (*Shape) SQLRowVisibleHeight added in v0.10.0

func (s *Shape) SQLRowVisibleHeight(top, height float64) float64

SQLRowVisibleHeight is the portion of a row below its stationary top edge. While the slot opens, its contents travel with the bottom of the table.

func (*Shape) SetType

func (s *Shape) SetType(t string)

type SketchFillTransition added in v0.10.0

type SketchFillTransition struct {
	From     string  `json:"from"`
	To       string  `json:"to"`
	Progress float64 `json:"progress"`
}

SketchFillTransition describes the pencil shading on one sampled frame.

type Text

type Text struct {
	Label      string `json:"label"`
	FontSize   int    `json:"fontSize"`
	FontFamily string `json:"fontFamily"`
	Language   string `json:"language"`
	Color      string `json:"color"`

	Italic    bool `json:"italic"`
	Bold      bool `json:"bold"`
	Underline bool `json:"underline"`
	// UnderlineProgress is the visible fraction of the underline on a sampled frame.
	UnderlineProgress *float64                  `json:"underlineProgress,omitempty"`
	MarkdownStrike    *MarkdownStrikeTransition `json:"markdownStrike,omitempty"`

	LabelWidth  int    `json:"labelWidth"`
	LabelHeight int    `json:"labelHeight"`
	LabelFill   string `json:"labelFill,omitempty"`
}

type TextDimensions

type TextDimensions struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

func NewTextDimensions

func NewTextDimensions(w, h int) *TextDimensions

type ThemeOverrides

type ThemeOverrides struct {
	N1  *string `json:"n1"`
	N2  *string `json:"n2"`
	N3  *string `json:"n3"`
	N4  *string `json:"n4"`
	N5  *string `json:"n5"`
	N6  *string `json:"n6"`
	N7  *string `json:"n7"`
	B1  *string `json:"b1"`
	B2  *string `json:"b2"`
	B3  *string `json:"b3"`
	B4  *string `json:"b4"`
	B5  *string `json:"b5"`
	B6  *string `json:"b6"`
	AA2 *string `json:"aa2"`
	AA4 *string `json:"aa4"`
	AA5 *string `json:"aa5"`
	AB4 *string `json:"ab4"`
	AB5 *string `json:"ab5"`
}

type TraceEndpoint added in v0.10.0

type TraceEndpoint string

TraceEndpoint identifies which end of an animated polyline is still being drawn.

const (
	TraceSource      TraceEndpoint = "source"
	TraceDestination TraceEndpoint = "destination"
)

Jump to

Keyboard shortcuts

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