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: | */
( Arrowhead) Dimensions(strokeWidth float64) (width, height float64) func ToArrowhead(arrowheadType string, filled *bool) Arrowhead func github.com/pancsta/d2/d2graph.(*Attributes).ToArrowhead() Arrowhead func github.com/pancsta/d2/d2renderers/d2sketch.ArrowheadDrawables(arrowhead Arrowhead, stroke string, strokeWidth int) ([]rough.Drawable, bool) const ArrowArrowhead const BoxArrowhead const CfMany const CfManyRequired const CfOne const CfOneRequired const CircleArrowhead const CrossArrowhead 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 Underline bool Visibility string ( ClassField) Text(fontSize int) *MText ( ClassField) VisibilityToken() string
Name string Return string Underline bool 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 layout engines that allow users to configure within source code Isometric *bool LayoutEngine *string Pad *int64 Sketch *bool ThemeID *int64 ThemeOverrides *ThemeOverrides func github.com/pancsta/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 IconBorderRadius float64 IconPosition string 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) GetIconPosition() *geo.Point (*Connection) GetLabelTopLeft() *geo.Point ( Connection) GetZIndex() int Connection : github.com/pancsta/d2/d2renderers/d2svg.DiagramObject func BaseConnection() *Connection func github.com/pancsta/d2/d2renderers/d2sketch.Arrowheads(connection Connection, srcAdj, dstAdj *geo.Point) (string, error) func github.com/pancsta/d2/d2renderers/d2sketch.Connection(connection Connection, path, attributes string) (string, error) func github.com/pancsta/d2/d2renderers/d2sketch.ConnectionWithAttributes(connection Connection, path string, attributes []svg.Attribute) (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 Legend *Legend MonoFontFamily *d2fonts.FontFamily 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 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) 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)
Connections []Connection Label string Shapes []Shape
Dimensions TextDimensions FontSize int IsBold bool IsItalic bool IsUnderline 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 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 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)
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 IconBorderRadius int 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 TooltipPosition 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 : github.com/pancsta/d2/d2renderers/d2svg.DiagramObject func BaseShape() *Shape 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)
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 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) 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)
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 github.com/pancsta/d2/d2renderers/d2svg.ThemeCSS(diagramHash string, themeID *int64, darkThemeID *int64, overrides, darkOverrides *ThemeOverrides) (stylesheet string, err error) func github.com/pancsta/d2/d2themes.(*Theme).ApplyOverrides(overrides *ThemeOverrides)
Package-Level Functions (total 10)
func BaseShape() *Shape
func CalculateTooltipPosition(shapeX, shapeY, shapeWidth, shapeHeight float64, tooltipWidth, tooltipHeight int, position string) (x, y float64)
func GetIconSize(box *geo.Box, position string) int
func NewPoint(x, y int) Point
func ToArrowhead(arrowheadType string, filled *bool) Arrowhead
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.
Package-Level Variables (total 5)
valid values for arrowhead.shape
var Shapes []string
Package-Level Constants (total 63)
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 CrossArrowhead Arrowhead = "cross"
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 ShapeC4Person = "c4-person"
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