XLSXComposer.Section (xlsx_composer v0.2.0)

View Source

Elixir.XLSXComposer.Section allows to group cells into units that we can reason and test on that level.

WARNING! : limit number of Sections otherwise the process of the checks might hurt your performance! Soon, implementation of checking of Sections overlap will have to be done so use Section carefully.

Summary

Functions

Find a point just below the area of the section. It should be used to ensure the sections are below each other. It allows opts

Find a point just to the right to the area of the section. It should be used to ensure the sections are by each other. It allows opts

Types

area_t()

name_t()

@type name_t() :: String.t()

new_attrs()

@type new_attrs() :: %{
  name: name_t(),
  top_left: XLSXComposer.ExcelCoords.t(),
  cells: XLSXComposer.CellDef.section_cells()
}

t()

@type t() :: %XLSXComposer.Section{
  bottom_right: XLSXComposer.ExcelCoords.t(),
  cells: XLSXComposer.CellDef.section_cells(),
  name: name_t(),
  top_left: XLSXComposer.ExcelCoords.t()
}

Functions

just_below(section, opts \\ [])

Find a point just below the area of the section. It should be used to ensure the sections are below each other. It allows opts:

  • move_x: integer(), default: 0
  • move_y: non_neg_integer(), default: 0

TL - top left BR - bottom right TB - target below


A1A2A3A4A5
B1TLB3B4B5
C1C2C3C4C5
D1D2D3BRD5
E1TBE3E4E5

just_to_the_right(section, opts \\ [])

Find a point just to the right to the area of the section. It should be used to ensure the sections are by each other. It allows opts:

  • move_x: non_neg_integer(), default: 0
  • move_y: integer(), default: 0

TL - top left BR - bottom right TR - target right


A1A2A3A4A5
B1TLB3B4TR
C1C2C3C4C5
D1D2D3BRD5
E1E2E3E4E5

new(args)

@spec new(new_attrs()) :: t()

overlap?(section_1, section_2)

@spec overlap?(t(), t()) :: any()

reduce_to_excel_cells(sections)

@spec reduce_to_excel_cells([t()]) :: XLSXComposer.CellDef.excel_cells()

to_excel_cells(section)

@spec to_excel_cells(t()) :: XLSXComposer.CellDef.excel_cells()