tikz

package
v0.0.0-...-6761f54 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const VERSION = "v0.1"

Variables

This section is empty.

Functions

func NewCompiler

func NewCompiler(page *fig.NodeChange, opts *CompilerOpts) string

Types

type AlignAttribute

type AlignAttribute string

func (AlignAttribute) GetPosition

func (a AlignAttribute) GetPosition() Position

func (AlignAttribute) HasPosition

func (a AlignAttribute) HasPosition() bool

func (AlignAttribute) SetPosition

func (a AlignAttribute) SetPosition(p Position)

func (AlignAttribute) String

func (a AlignAttribute) String() string

type AnchorAttribute

type AnchorAttribute string

func (AnchorAttribute) GetPosition

func (a AnchorAttribute) GetPosition() Position

func (AnchorAttribute) HasPosition

func (a AnchorAttribute) HasPosition() bool

func (AnchorAttribute) SetPosition

func (a AnchorAttribute) SetPosition(p Position)

func (AnchorAttribute) String

func (a AnchorAttribute) String() string

type Attribute

type Attribute interface {
	HasPosition() bool
	GetPosition() Position
	SetPosition(p Position)
	String() string
}

type AttributeList

type AttributeList []Attribute

func (AttributeList) MinX

func (a AttributeList) MinX() float32

func (AttributeList) String

func (a AttributeList) String() string

type Axis

type Axis int
const (
	AxisX Axis = iota
	AxisY
)

type ColorAttribute

type ColorAttribute string

func (ColorAttribute) GetPosition

func (c ColorAttribute) GetPosition() Position

func (ColorAttribute) HasPosition

func (c ColorAttribute) HasPosition() bool

func (ColorAttribute) SetPosition

func (c ColorAttribute) SetPosition(p Position)

func (ColorAttribute) String

func (c ColorAttribute) String() string

type Compiler

type Compiler struct {
	// contains filtered or unexported fields
}

func (*Compiler) AddElement

func (c *Compiler) AddElement(el fmt.Stringer)

func (*Compiler) CleanupText

func (c *Compiler) CleanupText(t string) string

func (*Compiler) ConvertPageToTikz

func (c *Compiler) ConvertPageToTikz() string

func (*Compiler) FindNode

func (c *Compiler) FindNode(g *fig.GUID) DrawingNode

func (*Compiler) IsArrowDiagonal

func (c *Compiler) IsArrowDiagonal(start, end Position) bool

func (*Compiler) MagnetToDirection

func (c *Compiler) MagnetToDirection(magnet fig.ConnectorMagnet) Direction

func (*Compiler) PositionForNode

func (c *Compiler) PositionForNode(node DrawingNode, magnet fig.ConnectorMagnet) (pos Position)

type CompilerOpts

type CompilerOpts struct {
	DebugMagnets       bool
	DebugControlPoints bool
	FilePath           string
}

type Direction

type Direction int
const (
	TopDirection Direction = iota
	RightDirection
	BottomDirection
	LeftDirection
)

type Draw

type Draw struct {
	Attributes AttributeList
	Points     PositionList
	Text       *string
	Kind       *string
}

func (*Draw) AdjustX

func (d *Draw) AdjustX(offset float32)

func (*Draw) String

func (d *Draw) String() string

type DrawAttribute

type DrawAttribute string

func (DrawAttribute) GetPosition

func (d DrawAttribute) GetPosition() Position

func (DrawAttribute) HasPosition

func (d DrawAttribute) HasPosition() bool

func (DrawAttribute) SetPosition

func (d DrawAttribute) SetPosition(p Position)

func (DrawAttribute) String

func (d DrawAttribute) String() string

type DrawingNode

type DrawingNode struct {
	Node *fig.NodeChange
	Q1   Position
	Q2   Position
	Size Position
}

func MakeDrawingNode

func MakeDrawingNode(v *fig.NodeChange) DrawingNode

func (DrawingNode) RelativeSideOf

func (d DrawingNode) RelativeSideOf(other DrawingNode) (s Side)

type FillAttribute

type FillAttribute struct{ Value string }

func (*FillAttribute) GetPosition

func (f *FillAttribute) GetPosition() Position

func (*FillAttribute) HasPosition

func (f *FillAttribute) HasPosition() bool

func (*FillAttribute) SetPosition

func (f *FillAttribute) SetPosition(p Position)

func (*FillAttribute) String

func (f *FillAttribute) String() string

type FillDraw

type FillDraw struct {
	Attributes AttributeList
	Position   Position
	Shape      string
	Size       string
}

func (*FillDraw) AdjustX

func (f *FillDraw) AdjustX(offset float32)

func (*FillDraw) String

func (f *FillDraw) String() string

type Node

type Node struct {
	Attributes AttributeList
	Position   Position
	Text       *string
}

func (*Node) AdjustX

func (n *Node) AdjustX(offset float32)

func (*Node) String

func (n *Node) String() string

type Position

type Position struct {
	X, Y float32
}

func (Position) AxisRelativeTo

func (p Position) AxisRelativeTo(p2 Position) Axis

func (Position) Diff

func (p Position) Diff(of Position) Position

func (Position) DirectionTo

func (p Position) DirectionTo(pos Position) Direction

func (Position) MiddleWith

func (p Position) MiddleWith(p2 Position) Position

func (Position) String

func (p Position) String() string

func (Position) Sub

func (p Position) Sub(pos Position) Position

func (Position) Sum

func (p Position) Sum(p2 Position) Position

type PositionList

type PositionList []Position

func (PositionList) String

func (p PositionList) String() string

type RotateAroundAttribute

type RotateAroundAttribute struct {
	Degrees  int
	Position Position
}

func (*RotateAroundAttribute) GetPosition

func (r *RotateAroundAttribute) GetPosition() Position

func (*RotateAroundAttribute) HasPosition

func (r *RotateAroundAttribute) HasPosition() bool

func (*RotateAroundAttribute) SetPosition

func (r *RotateAroundAttribute) SetPosition(p Position)

func (*RotateAroundAttribute) String

func (r *RotateAroundAttribute) String() string

type RoundedCornersAttribute

type RoundedCornersAttribute struct{ Value int }

func (*RoundedCornersAttribute) GetPosition

func (r *RoundedCornersAttribute) GetPosition() Position

func (*RoundedCornersAttribute) HasPosition

func (r *RoundedCornersAttribute) HasPosition() bool

func (*RoundedCornersAttribute) SetPosition

func (r *RoundedCornersAttribute) SetPosition(p Position)

func (*RoundedCornersAttribute) String

func (r *RoundedCornersAttribute) String() string

type ScaleAroundAttribute

type ScaleAroundAttribute struct {
	Scale    float32
	Position Position
}

func (*ScaleAroundAttribute) GetPosition

func (s *ScaleAroundAttribute) GetPosition() Position

func (*ScaleAroundAttribute) HasPosition

func (s *ScaleAroundAttribute) HasPosition() bool

func (*ScaleAroundAttribute) SetPosition

func (s *ScaleAroundAttribute) SetPosition(p Position)

func (*ScaleAroundAttribute) String

func (s *ScaleAroundAttribute) String() string

type Shape

type Shape struct {
	Attributes AttributeList
	P1, P2     Position
	Text       *string
	Kind       string
}

func (*Shape) AdjustX

func (s *Shape) AdjustX(offset float32)

func (*Shape) String

func (s *Shape) String() string

type Side

type Side int
const (
	LeftSide Side = 1 << iota
	RightSide
	TopSide
	BottomSide
	HorizontallyEqual
	VerticallyEqual
)

func (Side) Is

func (s Side) Is(o Side) bool

type ThickAttribute

type ThickAttribute struct{}

func (*ThickAttribute) GetPosition

func (t *ThickAttribute) GetPosition() Position

func (*ThickAttribute) HasPosition

func (t *ThickAttribute) HasPosition() bool

func (*ThickAttribute) SetPosition

func (t *ThickAttribute) SetPosition(p Position)

func (*ThickAttribute) String

func (t *ThickAttribute) String() string

type ToAttribute

type ToAttribute struct{}

func (*ToAttribute) GetPosition

func (t *ToAttribute) GetPosition() Position

func (*ToAttribute) HasPosition

func (t *ToAttribute) HasPosition() bool

func (*ToAttribute) SetPosition

func (t *ToAttribute) SetPosition(p Position)

func (*ToAttribute) String

func (t *ToAttribute) String() string

type XAdjuster

type XAdjuster interface {
	AdjustX(offset float32)
}

Jump to

Keyboard shortcuts

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