wardley

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const (
	DefaultComponentRenderingLayer int = 10
	AdjustUndefined                int = iota
	AdjustStart
	AdjustMiddle
	AdjustEnd
)
View Source
const (
	// This is a RegularComponent
	RegularComponent wardleyToGo.ComponentType = iota | components.Wardley
	// BuildComponent ...
	BuildComponent
	// Off the shelf element
	BuyComponent
	// OutsourceComponent ...
	OutsourceComponent
	// DataProductComponent ...
	DataProductComponent
	PipelineComponent

	RegularEdge wardleyToGo.EdgeType = iota + wardleyToGo.EdgeType(lastComponent) | wardleyToGo.EdgeType(components.Wardley)
	EvolvedComponentEdge
	EvolvedEdge
)

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 NewAnchor

func NewAnchor(id int64) *Anchor

func (*Anchor) Draw added in v0.3.2

func (a *Anchor) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point)

func (*Anchor) GetLayer

func (a *Anchor) GetLayer() int

func (*Anchor) GetPosition

func (a *Anchor) GetPosition() image.Point

func (*Anchor) ID

func (a *Anchor) ID() int64

func (*Anchor) MarshalSVG added in v0.3.3

func (a *Anchor) MarshalSVG(e *xml.Encoder, canvas image.Rectangle) error

func (*Anchor) String

func (a *Anchor) String() string

type Collaboration

type Collaboration struct {
	F, T               wardleyToGo.Component
	Label              string
	Type               wardleyToGo.EdgeType
	Inertia            image.Point
	RenderingLayer     int
	Visibility         int
	AbsoluteVisibility int
}

func (*Collaboration) Attributes added in v0.6.0

func (c *Collaboration) Attributes() []dotencoding.Attribute

func (*Collaboration) Draw added in v0.3.2

func (c *Collaboration) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point)

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) GetAbsoluteVisibility added in v0.8.1

func (c *Collaboration) GetAbsoluteVisibility() int

GetAbsoluteVisibility returns the visibility of the component as seen from the anchor

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 (c *Collaboration) MarshalSVG(e *xml.Encoder, canvas image.Rectangle) error

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
	Configured          bool
	EvolutionPos        int
	Inertia             int
	Color               color.Color
	AbsoluteVisibility  int
	Anchor              int
	PipelinedComponents []*Component
	PipelineReference   *Component
	Description         string
	// contains filtered or unexported fields
}

A Component is an element of the map

func NewComponent

func NewComponent(id int64) *Component

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

func (c *Component) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point)

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) GetAbsoluteVisibility added in v0.8.1

func (c *Component) GetAbsoluteVisibility() int

GetAbsoluteVisibility returns the visibility of the component as seen from the anchor

func (*Component) GetLayer

func (c *Component) GetLayer() int

func (*Component) GetPosition

func (c *Component) GetPosition() image.Point

func (*Component) ID

func (c *Component) ID() int64

Component fulfils the graph.Node interface

func (*Component) MarshalSVG added in v0.3.3

func (c *Component) MarshalSVG(e *xml.Encoder, canvas image.Rectangle) error

func (*Component) String

func (c *Component) String() string

type EvolvedComponent

type EvolvedComponent struct {
	*Component
}

func NewEvolvedComponent

func NewEvolvedComponent(id int64) *EvolvedComponent

func (*EvolvedComponent) Draw added in v0.3.2

func (c *EvolvedComponent) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point)

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 (c *EvolvedComponent) MarshalSVG(e *xml.Encoder, canvas image.Rectangle) error

func (*EvolvedComponent) String

func (e *EvolvedComponent) String() string

Jump to

Keyboard shortcuts

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