entity

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	From       string
	To         string
	Label      string
	Attributes map[string]string
}

Connection represents a connection between shapes.

type Diagram

type Diagram struct {
	ID      string
	Content string
	Format  ExportFormat
	Theme   *Theme
}

Diagram represents a D2 diagram entity.

type DiagramGraph added in v0.2.0

type DiagramGraph struct {
	ID      string
	Content string
	Objects map[string]*GraphObject
	Edges   map[string]*GraphEdge
}

DiagramGraph represents the internal graph structure

type ExportFormat

type ExportFormat string

ExportFormat represents the output format for diagram export.

const (
	// FormatSVG represents SVG export format.
	FormatSVG ExportFormat = "svg"
	// FormatPNG represents PNG export format.
	FormatPNG ExportFormat = "png"
	// FormatPDF represents PDF export format.
	FormatPDF ExportFormat = "pdf"
)

type GraphEdge added in v0.2.0

type GraphEdge struct {
	ID         string
	From       string
	To         string
	Label      string
	Attributes map[string]interface{}
}

GraphEdge represents a connection in the diagram

type GraphObject added in v0.2.0

type GraphObject struct {
	ID         string
	Label      string
	Shape      string
	Parent     string
	Attributes map[string]interface{}
}

GraphObject represents a shape in the diagram

type OracleOperation added in v0.2.0

type OracleOperation struct {
	Type               OracleOperationType
	DiagramID          string
	BoardPath          []string // For multi-board support
	Key                string
	Value              *string
	Tag                *string
	NewKey             *string
	IncludeDescendants bool
}

OracleOperation represents a diagram manipulation operation

type OracleOperationType added in v0.2.0

type OracleOperationType string

OracleOperationType defines the type of oracle operation

const (
	OracleCreate OracleOperationType = "create"
	OracleSet    OracleOperationType = "set"
	OracleDelete OracleOperationType = "delete"
	OracleMove   OracleOperationType = "move"
	OracleRename OracleOperationType = "rename"
)

type OracleResult added in v0.2.0

type OracleResult struct {
	Success  bool
	NewKey   string
	IDDeltas map[string]string // Maps old IDs to new IDs
	Graph    *DiagramGraph     // The resulting graph state
}

OracleResult represents the result of an oracle operation

type Shape

type Shape struct {
	ID         string
	Label      string
	Attributes map[string]string
}

Shape represents a shape in a D2 diagram.

type Theme

type Theme struct {
	ID   int
	Name string
}

Theme represents a D2 diagram theme.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL