Help us shape the future of Go! Take the 2026 Go Developer Survey

aes

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package aes provides aesthetic mapping constructors for the Grammar of Graphics. Aesthetics define how data variables map to visual properties like position, color, size, and shape.

Usage:

p := ggplot.New(ds,
    aes.X("col_x"),       // map column "col_x" to x-axis
    aes.Y("col_y"),       // map column "col_y" to y-axis
    aes.Color("group"),   // map column "group" to color
)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mapping

type Mapping struct {
	Channel string // aesthetic name: "x", "y", "color", "fill", "size", "shape", "alpha", "group", "label", "linetype"
	Column  string // column name in the dataset
}

Mapping binds an aesthetic channel to a data source.

func Alpha

func Alpha(col string) Mapping

Alpha maps a column to the opacity aesthetic.

func AriaLabel added in v0.0.11

func AriaLabel(col string) Mapping

AriaLabel maps a column to the ARIA accessibility label aesthetic. In SVG output, primitives get an aria-label attribute for screen readers.

func Color

func Color(col string) Mapping

Color maps a column to the color aesthetic.

func Fill

func Fill(col string) Mapping

Fill maps a column to the fill color aesthetic.

func Group

func Group(col string) Mapping

Group maps a column to the grouping aesthetic (for line connections, etc.).

func Href added in v0.0.11

func Href(col string) Mapping

Href maps a column to the hyperlink aesthetic. In SVG output, primitives are wrapped in <a href="...">. PDF may emit link annotations. PNG output ignores this aesthetic.

func Label

func Label(col string) Mapping

Label maps a column to the text label aesthetic.

func Linetype added in v0.0.8

func Linetype(col string) Mapping

Linetype maps a column to the line dash pattern aesthetic.

func Shape

func Shape(col string) Mapping

Shape maps a column to the point shape aesthetic.

func Size

func Size(col string) Mapping

Size maps a column to the size aesthetic.

func Title added in v0.0.11

func Title(col string) Mapping

Title maps a column to the SVG <title> tooltip aesthetic. In SVG output, each primitive gets a <title> child element for hover tooltips. PNG and PDF output ignore this aesthetic.

func Weight

func Weight(col string) Mapping

Weight maps a column to a statistical weight aesthetic.

func X

func X(col string) Mapping

X maps a column to the x-axis position aesthetic.

func XEnd added in v0.0.5

func XEnd(col string) Mapping

XEnd maps a column to the end x-position of a segment.

func XMax

func XMax(col string) Mapping

XMax maps a column to the right bound of a range aesthetic.

func XMin

func XMin(col string) Mapping

XMin maps a column to the left bound of a range aesthetic.

func Y

func Y(col string) Mapping

Y maps a column to the y-axis position aesthetic.

func YEnd added in v0.0.5

func YEnd(col string) Mapping

YEnd maps a column to the end y-position of a segment.

func YMax

func YMax(col string) Mapping

YMax maps a column to the upper bound of a range aesthetic.

func YMin

func YMin(col string) Mapping

YMin maps a column to the lower bound of a range aesthetic (e.g., error bars).

Jump to

Keyboard shortcuts

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