# giggly v0.2.0 - Table of Contents > A grammar of graphics for Elixir, after R's ggplot2: map data to aesthetics, compose layers, scales, facets and coordinate systems, and draw SVG. ## Pages - Guides - [Fonts](fonts.md) ## Modules - [Giggly](Giggly.md): Giggly is a grammar-of-graphics plotting library for Elixir, modelled on ggplot2. - [Giggly.DataFrame](Giggly.DataFrame.md): A table of named columns of equal length, as Giggly holds one: the data a plot was given, and each table `Giggly.layer_data/2` returns, and the table a stat computes on. `names/1`, `row_count/1`, `dtypes/1` and `pull/2` read it; `new/1`, `from_table/1` and `put/3` build one; `select/2`, `slice/2`, `split/2`, `sort/2`, `distinct/1`, `filter/2`, `mutate/2`, `summarise/3` and `join/3` compute one from another. None takes an Elixir function, so an engine could run every one: code that needs a function pulls a column into a list and puts the result back. - [Giggly.Factor](Giggly.Factor.md): A column whose values have levels: the values it may hold, in an order of their own, which a plot follows wherever it orders the column's values: on an axis, in a legend, in the groups a stat counts and a position stacks, and in a facet's panels. - [Giggly.Geom](Giggly.Geom.md): How a layer's rows are drawn: the options a geom takes and the aesthetics it draws with, which a call is checked against, and setting its rows up during the build and drawing each panel's rows, each legend's keys and the room each key needs. - [Giggly.Geom.Context](Giggly.Geom.Context.md): What a geom draws with beyond its own rows, handed to `Giggly.Geom.draw_panel/3`, `draw_key/3` and `key_size/3`: where a panel's rows go and what the panel is like. - [Giggly.Geom.Path](Giggly.Geom.Path.md): Paths: a line through each group's rows in their order, at each row's `x` and `y`, in the group's `color`, `alpha`, `linewidth` and `linetype`; where any of those vary along a group, its rows are drawn a segment at a time, each in its start's look. A row missing a position breaks its line. - [Giggly.Geom.Point](Giggly.Geom.Point.md): Points: one at each row's `x` and `y`, drawn in its `shape`, `size`, `stroke`, `color`, `fill` and `alpha`, each whole before the next. - [Giggly.Geom.Polygon](Giggly.Geom.Polygon.md): Polygons: each group a shape through its rows in order, at each row's `x` and `y`, filled with its first row's `fill` at its `alpha` and bordered in its `color`, `linewidth` and `linetype`; a group's `subgroup`s are rings of one shape, holes among them, filled by `rule:`. - [Giggly.Geom.Rect](Giggly.Geom.Rect.md): Rectangles: one for each row, from its `xmin` to its `xmax` and its `ymin` to its `ymax`, filled with its `fill` at its `alpha` and bordered in its `color`, `linewidth` and `linetype`. - [Giggly.Geom.Ribbon](Giggly.Geom.Ribbon.md): Ribbons: a band through each group's rows, between each row's `ymin` and `ymax` along `x`, or its `xmin` and `xmax` along `y`, filled with its `fill` at its `alpha` and outlined in its `color`, `linewidth` and `linetype` along the edges `outline_type:` names. A row missing a position it needs breaks the band. Its setup puts the rows in order along the band and records which way it runs. - [Giggly.Geom.Segment](Giggly.Geom.Segment.md): Segments: a straight line from each row's `x` and `y` to its `xend` and `yend`, in its `color`, `alpha`, `linewidth` and `linetype`, in row order; where straight lines bend in the panel, each is drawn as a two-point path. - [Giggly.Geom.Text](Giggly.Geom.Text.md): Text: each row's `label` at its `x` and `y`, written in its `size`, `family`, `fontface`, `color` and `alpha`, turned its `angle`, justified by its `hjust` and `vjust`, its lines `lineheight` apart. - [Giggly.Label](Giggly.Label.md): A label another library lays out and draws, given wherever a plot takes a title's string: any `Giggly.Plot.labs/2` title, a scale's `name:`, a secondary axis's `name:` or a guide's `title:`; a text or label annotation's `label:` (`Giggly.Plot.annotate/3`); a scale's `labels:`, in its list or map or returned by its labels function, a break's label on an axis or a legend's key's label; a facet's strip, given by a `labeller:` function or map; and a text or label layer's rows, each row's label handed to its `label_with:` function (`Giggly.Plot.geom_text/3`, `Giggly.Plot.geom_label/3`), as ggplot2's `parse = TRUE` parses it. A library that sets maths or other markup implements this protocol for a struct of its own, and that struct then goes where a string would. - [Giggly.Label.Layout](Giggly.Label.Layout.md): A label's layout (`Giggly.Label`): its box, in points, and its drawing. - [Giggly.Label.Style](Giggly.Label.Style.md): The style Giggly asks a label (`Giggly.Label`) to draw itself in: what the theme gives the title it stands for, or what an annotation gives its label. - [Giggly.Mapping](Giggly.Mapping.md): What a mapping maps each aesthetic to: a column, an expression computed from columns in each row, a constant, or a list of values, one for each row. A mapping is a map from aesthetic to value - [Giggly.Plot](Giggly.Plot.md): Describes a plot: its data, a mapping from aesthetics to columns, and layers added with a pipe. - [Giggly.Position](Giggly.Position.md): Where a layer's marks move once its stat has run: piled on one another, set side by side, nudged, jittered, or anything a plugin's position does, and the options it takes and the aesthetics it needs and reads. - [Giggly.Scale.Binned](Giggly.Scale.Binned.md): A binned scale: a colour, fill, alpha, shape, size, line type, line width or position scale that cuts its continuous values into bins at its breaks and gives every value in a bin the same colour, opacity, shape, size, line type or width, or, for x or y, the same place on its axis. `Giggly.Plot.scale_x_binned/2` and `Giggly.Plot.scale_color_binned/2` among others record one with the options they are given and no range, and `Giggly.panel_scales/2` returns an axis's trained. Its fields - [Giggly.Scale.Continuous](Giggly.Scale.Continuous.md): A continuous scale. `Giggly.Plot.scale_x_continuous/2`, `Giggly.Plot.scale_x_date/2`, `Giggly.Plot.scale_x_datetime/2` and `Giggly.Plot.scale_x_time/2` record one with the options they are given and no range, and `Giggly.panel_scales/2` returns an axis's trained. Its fields - [Giggly.Scale.Discrete](Giggly.Scale.Discrete.md): A discrete scale. `Giggly.Plot.scale_x_discrete/2` records one with the options it is given and no levels, and `Giggly.panel_scales/2` returns an axis's trained. Its fields - [Giggly.Scale.Secondary](Giggly.Scale.Secondary.md): A position scale's secondary axis, drawn opposite its axis. `Giggly.Plot`'s position scale functions record one from their `sec_axis:` option in the scale's `secondary` field, which is `:none` for a scale without one. Its fields - [Giggly.Stat](Giggly.Stat.md): How a stat computes a layer's table before it is positioned and drawn: counting rows, binning them, summarising them, or anything a plugin's stat does, and the options it takes and the aesthetics it reads, needs, writes and refuses, which a call is checked against. - [Giggly.Stat.Carry](Giggly.Stat.Carry.md): The columns a summarising stat carries from a group's rows to the rows it computes for the group: each column holding one value within every group, `:panel` and `:group` among them, while one that varies within any group is dropped. So a colour mapped by group, constant within each, survives a stat that collapses each group to a row.