Documentation ¶
Index ¶
- Constants
- func LimitAR(width, height, aspectRatio float64) (float64, float64)
- func TraceToShapeBorder(shape Shape, rectBorderPoint, prevPoint *geo.Point) *geo.Point
- type Shape
- func NewCallout(box *geo.Box) Shape
- func NewCircle(box *geo.Box) Shape
- func NewClass(box *geo.Box) Shape
- func NewCloud(box *geo.Box) Shape
- func NewCode(box *geo.Box) Shape
- func NewCylinder(box *geo.Box) Shape
- func NewDiamond(box *geo.Box) Shape
- func NewDocument(box *geo.Box) Shape
- func NewHexagon(box *geo.Box) Shape
- func NewImage(box *geo.Box) Shape
- func NewOval(box *geo.Box) Shape
- func NewPackage(box *geo.Box) Shape
- func NewPage(box *geo.Box) Shape
- func NewParallelogram(box *geo.Box) Shape
- func NewPerson(box *geo.Box) Shape
- func NewQueue(box *geo.Box) Shape
- func NewRealSquare(box *geo.Box) Shape
- func NewShape(shapeType string, box *geo.Box) Shape
- func NewSquare(box *geo.Box) Shape
- func NewStep(box *geo.Box) Shape
- func NewStoredData(box *geo.Box) Shape
- func NewTable(box *geo.Box) Shape
- func NewText(box *geo.Box) Shape
Constants ¶
const ( SQUARE_TYPE = "Square" REAL_SQUARE_TYPE = "RealSquare" PARALLELOGRAM_TYPE = "Parallelogram" DOCUMENT_TYPE = "Document" CYLINDER_TYPE = "Cylinder" QUEUE_TYPE = "Queue" PAGE_TYPE = "Page" PACKAGE_TYPE = "Package" STEP_TYPE = "Step" CALLOUT_TYPE = "Callout" STORED_DATA_TYPE = "StoredData" PERSON_TYPE = "Person" DIAMOND_TYPE = "Diamond" OVAL_TYPE = "Oval" CIRCLE_TYPE = "Circle" HEXAGON_TYPE = "Hexagon" CLOUD_TYPE = "Cloud" TABLE_TYPE = "Table" CLASS_TYPE = "Class" TEXT_TYPE = "Text" CODE_TYPE = "Code" IMAGE_TYPE = "Image" )
const CLOUD_SQUARE_INNER_HEIGHT = 0.663
const CLOUD_SQUARE_INNER_WIDTH = 0.663
const CLOUD_SQUARE_INNER_X = 0.167
The percentage values of the cloud's square inner box
const CLOUD_SQUARE_INNER_Y = 0.335
const CLOUD_TALL_ASPECT_BOUNDARY = (1 + CLOUD_TALL_INNER_WIDTH/CLOUD_TALL_INNER_HEIGHT) / 2
const CLOUD_TALL_INNER_HEIGHT = 0.820
const CLOUD_TALL_INNER_WIDTH = 0.549
const CLOUD_TALL_INNER_X = 0.228
The percentage values of the cloud's tall inner box
const CLOUD_TALL_INNER_Y = 0.179
const CLOUD_WIDE_ASPECT_BOUNDARY = (1 + CLOUD_WIDE_INNER_WIDTH/CLOUD_WIDE_INNER_HEIGHT) / 2
const CLOUD_WIDE_INNER_HEIGHT = 0.548
const CLOUD_WIDE_INNER_WIDTH = 0.819
const CLOUD_WIDE_INNER_X = 0.085
The percentage values of the cloud's wide inner box
const CLOUD_WIDE_INNER_Y = 0.409
const OVAL_AR_LIMIT = 3.
const (
PERSON_AR_LIMIT = 1.5
)
const STEP_WEDGE_WIDTH = 35.0
Variables ¶
This section is empty.
Functions ¶
func TraceToShapeBorder ¶
TraceToShapeBorder takes the point on the rectangular border r here is the point on rectangular border p is the prev point (used to calculate slope) s is the point on the actual shape border that'll be returned
. p . │ . │ . ▼ . ┌────r─────────────────────────┐ . │ │ . │ │ │ . │ │ xxxxxxxx │ . │ ▼ xxxxx xxxx │ . │ sxxx xx │ . │ x xx │ . │ xx xx │ . │ x xx │ . │ xx xxx │ . │ xxxx xxxx │ . └──────xxxxxxxxxxxxxx──────────┘
Types ¶
type Shape ¶
type Shape interface { Is(shape string) bool GetType() string AspectRatio1() bool IsRectangular() bool GetBox() *geo.Box GetInnerBox() *geo.Box // placing a rectangle of the given size and padding inside the shape, return the position relative to the shape's TopLeft GetInsidePlacement(width, height, paddingX, paddingY float64) geo.Point GetDimensionsToFit(width, height, paddingX, paddingY float64) (float64, float64) GetDefaultPadding() (paddingX, paddingY float64) // Perimeter returns a slice of geo.Intersectables that together constitute the shape border Perimeter() []geo.Intersectable GetSVGPathData() []string }
func NewCallout ¶
func NewCylinder ¶
func NewDiamond ¶
func NewDocument ¶
func NewHexagon ¶
func NewPackage ¶
func NewParallelogram ¶
func NewRealSquare ¶
func NewStoredData ¶
Source Files ¶
- shape.go
- shape_callout.go
- shape_circle.go
- shape_class.go
- shape_cloud.go
- shape_code.go
- shape_cylinder.go
- shape_diamond.go
- shape_document.go
- shape_hexagon.go
- shape_image.go
- shape_oval.go
- shape_package.go
- shape_page.go
- shape_parallelogram.go
- shape_person.go
- shape_queue.go
- shape_real_square.go
- shape_square.go
- shape_step.go
- shape_stored_data.go
- shape_table.go
- shape_text.go