Documentation ¶
Index ¶
- Constants
- type Anchor
- type Collaboration
- func (c *Collaboration) Attributes() []dotencoding.Attribute
- func (c *Collaboration) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point)
- func (c *Collaboration) From() graph.Node
- func (c *Collaboration) GetLayer() int
- func (c *Collaboration) GetType() wardleyToGo.EdgeType
- func (c *Collaboration) MarshalSVG(e *xml.Encoder, canvas image.Rectangle) error
- func (c *Collaboration) ReversedEdge() graph.Edge
- func (c *Collaboration) To() graph.Node
- type Component
- func (c *Component) Attributes() []dotencoding.Attribute
- func (c *Component) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point)
- func (c *Component) GetLayer() int
- func (c *Component) GetPosition() image.Point
- func (c *Component) ID() int64
- func (c *Component) MarshalSVG(e *xml.Encoder, canvas image.Rectangle) error
- func (c *Component) String() string
- type EvolvedComponent
- func (c *EvolvedComponent) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point)
- func (e *EvolvedComponent) GetPosition() image.Point
- func (e *EvolvedComponent) ID() int64
- func (c *EvolvedComponent) MarshalSVG(e *xml.Encoder, canvas image.Rectangle) error
- func (e *EvolvedComponent) String() string
Examples ¶
Constants ¶
const ( // This is a RegularComponent RegularComponent wardleyToGo.ComponentType = iota | components.Wardley // BuildComponent ... BuildComponent // Off the shelf element BuyComponent // OutsourceComponent ... OutsourceComponent // DataProductComponent ... DataProductComponent RegularEdge wardleyToGo.EdgeType = iota + wardleyToGo.EdgeType(lastComponent) | wardleyToGo.EdgeType(components.Wardley) EvolvedComponentEdge EvolvedEdge )
const (
DefaultComponentRenderingLayer int = 10
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Anchor ¶
type Anchor struct { Placement image.Point Label string RenderingLayer int //The position of the element on the picture // contains filtered or unexported fields }
An Anchor of the map
func (*Anchor) GetPosition ¶
func (*Anchor) MarshalSVG ¶ added in v0.3.3
type Collaboration ¶
type Collaboration struct {
F, T wardleyToGo.Component
Label string
Type wardleyToGo.EdgeType
RenderingLayer int
Visibility int
}
func (*Collaboration) Attributes ¶ added in v0.6.0
func (c *Collaboration) Attributes() []dotencoding.Attribute
func (*Collaboration) Draw ¶ added in v0.3.2
Draw aligns r.Min in dst with sp in src and then replaces the rectangle r in dst with the result of drawing src on dst.
func (*Collaboration) From ¶
func (c *Collaboration) From() graph.Node
From returns the from node of the edge.
func (*Collaboration) GetLayer ¶
func (c *Collaboration) GetLayer() int
func (*Collaboration) GetType ¶
func (c *Collaboration) GetType() wardleyToGo.EdgeType
func (*Collaboration) MarshalSVG ¶ added in v0.3.3
func (*Collaboration) ReversedEdge ¶
func (c *Collaboration) ReversedEdge() graph.Edge
ReversedEdge returns the edge reversal of the receiver if a reversal is valid for the data type. When a reversal is valid an edge of the same type as the receiver with nodes of the receiver swapped should be returned, otherwise the receiver should be returned unaltered.
func (*Collaboration) To ¶
func (c *Collaboration) To() graph.Node
To returns the to node of the edge.
type Component ¶
type Component struct { Placement image.Point // The placement of the component on a rectangle 100x100 Label string LabelPlacement image.Point // LabelPlacement is relative to the placement Type wardleyToGo.ComponentType RenderingLayer int //The position of the element on the picture // contains filtered or unexported fields }
A Component is an element of the map
func NewComponent ¶
NewComponent with the corresponding id and default UndefinedCoords
func (*Component) Attributes ¶ added in v0.6.0
func (c *Component) Attributes() []dotencoding.Attribute
func (*Component) Draw ¶ added in v0.3.2
Draw aligns r.Min in dst with sp in src and then replaces the rectangle r in dst with the result of drawing src on dst.
Example ¶
// draw a circle at the center of the picture im := image.NewRGBA(image.Rect(0, 0, 1200, 1000)) c := &Component{ Label: "test", LabelPlacement: image.Pt(components.UndefinedCoord, components.UndefinedCoord), Placement: image.Pt(100, 50), } c.Draw(im, im.Bounds(), im, image.Point{})
Output:
func (*Component) GetPosition ¶
func (*Component) MarshalSVG ¶ added in v0.3.3
type EvolvedComponent ¶
type EvolvedComponent struct {
*Component
}
func NewEvolvedComponent ¶
func NewEvolvedComponent(id int64) *EvolvedComponent
func (*EvolvedComponent) Draw ¶ added in v0.3.2
Draw aligns r.Min in dst with sp in src and then replaces the rectangle r in dst with the result of drawing src on dst.
func (*EvolvedComponent) GetPosition ¶
func (e *EvolvedComponent) GetPosition() image.Point
GetCoordinates fulfils the Element interface
func (*EvolvedComponent) ID ¶
func (e *EvolvedComponent) ID() int64
func (*EvolvedComponent) MarshalSVG ¶ added in v0.3.3
func (*EvolvedComponent) String ¶
func (e *EvolvedComponent) String() string