Documentation
¶
Index ¶
- Constants
- func AWSShape(group string, title string) string
- func AllAWSShapes() map[string]map[string]string
- func CreateCSV(drawIOHeader Header, headerRow []string, contents []map[string]string, ...)
- func GetContentsFromFileAsStringMaps(filename string) []map[string]string
- func GetHeaderAndContentsFromFile(filename string) (map[string]int, [][]string)
- type Connection
- type Header
- func (header *Header) AddConnection(connection Connection)
- func (header *Header) GetSpacing() (nodespacing, levelspacing, edgespacing int)
- func (header *Header) IsSet() bool
- func (header *Header) SetHeightAndWidth(height, width string)
- func (header *Header) SetIdentity(columnname string)
- func (header *Header) SetLayout(layout string)
- func (header *Header) SetLeftAndTopColumns(left, top string)
- func (header *Header) SetLink(columnname string)
- func (header *Header) SetNamespace(namespace string)
- func (header *Header) SetPadding(padding int)
- func (header *Header) SetParent(parent, parentStyle string)
- func (header *Header) SetSpacing(nodespacing, levelspacing, edgespacing int)
- func (header *Header) String() string
Constants ¶
const ( LayoutAuto = "auto" LayoutNone = "none" LayoutHorizontalFlow = "horizontalflow" LayoutVerticalFlow = "verticalflow" LayoutHorizontalTree = "horizontaltree" LayoutVerticalTree = "verticaltree" LayoutOrganic = "organic" LayoutCircle = "circle" )
Standard layout styles for draw.io.
const BidirectionalConnectionStyle = "curved=1;endArrow=blockThin;endFill=1;fontSize=11;startArrow=blockThin;startFill=1;"
const DefaultConnectionStyle = "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"
DefaultConnectionStyle is the default style for connecting nodes.
const DefaultParentStyle = "" /* 129-byte string literal not displayed */
DefaultParentStyle is the default style for parent-child relationships.
Variables ¶
This section is empty.
Functions ¶
func AWSShape ¶
AWSShape returns the shape for a desired service TODO: Add error handling for unfound shapes
func AllAWSShapes ¶
AllAWSShapes returns the full map of shapes
func CreateCSV ¶
func CreateCSV(drawIOHeader Header, headerRow []string, contents []map[string]string, filename string)
CreateCSV creates the CSV complete with the header
func GetContentsFromFileAsStringMaps ¶
GetContentsFromFileAsStringMaps returns the CSV contents as a slice of string maps
Types ¶
type Connection ¶
type Connection struct { From string `json:"from"` To string `json:"to"` Invert bool `json:"invert"` Label string `json:"label"` Style string `json:"style"` }
Connection is a representation Draw.IO CSV import connection value.
func NewConnection ¶
func NewConnection() Connection
NewConnection creates a new connection object using default values
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header is a representation of the Draw.IO CSV import header.
func DefaultHeader ¶
func DefaultHeader() Header
DefaultHeader returns a header with: label: %Name%, style: %Image%, ignore: Image
func NewHeader ¶
NewHeader returns a header with the provided label, style, and ignore label: Node label with placeholders and HTML. style: Node style (placeholders (defined as '%name%') are replaced once). ignore: Comma-separated list of ignored columns for metadata. (These can be used for connections and styles but will not be added as metadata.)
func (*Header) AddConnection ¶
func (header *Header) AddConnection(connection Connection)
AddConnection adds a connection object to the header
func (*Header) GetSpacing ¶
GetSpacing retrieves the current spacing values nodespacing: Spacing between nodes levelspacing: Spacing between levels of hierarchical layouts edgespacing: Spacing between parallel edges
func (*Header) SetHeightAndWidth ¶
SetHeightAndWidth sets the height and width values of the nodes Possible values are a number (in px), auto or an @ sign followed by a column name that contains the value for the width. Default for both is auto.
func (*Header) SetIdentity ¶
SetIdentity uses the given column name as the identity for cells (updates existing cells).
func (*Header) SetLeftAndTopColumns ¶
SetLeftAndTopColumns lets you set the column names storing x (left) and y (top) coordinates When using anything other than none for layout, this will be ignored
func (*Header) SetNamespace ¶
SetNamespace adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration). This should be ignored by draw.io when identity is used, but regardless it is always ignored. Only left in here in case it is fixed. Default is csvimport-
func (*Header) SetPadding ¶
SetPadding is for setting the padding when width and/or height are set to auto
func (*Header) SetParent ¶
SetParent sets the parent information. Requires identity to be set as well parent: Uses the given column name as the parent reference for cells (refers to the identity column). Set to - to remove. Default is unused parentStyle: Parent style for nodes with child nodes (placeholders defined with %columnname% are replaced once). Only used when parent is defined. Default is value of DefaultParentStyle
func (*Header) SetSpacing ¶
SetSpacing sets the spacing between the nodes at different levels nodespacing: Spacing between nodes. Default is 40. levelspacing: Spacing between levels of hierarchical layouts. Default is 100. edgespacing: Spacing between parallel edges. Default is 40. Use 0 to disable.