Sheetshow.Op.SetDimensions (Sheetshow v0.1.0)

Copy Markdown View Source

Sets the width of columns or the height of rows, in pixels.

indexes is 0-indexed and inclusive, and axis says which dimension they count. Widths and heights belong to the grid rather than to any cell, which is why the :col_width and :row_height styles are lifted out into ops of their own.

iex> Sheetshow.Op.SetDimensions.new("Costs", :cols, 0..1, 180)
%Sheetshow.Op.SetDimensions{sheet: "Costs", axis: :cols, indexes: 0..1, pixels: 180}

Summary

Functions

Builds the op. The indexes must ascend by one from 0 or later, and the size must be a positive number of pixels.

Types

axis()

@type axis() :: :rows | :cols

t()

@type t() :: %Sheetshow.Op.SetDimensions{
  axis: axis(),
  indexes: Range.t(),
  pixels: pos_integer(),
  sheet: String.t()
}

Functions

new(sheet, axis, indexes, pixels)

@spec new(String.t(), axis(), Range.t(), pos_integer()) :: t()

Builds the op. The indexes must ascend by one from 0 or later, and the size must be a positive number of pixels.

iex> Sheetshow.Op.SetDimensions.new("Costs", :rows, 2..2, 40).indexes
2..2