area

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Circle

func Circle(x int, y int, radius int, href string) *element

Circle Creates a circular area element with centre coordinates, radius, and href. Convenient constructor for circular clickable regions. The coordinates represent the centre (x,y) and radius of the circle. Example: area.Circle(130, 136, 60, "/products") Renders: <area shape="circle" coords="130,136,60" href="/products" />

func Default

func Default(href string) *element

Default Creates a default area element that covers the entire image. Used as a fallback when no other areas match. The default shape covers the entire image and is typically used last in the area list. Example: area.Default("https://example.com") Renders: <area shape="default" href="https://example.com" />

func New

func New() *element

New Creates a new area element without any initial attributes. Example: area.New() Renders: <area />

func Poly

func Poly(coords string, href string) *element

Poly Creates a polygonal area element with coordinates and href. Used for irregular shapes defined by multiple coordinate pairs. Coordinates are comma-separated x,y pairs that define the polygon vertices. Example: area.Poly("74,0,113,29,98,72,52,72,38,29", "/contact") Renders: <area shape="poly" coords="74,0,113,29,98,72,52,72,38,29" href="/contact" />

func Rect

func Rect(x1 int, y1 int, x2 int, y2 int, href string) *element

Rect Creates a rectangular area element with coordinates and href. Convenient constructor for rectangular clickable regions. The coordinates represent the top-left (x1,y1) and bottom-right (x2,y2) corners of the rectangle. Example: area.Rect(34, 44, 270, 350, "https://example.com") Renders: <area shape="rect" coords="34,44,270,350" href="https://example.com" />

Types

type Element

type Element = element

Element is an exported alias for the private element type

Jump to

Keyboard shortcuts

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