package d2target
Import Path
oss.terrastruct.com/d2/d2target (on go.dev )
Dependency Relation
imports 13 packages , and imported by 12 packages
Package-Level Type Names (total 15)
/* sort by: alphabet | popularity */
type Diagram (struct)
Fields (total 11 )
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
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 oss.terrastruct.com/d2/d2exporter.Export (ctx context .Context , g *d2graph .Graph , fontFamily *d2fonts .FontFamily ) (*Diagram , error )
func oss.terrastruct.com/d2/d2lib.Compile (ctx context .Context , input string , compileOpts *d2lib .CompileOptions , renderOpts *d2svg .RenderOpts ) (*Diagram , *d2graph .Graph , error )
As Inputs Of (at least 2 )
func oss.terrastruct.com/d2/d2renderers/d2svg.Render (diagram *Diagram , opts *d2svg .RenderOpts ) ([]byte , error )
func oss.terrastruct.com/d2/d2renderers/d2svg.RenderMultiboard (diagram *Diagram , opts *d2svg .RenderOpts ) ([][]byte , error )
type MText (struct)
Fields (total 7 )
Dimensions TextDimensions
FontSize int
IsBold bool
IsItalic 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 oss.terrastruct.com/d2/d2graph.(*Edge ).Text () *MText
func oss.terrastruct.com/d2/d2graph.(*Graph ).Texts () []*MText
func oss.terrastruct.com/d2/d2graph.(*Object ).Text () *MText
As Inputs Of (at least 5 )
func oss.terrastruct.com/d2/d2graph.GetTextDimensions (mtexts []*MText , ruler *textmeasure .Ruler , t *MText , fontFamily *d2fonts .FontFamily ) *TextDimensions
func oss.terrastruct.com/d2/d2graph.GetTextDimensions (mtexts []*MText , ruler *textmeasure .Ruler , t *MText , fontFamily *d2fonts .FontFamily ) *TextDimensions
func oss.terrastruct.com/d2/d2graph.(*Graph ).SetDimensions (mtexts []*MText , ruler *textmeasure .Ruler , fontFamily *d2fonts .FontFamily ) error
func oss.terrastruct.com/d2/d2graph.(*Object ).GetDefaultSize (mtexts []*MText , ruler *textmeasure .Ruler , fontFamily *d2fonts .FontFamily , labelDims TextDimensions , withLabelPadding bool ) (*TextDimensions , error )
func oss.terrastruct.com/d2/d2graph.(*Object ).GetLabelSize (mtexts []*MText , ruler *textmeasure .Ruler , fontFamily *d2fonts .FontFamily ) (*TextDimensions , error )
type Shape (struct)
Fields (total 48 )
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
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
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 : oss.terrastruct.com/d2/d2renderers/d2svg.DiagramObject
As Outputs Of (at least one exported )
func BaseShape () *Shape
As Inputs Of (at least 8 )
func oss.terrastruct.com/d2/d2renderers/d2sketch.Class (r jsrunner .JSRunner , shape Shape ) (string , error )
func oss.terrastruct.com/d2/d2renderers/d2sketch.DoubleOval (r jsrunner .JSRunner , shape Shape ) (string , error )
func oss.terrastruct.com/d2/d2renderers/d2sketch.DoubleRect (r jsrunner .JSRunner , shape Shape ) (string , error )
func oss.terrastruct.com/d2/d2renderers/d2sketch.Oval (r jsrunner .JSRunner , shape Shape ) (string , error )
func oss.terrastruct.com/d2/d2renderers/d2sketch.Paths (r jsrunner .JSRunner , shape Shape , paths []string ) (string , error )
func oss.terrastruct.com/d2/d2renderers/d2sketch.Rect (r jsrunner .JSRunner , shape Shape ) (string , error )
func oss.terrastruct.com/d2/d2renderers/d2sketch.Table (r jsrunner .JSRunner , shape Shape ) (string , error )
func oss.terrastruct.com/d2/d2themes.ShapeTheme (shape Shape ) (fill, stroke string )
type TextDimensions (struct)
Fields (total 2 )
Height int
Width int
As Outputs Of (at least 4 )
func NewTextDimensions (w, h int ) *TextDimensions
func oss.terrastruct.com/d2/d2graph.GetTextDimensions (mtexts []*MText , ruler *textmeasure .Ruler , t *MText , fontFamily *d2fonts .FontFamily ) *TextDimensions
func oss.terrastruct.com/d2/d2graph.(*Object ).GetDefaultSize (mtexts []*MText , ruler *textmeasure .Ruler , fontFamily *d2fonts .FontFamily , labelDims TextDimensions , withLabelPadding bool ) (*TextDimensions , error )
func oss.terrastruct.com/d2/d2graph.(*Object ).GetLabelSize (mtexts []*MText , ruler *textmeasure .Ruler , fontFamily *d2fonts .FontFamily ) (*TextDimensions , error )
As Inputs Of (at least one exported )
func oss.terrastruct.com/d2/d2graph.(*Object ).GetDefaultSize (mtexts []*MText , ruler *textmeasure .Ruler , fontFamily *d2fonts .FontFamily , labelDims TextDimensions , withLabelPadding bool ) (*TextDimensions , error )
Package-Level Functions (total 8)
Package-Level Variables (total 5)
Package-Level Constants (total 60)
The pages are generated with Golds v0.8.2 . (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 .