Grid

public struct Grid : Encodable

Undocumented

  • The number of rows in the grid.

    If you provide a 2D subplots array or a yaxes array, its length is used as the default. But it’s also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots.

    Declaration

    Swift

    public var rows: Int?
  • Is the first row the top or the bottom? Note that columns are always enumerated from left to right.

    See more

    Declaration

    Swift

    public enum RowOrder : String, Encodable
  • Is the first row the top or the bottom? Note that columns are always enumerated from left to right.

    Declaration

    Swift

    public var rowOrder: RowOrder?
  • The number of columns in the grid.

    If you provide a 2D subplots array, the length of its longest row is used as the default. If you give an xaxes array, its length is used as the default. But it’s also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots.

    Declaration

    Swift

    public var columns: Int?
  • Used for freeform grids, where some axes may be shared across subplots but others are not.

    Each entry should be a cartesian subplot id, like xy or x3y2, or ** to leave that cell empty. You may reuse x axes within the same column, and y axes within the same row. Non-cartesian subplots and traces that support domain can place themselves in this grid separately using the gridcell attribute.

    Declaration

    Swift

    public var subplots: InfoArray?
  • Used with yaxes when the x and y axes are shared across columns and rows.

    Each entry should be an x axis id like x, x2, etc., or ** to not put an x axis in that column. Entries other than ** must be unique. Ignored if subplots is present. If missing but yaxes is present, will generate consecutive IDs.

    Declaration

    Swift

    public var xAxes: InfoArray?
  • Used with yaxes when the x and y axes are shared across columns and rows.

    Each entry should be an y axis id like y, y2, etc., or ** to not put a y axis in that row. Entries other than ** must be unique. Ignored if subplots is present. If missing but xaxes is present, will generate consecutive IDs.

    Declaration

    Swift

    public var yAxes: InfoArray?
  • If no subplots, xaxes, or yaxes are given but we do have rows and columns, we can generate defaults using consecutive axis IDs, in two ways: coupled gives one x axis per column and one y axis per row.

    independent uses a new xy pair for each cell, left-to-right across each row then iterating rows according to roworder.

    See more

    Declaration

    Swift

    public enum Pattern : String, Encodable
  • If no subplots, xaxes, or yaxes are given but we do have rows and columns, we can generate defaults using consecutive axis IDs, in two ways: coupled gives one x axis per column and one y axis per row.

    independent uses a new xy pair for each cell, left-to-right across each row then iterating rows according to roworder.

    Declaration

    Swift

    public var pattern: Pattern?
  • Horizontal space between grid cells, expressed as a fraction of the total width available to one cell.

    Defaults to 0.1 for coupled-axes grids and 0.2 for independent grids.

    Declaration

    Swift

    public var xGap: Double?
  • Vertical space between grid cells, expressed as a fraction of the total height available to one cell.

    Defaults to 0.1 for coupled-axes grids and 0.3 for independent grids.

    Declaration

    Swift

    public var yGap: Double?
  • Undocumented

    See more

    Declaration

    Swift

    public struct Domain : Encodable
  • Undocumented

    Declaration

    Swift

    public var domain: Domain?
  • Sets where the x axis labels and titles go.

    bottom means the very bottom of the grid. bottom plot is the lowest plot that each x axis is used in. top and top plot are similar.

    See more

    Declaration

    Swift

    public enum XSide : String, Encodable
  • Sets where the x axis labels and titles go.

    bottom means the very bottom of the grid. bottom plot is the lowest plot that each x axis is used in. top and top plot are similar.

    Declaration

    Swift

    public var xSide: XSide?
  • Sets where the y axis labels and titles go.

    left means the very left edge of the grid. left plot is the leftmost plot that each y axis is used in. right and right plot are similar.

    See more

    Declaration

    Swift

    public enum YSide : String, Encodable
  • Sets where the y axis labels and titles go.

    left means the very left edge of the grid. left plot is the leftmost plot that each y axis is used in. right and right plot are similar.

    Declaration

    Swift

    public var ySide: YSide?
  • Creates Grid object with specified properties.

    Declaration

    Swift

    public init(rows: Int? = nil, rowOrder: RowOrder? = nil, columns: Int? = nil, subplots:
            InfoArray? = nil, xAxes: InfoArray? = nil, yAxes: InfoArray? = nil, pattern: Pattern? = nil,
            xGap: Double? = nil, yGap: Double? = nil, domain: Domain? = nil, xSide: XSide? = nil, ySide:
            YSide? = nil)

    Parameters

    rows

    The number of rows in the grid.

    rowOrder

    Is the first row the top or the bottom? Note that columns are always enumerated from left to right.

    columns

    The number of columns in the grid.

    subplots

    Used for freeform grids, where some axes may be shared across subplots but others are not.

    xAxes

    Used with yaxes when the x and y axes are shared across columns and rows.

    yAxes

    Used with yaxes when the x and y axes are shared across columns and rows.

    pattern

    If no subplots, xaxes, or yaxes are given but we do have rows and columns, we can generate defaults using consecutive axis IDs, in two ways: coupled gives one x axis per column and one y axis per row.

    xGap

    Horizontal space between grid cells, expressed as a fraction of the total width available to one cell.

    yGap

    Vertical space between grid cells, expressed as a fraction of the total height available to one cell.

    domain

    xSide

    Sets where the x axis labels and titles go.

    ySide

    Sets where the y axis labels and titles go.