package d2target

Import Path
	oss.terrastruct.com/d2/d2target (on go.dev)

Dependency Relation
	imports 13 packages, and imported by 12 packages

Involved Source Files class.go d2target.go sqltable.go
Package-Level Type Names (total 15)
/* sort by: | */
( Arrowhead) Dimensions(strokeWidth float64) (width, height float64) func ToArrowhead(arrowheadType string, filled *bool) Arrowhead func oss.terrastruct.com/d2/d2graph.(*Attributes).ToArrowhead() Arrowhead func oss.terrastruct.com/d2/d2renderers/d2sketch.ArrowheadJS(r jsrunner.JSRunner, arrowhead Arrowhead, stroke string, strokeWidth int) (arrowJS, extraJS string) const ArrowArrowhead const BoxArrowhead const CfMany const CfManyRequired const CfOne const CfOneRequired const CircleArrowhead const DefaultArrowhead const DiamondArrowhead const FilledBoxArrowhead const FilledCircleArrowhead const FilledDiamondArrowhead const LineArrowhead const NoArrowhead const TriangleArrowhead const UnfilledTriangleArrowhead
Fields []ClassField Methods []ClassMethod
Name string Type string Visibility string ( ClassField) Text(fontSize int) *MText ( ClassField) VisibilityToken() string
Name string Return string Visibility string ( ClassMethod) Text(fontSize int) *MText ( ClassMethod) VisibilityToken() string
Center *bool DarkThemeID *int64 DarkThemeOverrides *ThemeOverrides Data is a data structure for holding user-defined data useful for plugins that allow users to configure within source code LayoutEngine *string Pad *int64 Sketch *bool ThemeID *int64 ThemeOverrides *ThemeOverrides func oss.terrastruct.com/d2/d2compiler.Compile(p string, r io.Reader, opts *d2compiler.CompileOptions) (*d2graph.Graph, *Config, error)
Animated bool BorderRadius float64 Classes []string Dst string DstArrow Arrowhead DstLabel *Text Fill string ID string Icon *url.URL IsCurve bool LabelPercentage float64 LabelPosition string Link string Opacity float64 PrettyLink string Route []*geo.Point Src string SrcArrow Arrowhead SrcLabel *Text 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 Tooltip string ZIndex int ( Connection) CSSStyle() string (*Connection) GetArrowheadLabelPosition(isDst bool) *geo.Point ( Connection) GetFontColor() string ( Connection) GetID() string (*Connection) GetLabelTopLeft() *geo.Point ( Connection) GetZIndex() int Connection : oss.terrastruct.com/d2/d2renderers/d2svg.DiagramObject func BaseConnection() *Connection func oss.terrastruct.com/d2/d2renderers/d2sketch.Arrowheads(r jsrunner.JSRunner, connection Connection, srcAdj, dstAdj *geo.Point) (string, error) func oss.terrastruct.com/d2/d2renderers/d2sketch.Connection(r jsrunner.JSRunner, connection Connection, path, attrs string) (string, error)
Config *Config Connections []Connection Description string FontFamily *d2fonts.FontFamily 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 ( 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) 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) 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)
Dimensions TextDimensions FontSize int IsBold bool IsItalic bool Language string Shape string Text string ( MText) GetColor(isItalic bool) string 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 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)
X int Y int func NewPoint(x, y int) Point func Diagram.BoundingBox() (topLeft, bottomRight Point) func Diagram.NestedBoundingBox() (topLeft, bottomRight Point)
Animated 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 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 TODO remove this function, just set fields on themeable ( Shape) GetFontColor() string ( Shape) GetID() string ( Shape) GetZIndex() int (*Shape) SetType(t string) Shape : oss.terrastruct.com/d2/d2renderers/d2svg.DiagramObject func BaseShape() *Shape 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)
Constraint []string Name Text Reference string Type Text ( SQLColumn) ConstraintAbbr() string ( SQLColumn) Texts(fontSize int) []*MText
Columns []SQLColumn
Height int Width int 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) func oss.terrastruct.com/d2/d2graph.(*Object).GetDefaultSize(mtexts []*MText, ruler *textmeasure.Ruler, fontFamily *d2fonts.FontFamily, labelDims TextDimensions, withLabelPadding bool) (*TextDimensions, error)
AA2 *string AA4 *string AA5 *string AB4 *string AB5 *string B1 *string B2 *string B3 *string B4 *string B5 *string B6 *string N1 *string N2 *string N3 *string N4 *string N5 *string N6 *string N7 *string func oss.terrastruct.com/d2/d2renderers/d2svg.ThemeCSS(diagramHash string, themeID *int64, darkThemeID *int64, overrides, darkOverrides *ThemeOverrides) (stylesheet string, err error) func oss.terrastruct.com/d2/d2themes.(*Theme).ApplyOverrides(overrides *ThemeOverrides)
Package-Level Functions (total 8)
func BaseShape() *Shape
func GetIconSize(box *geo.Box, position string) int
func NewPoint(x, y int) Point
func ToArrowhead(arrowheadType string, filled *bool) Arrowhead
Package-Level Variables (total 5)
valid values for arrowhead.shape
var Shapes []string
Package-Level Constants (total 60)
const ArrowArrowhead Arrowhead = "arrow"
const BG_COLOR = "N7"
const BoxArrowhead Arrowhead = "box"
const CenterPadding = 50
const CfMany Arrowhead = "cf-many"
const CfManyRequired Arrowhead = "cf-many-required"
Crows feet notation
const CfOneRequired Arrowhead = "cf-one-required"
const CircleArrowhead Arrowhead = "circle"
const ConstraintPadding = 20
const DEFAULT_ICON_SIZE = 32
const DefaultArrowhead Arrowhead = "triangle"
const DiamondArrowhead Arrowhead = "diamond"
const FG_COLOR = "N1"
const FilledBoxArrowhead Arrowhead = "filled-box"
const FilledCircleArrowhead Arrowhead = "filled-circle"
const FilledDiamondArrowhead Arrowhead = "filled-diamond"
Setting table font size sets it for columns The header needs to be a little larger for visual hierarchy
const HeaderPadding = 10
For fat arrows
const MAX_ICON_SIZE = 64
const MULTIPLE_OFFSET = 10
const NamePadding = 10
const NoArrowhead Arrowhead = "none"
const PrefixPadding = 10
const PrefixWidth = 20
const SHADOW_SIZE_X = 3
const SHADOW_SIZE_Y = 5
const ShapeCallout = "callout"
const ShapeCircle = "circle"
const ShapeClass = "class"
const ShapeCloud = "cloud"
const ShapeCode = "code"
const ShapeCylinder = "cylinder"
const ShapeDiamond = "diamond"
const ShapeDocument = "document"
const ShapeHexagon = "hexagon"
const ShapeHierarchy = "hierarchy"
const ShapeImage = "image"
const ShapeOval = "oval"
const ShapePackage = "package"
const ShapePage = "page"
const ShapeParallelogram = "parallelogram"
const ShapePerson = "person"
const ShapeQueue = "queue"
const ShapeRectangle = "rectangle"
const ShapeSequenceDiagram = "sequence_diagram"
const ShapeSQLTable = "sql_table"
const ShapeSquare = "square"
const ShapeStep = "step"
const ShapeStoredData = "stored_data"
const ShapeText = "text"
const THREE_DEE_OFFSET = 15
const TriangleArrowhead Arrowhead = "triangle"
const TypePadding = 20
const UnfilledTriangleArrowhead Arrowhead = "unfilled-triangle"
10px of padding top and bottom so text doesn't look squished