Documentation
¶
Index ¶
- Constants
- Variables
- func CalculateTooltipPosition(shapeX, shapeY, shapeWidth, shapeHeight float64, ...) (x, y float64)
- func ConnectionCrossings(connections []Connection, shapes map[string]Shape, sketch bool, ...) [][]ConnectionGap
- func GetIconSize(box *geo.Box, position string) int
- func IsShape(s string) bool
- func StrokeWidthExtent(width int, offset float64) int
- func TweenFrameCount(durationMS int) int
- func ValidStrokeWidthOffset(width int, offset float64) bool
- func ValidateRenderTarget(root *Diagram) error
- type Arrowhead
- type Class
- type ClassField
- type ClassMethod
- type Config
- type Connection
- func (c Connection) ArrowheadAdjustments(shapes map[string]Shape) (src, dst *geo.Point)
- func (c Connection) ArrowheadAdjustmentsForWidths(srcWidth, dstWidth float64) (src, dst *geo.Point)
- func (c Connection) CSSStyle() string
- func (connection *Connection) GetArrowheadLabelPosition(isDst bool) *geo.Point
- func (c Connection) GetFontColor() string
- func (c Connection) GetID() string
- func (c *Connection) GetIconPosition() *geo.Point
- func (c *Connection) GetLabelTopLeft() *geo.Point
- func (c Connection) GetZIndex() int
- func (c Connection) GradientBounds() *geo.Box
- func (c Connection) PathCommands(srcAdj, dstAdj *geo.Point) iter.Seq[ConnectionPathCommand]
- func (c Connection) RenderedStrokeWidth() float64
- type ConnectionGap
- type ConnectionPathCommand
- type Diagram
- func (diagram Diagram) BoundingBox() (topLeft, bottomRight Point)
- func (diagram Diagram) Bytes() ([]byte, error)
- func (d *Diagram) GetBoard(boardPath []string) *Diagram
- func (diagram Diagram) GetCorpus() string
- func (diagram Diagram) GetNestedCorpus() string
- func (diagram Diagram) HasShape(condition func(Shape) bool) bool
- func (diagram Diagram) HashID(salt *string) (string, error)
- func (diagram Diagram) NestedBoundingBox() (topLeft, bottomRight Point)
- type Legend
- type MText
- type MarkdownStrikeTransition
- type MotionBox
- type MotionClip
- type MotionLabel
- type Point
- type SQLColumn
- type SQLRowReveal
- type SQLTable
- type Shape
- func (s Shape) AppendixLinkText() string
- func (s Shape) CSSStyle() string
- func (s *Shape) CanDrawOutline() bool
- func (s *Shape) CanShadeSketchFill() bool
- func (s *Shape) DrawingOutline() bool
- func (s *Shape) DrawnOutline() []geo.Point
- func (s *Shape) Geometry() shape.Shape
- func (s Shape) GetFontColor() string
- func (s Shape) GetID() string
- func (s Shape) GetZIndex() int
- func (s *Shape) IconBounds(outline shape.Shape) *geo.Box
- func (s *Shape) LabelTopLeft(position label.Position, box *geo.Box) *geo.Point
- func (s *Shape) OuterLabelBox(box *geo.Box) *geo.Box
- func (s Shape) RenderedStrokeWidth() float64
- func (s *Shape) SQLRowDivider(index int, y, radius float64) (bottom, inset float64, last bool)
- func (s *Shape) SQLRowHeight() float64
- func (s *Shape) SQLRowVisibleHeight(top, height float64) float64
- func (s *Shape) SetType(t string)
- type SketchFillTransition
- type Text
- type TextDimensions
- type ThemeOverrides
- type TraceEndpoint
Constants ¶
const ( PrefixPadding = 10 PrefixWidth = 20 CenterPadding = 50 // 10px of padding top and bottom so text doesn't look squished VerticalPadding = 20 )
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 )
const ( MaxTweenDurationMS = 600_000 MaxTweenFrames = 120 )
Limits shared by D2 source compilation and callers supplying sampled targets.
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" )
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 )
const (
// MaxRenderTargetBoards includes authored boards and their tween samples.
MaxRenderTargetBoards = 16_384
)
Variables ¶
var Arrowheads = map[string]struct{}{ string(NoArrowhead): {}, string(ArrowArrowhead): {}, string(TriangleArrowhead): {}, string(DiamondArrowhead): {}, string(CircleArrowhead): {}, string(BoxArrowhead): {}, string(CfOne): {}, string(CfMany): {}, string(CfOneRequired): {}, string(CfManyRequired): {}, string(CrossArrowhead): {}, }
valid values for arrowhead.shape
var BorderOffset = geo.NewVector(5, 5)
var DSL_SHAPE_TO_SHAPE_TYPE = map[string]string{ "": shape.SQUARE_TYPE, ShapeRectangle: shape.SQUARE_TYPE, ShapeSquare: shape.REAL_SQUARE_TYPE, ShapePage: shape.PAGE_TYPE, ShapeParallelogram: shape.PARALLELOGRAM_TYPE, ShapeDocument: shape.DOCUMENT_TYPE, ShapeCylinder: shape.CYLINDER_TYPE, ShapeQueue: shape.QUEUE_TYPE, ShapePackage: shape.PACKAGE_TYPE, ShapeStep: shape.STEP_TYPE, ShapeCallout: shape.CALLOUT_TYPE, ShapeStoredData: shape.STORED_DATA_TYPE, ShapePerson: shape.PERSON_TYPE, ShapeC4Person: shape.C4_PERSON_TYPE, ShapeDiamond: shape.DIAMOND_TYPE, ShapeOval: shape.OVAL_TYPE, ShapeCircle: shape.CIRCLE_TYPE, ShapeHexagon: shape.HEXAGON_TYPE, ShapeCloud: shape.CLOUD_TYPE, ShapeText: shape.TEXT_TYPE, ShapeCode: shape.CODE_TYPE, ShapeClass: shape.CLASS_TYPE, ShapeSQLTable: shape.TABLE_TYPE, ShapeImage: shape.IMAGE_TYPE, ShapeSequenceDiagram: shape.SQUARE_TYPE, ShapeHierarchy: shape.SQUARE_TYPE, }
var SHAPE_TYPE_TO_DSL_SHAPE map[string]string
var Shapes = []string{ ShapeRectangle, ShapeSquare, ShapePage, ShapeParallelogram, ShapeDocument, ShapeCylinder, ShapeQueue, ShapePackage, ShapeStep, ShapeCallout, ShapeStoredData, ShapePerson, ShapeC4Person, ShapeDiamond, ShapeOval, ShapeCircle, ShapeHexagon, ShapeCloud, ShapeText, ShapeCode, ShapeClass, ShapeSQLTable, ShapeImage, ShapeSequenceDiagram, ShapeHierarchy, }
Functions ¶
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 StrokeWidthExtent ¶ added in v0.10.0
StrokeWidthExtent rounds a validated stroke outward for integer layout bounds.
func TweenFrameCount ¶ added in v0.10.0
TweenFrameCount samples at 25 fps up to the per-transition frame limit.
func ValidStrokeWidthOffset ¶ added in v0.10.0
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
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 (Arrowhead) Dimensions ¶
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
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
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
ConnectionGap is a transparent opening in an individual connection stroke.
type ConnectionPathCommand ¶ added in v0.10.0
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) GetNestedCorpus ¶
func (Diagram) NestedBoundingBox ¶
type Legend ¶
type Legend struct {
Label string `json:"label,omitempty"`
Shapes []Shape `json:"shapes,omitempty"`
Connections []Connection `json:"connections,omitempty"`
}
type MText ¶
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
MotionClip is the visible rectangle of an unfolding grid cell, in diagram coordinates.
type MotionLabel ¶ added in v0.10.0
MotionLabel anchors the caption and its mask while a partial route is drawn.
type SQLColumn ¶
type SQLColumn struct {
Name Text `json:"name"`
Type Text `json:"type"`
Constraint []string `json:"constraint"`
Reference string `json:"reference"`
}
func (SQLColumn) ConstraintAbbr ¶
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 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 (Shape) AppendixLinkText ¶ added in v0.10.0
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) CanDrawOutline ¶ added in v0.10.0
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
CanShadeSketchFill reports whether the shape has a single solid sketch surface.
func (*Shape) DrawingOutline ¶ added in v0.10.0
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
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
Geometry returns the same outline and inner content box used for rendering.
func (Shape) GetFontColor ¶
func (*Shape) IconBounds ¶ added in v0.10.0
IconBounds returns the rendered icon rectangle for a shape with an icon.
func (*Shape) LabelTopLeft ¶ added in v0.10.0
LabelTopLeft resolves both ordinary captions and intermediate animation anchors.
func (*Shape) OuterLabelBox ¶ added in v0.10.0
OuterLabelBox is the painted outline used to place outside and border labels.
func (Shape) RenderedStrokeWidth ¶ added in v0.10.0
func (*Shape) SQLRowDivider ¶ added in v0.10.0
SQLRowDivider keeps the separator and moving bottom border together.
func (*Shape) SQLRowHeight ¶ added in v0.10.0
func (*Shape) SQLRowVisibleHeight ¶ added in v0.10.0
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.
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 ¶
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" )