package d2target
Import Path
github.com/pancsta/d2/d2target (on go.dev )
Dependency Relation
imports 16 packages , and imported by 18 packages
Package-Level Type Names (total 16)
/* sort by: alphabet | popularity */
type Diagram (struct)
Fields (total 13 )
Config *Config
Connections []Connection
Description string
FontFamily *d2fonts .FontFamily
IsFolderOnly bool
See docs on the same field in d2graph to understand what it means.
Layers []*Diagram
Legend *Legend
MonoFontFamily *d2fonts .FontFamily
Name string
Root Shape
Scenarios []*Diagram
Shapes []Shape
Steps []*Diagram
Methods (total 8 )
( Diagram) BoundingBox () (topLeft, bottomRight Point )
( Diagram) Bytes () ([]byte , error )
(*Diagram) GetBoard (boardPath []string ) *Diagram
( Diagram) GetCorpus () string
( Diagram) GetNestedCorpus () string
( Diagram) HasShape (condition func(Shape ) bool ) bool
( Diagram) HashID (salt *string ) (string , error )
( Diagram) NestedBoundingBox () (topLeft, bottomRight Point )
As Outputs Of (at least 4 )
func NewDiagram () *Diagram
func (*Diagram).GetBoard (boardPath []string ) *Diagram
func github.com/pancsta/d2/d2exporter.Export (ctx context .Context , g *d2graph .Graph , fontFamily *d2fonts .FontFamily , monoFontFamily *d2fonts .FontFamily ) (*Diagram , error )
func github.com/pancsta/d2/d2lib.Compile (ctx context .Context , input string , compileOpts *d2lib .CompileOptions , renderOpts *d2svg .RenderOpts ) (*Diagram , *d2graph .Graph , error )
As Inputs Of (at least 11 )
func ValidateRenderTarget (root *Diagram ) error
func github.com/pancsta/d2/d2renderers/d2isometric.BuildScene (diagram *Diagram , opts *d2isometric .RenderOpts ) (*d2isometric .Scene , error )
func github.com/pancsta/d2/d2renderers/d2isometric/d2isometricimg.CaptureFrames (ctx context .Context , diagram *Diagram , opts *d2isometricimg .Options , seconds []float64 , traffic bool , emit func(int , []byte ) error ) error
func github.com/pancsta/d2/d2renderers/d2isometric/d2isometricimg.Render (ctx context .Context , diagram *Diagram , opts *d2isometricimg .Options ) ([]byte , error )
func github.com/pancsta/d2/d2renderers/d2isometric/d2isometricimg.RenderPage (ctx context .Context , diagram *Diagram , opts *d2isometricimg .Options ) (*d2isometricimg .Page , error )
func github.com/pancsta/d2/d2renderers/d2isometric/d2isometricimg.RenderTimeline (ctx context .Context , boards []*Diagram , opts *d2isometricimg .Options , interval time .Duration ) ([]byte , error )
func github.com/pancsta/d2/d2renderers/d2scenebuild.Build (ctx context .Context , diagram *Diagram , options d2scenebuild .Options ) (*d2scene .Document , error )
func github.com/pancsta/d2/d2renderers/d2svg.Render (diagram *Diagram , opts *d2svg .RenderOpts ) ([]byte , error )
func github.com/pancsta/d2/d2renderers/d2svg.RenderIsometric (ctx context .Context , diagram *Diagram , opts *d2svg .RenderOpts , native *d2isometricimg .Options ) ([]byte , error )
func github.com/pancsta/d2/d2renderers/d2svg.RenderLegend (buf *bytes .Buffer , diagram *Diagram , diagramHash string , theme *d2themes .Theme ) error
func github.com/pancsta/d2/d2renderers/d2svg.RenderMultiboard (diagram *Diagram , opts *d2svg .RenderOpts ) ([][]byte , error )
type MText (struct)
Fields (total 8 )
Dimensions TextDimensions
FontSize int
IsBold bool
IsItalic bool
IsUnderline bool
Language string
Shape string
Text string
Methods (only one )
( MText) GetColor (isItalic bool ) string
As Outputs Of (at least 6 )
func ClassField .Text (fontSize int ) *MText
func ClassMethod .Text (fontSize int ) *MText
func SQLColumn .Texts (fontSize int ) []*MText
func github.com/pancsta/d2/d2graph.(*Edge ).Text () *MText
func github.com/pancsta/d2/d2graph.(*Graph ).Texts () []*MText
func github.com/pancsta/d2/d2graph.(*Object ).Text () *MText
As Inputs Of (at least 7 )
func github.com/pancsta/d2/d2graph.GetTextDimensions (mtexts []*MText , ruler *textmeasure .Ruler , t *MText , fontFamily *d2fonts .FontFamily ) *TextDimensions
func github.com/pancsta/d2/d2graph.GetTextDimensions (mtexts []*MText , ruler *textmeasure .Ruler , t *MText , fontFamily *d2fonts .FontFamily ) *TextDimensions
func github.com/pancsta/d2/d2graph.GetTextDimensionsWithMono (mtexts []*MText , ruler *textmeasure .Ruler , t *MText , fontFamily *d2fonts .FontFamily , monoFontFamily *d2fonts .FontFamily ) *TextDimensions
func github.com/pancsta/d2/d2graph.GetTextDimensionsWithMono (mtexts []*MText , ruler *textmeasure .Ruler , t *MText , fontFamily *d2fonts .FontFamily , monoFontFamily *d2fonts .FontFamily ) *TextDimensions
func github.com/pancsta/d2/d2graph.(*Graph ).SetDimensions (mtexts []*MText , ruler *textmeasure .Ruler , fontFamily *d2fonts .FontFamily , monoFontFamily *d2fonts .FontFamily ) error
func github.com/pancsta/d2/d2graph.(*Object ).GetDefaultSize (mtexts []*MText , ruler *textmeasure .Ruler , fontFamily *d2fonts .FontFamily , monoFontFamily *d2fonts .FontFamily , labelDims TextDimensions , withLabelPadding bool ) (*TextDimensions , error )
func github.com/pancsta/d2/d2graph.(*Object ).GetLabelSize (mtexts []*MText , ruler *textmeasure .Ruler , fontFamily *d2fonts .FontFamily , monoFontFamily *d2fonts .FontFamily ) (*TextDimensions , error )
type Shape (struct)
Fields (total 50 )
Animated bool
Blend bool
Whether the shape should allow shapes behind it to bleed through
Currently just used for sequence diagram groups
BorderRadius int
Class Class
Class .Fields []ClassField
Class .Methods []ClassMethod
Classes []string
ContentAspectRatio *float64
DoubleBorder bool
Fill string
FillPattern string
Height int
ID string
Icon *url .URL
IconBorderRadius int
IconPosition string
LabelPosition string
Level int
Link string
Multiple bool
NeutralAccentColor string
Opacity float64
Pos Point
PrettyLink string
PrimaryAccentColor string
These are used for special shapes, sql_table and class
SQLTable SQLTable
SecondaryAccentColor string
Shadow bool
SQLTable .Columns []SQLColumn
Stroke string
StrokeDash float64
StrokeWidth int
Text Text
Text .Bold bool
Text .Color string
Text .FontFamily string
Text .FontSize int
Text .Italic bool
Text .Label string
Text .LabelFill string
Text .LabelHeight int
Text .LabelWidth int
Text .Language string
Text .Underline bool
ThreeDee bool
Tooltip string
TooltipPosition string
Type string
Width int
ZIndex int
Methods (total 5 )
( Shape) CSSStyle () string
TODO remove this function, just set fields on themeable
( Shape) GetFontColor () string
( Shape) GetID () string
( Shape) GetZIndex () int
(*Shape) SetType (t string )
Implements (at least one exported )
Shape : github.com/pancsta/d2/d2renderers/d2svg.DiagramObject
As Outputs Of (at least one exported )
func BaseShape () *Shape
As Inputs Of (at least 8 )
func github.com/pancsta/d2/d2renderers/d2sketch.Class (shape Shape ) (string , error )
func github.com/pancsta/d2/d2renderers/d2sketch.DoubleOval (shape Shape , diagramHash string ) (string , error )
func github.com/pancsta/d2/d2renderers/d2sketch.DoubleRect (shape Shape , diagramHash string ) (string , error )
func github.com/pancsta/d2/d2renderers/d2sketch.Oval (shape Shape , diagramHash string ) (string , error )
func github.com/pancsta/d2/d2renderers/d2sketch.Paths (shape Shape , diagramHash string , paths []string ) (string , error )
func github.com/pancsta/d2/d2renderers/d2sketch.Rect (shape Shape , diagramHash string ) (string , error )
func github.com/pancsta/d2/d2renderers/d2sketch.Table (shape Shape ) (string , error )
func github.com/pancsta/d2/d2themes.ShapeTheme (shape Shape ) (fill, stroke string )
type TextDimensions (struct)
Fields (total 2 )
Height int
Width int
As Outputs Of (at least 5 )
func NewTextDimensions (w, h int ) *TextDimensions
func github.com/pancsta/d2/d2graph.GetTextDimensions (mtexts []*MText , ruler *textmeasure .Ruler , t *MText , fontFamily *d2fonts .FontFamily ) *TextDimensions
func github.com/pancsta/d2/d2graph.GetTextDimensionsWithMono (mtexts []*MText , ruler *textmeasure .Ruler , t *MText , fontFamily *d2fonts .FontFamily , monoFontFamily *d2fonts .FontFamily ) *TextDimensions
func github.com/pancsta/d2/d2graph.(*Object ).GetDefaultSize (mtexts []*MText , ruler *textmeasure .Ruler , fontFamily *d2fonts .FontFamily , monoFontFamily *d2fonts .FontFamily , labelDims TextDimensions , withLabelPadding bool ) (*TextDimensions , error )
func github.com/pancsta/d2/d2graph.(*Object ).GetLabelSize (mtexts []*MText , ruler *textmeasure .Ruler , fontFamily *d2fonts .FontFamily , monoFontFamily *d2fonts .FontFamily ) (*TextDimensions , error )
As Inputs Of (at least one exported )
func github.com/pancsta/d2/d2graph.(*Object ).GetDefaultSize (mtexts []*MText , ruler *textmeasure .Ruler , fontFamily *d2fonts .FontFamily , monoFontFamily *d2fonts .FontFamily , labelDims TextDimensions , withLabelPadding bool ) (*TextDimensions , error )
Package-Level Functions (total 10)
Package-Level Variables (total 5)
Package-Level Constants (total 63)
The pages are generated with Golds v0.8.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .