Documentation ¶
Overview ¶
d2svg implements an SVG renderer for d2 diagrams. The input is d2exporter's output
Index ¶
- Constants
- Variables
- func EmbedFonts(buf *bytes.Buffer, diagramHash, source string, fontFamily *d2fonts.FontFamily, ...)
- func Render(diagram *d2target.Diagram, opts *RenderOpts) ([]byte, error)
- func RenderText(text string, x, height float64) string
- func ThemeCSS(diagramHash string, themeID int64, darkThemeID *int64) (stylesheet string, err error)
- type DiagramObject
- type RenderOpts
Constants ¶
View Source
const ( DEFAULT_PADDING = 100 MIN_ARROWHEAD_STROKE_WIDTH = 2 )
View Source
const DEFAULT_THEME int64 = 0
Variables ¶
View Source
var BaseStylesheet string
View Source
var DEFAULT_DARK_THEME *int64 = nil // no theme selected
View Source
var LinkIcon string
View Source
var MarkdownCSS string
View Source
var TooltipIcon string
Functions ¶
func EmbedFonts ¶ added in v0.3.0
func RenderText ¶ added in v0.1.4
Types ¶
type DiagramObject ¶ added in v0.1.0
type RenderOpts ¶ added in v0.1.3
type RenderOpts struct { Pad int Sketch bool Center bool ThemeID int64 DarkThemeID *int64 Font string // disables the fit to screen behavior and ensures the exported svg has the exact dimensions SetDimensions bool // MasterID is passed when the diagram should use something other than its own hash for unique targeting // Currently, that's when multi-boards are collapsed MasterID string }
Click to show internal directories.
Click to hide internal directories.