XLSXComposer.Section (xlsx_composer v0.3.0)
View SourceElixir.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
Identifies by how much you have to move the x value of the new Section's top_left
point to just right another section.
Simply: A scenario: you want to find the top_left
point of section_2 based of the section_1 (which is a reference here).
If section_1 is empty, then section_2 can start from the same top_left
, so move by 0.
Otherwise, we have to move by 1.
Identifies by how much you have to move the y value of the new Section's top_left
point to just below another section.
Simply: A scenario: you want to find the top_left
point of section_2 based of the section_1 (which is a reference here).
If section_1 is empty, then section_2 can start from the same top_left
, so move by 0.
Otherwise, we have to move by 1.
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
@type area_t() :: {XLSXComposer.ExcelCoords.t(), XLSXComposer.ExcelCoords.t()}
@type name_t() :: String.t()
@type new_attrs() :: %{ name: name_t(), top_left: XLSXComposer.ExcelCoords.t(), cells: XLSXComposer.CellDef.section_cells() }
@type t() :: %XLSXComposer.Section{ bottom_right: XLSXComposer.ExcelCoords.t(), cells: XLSXComposer.CellDef.section_cells(), name: name_t(), top_left: XLSXComposer.ExcelCoords.t() }
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:
- move_x: integer(), default: 0
- move_y: non_neg_integer(), default: 0
TL - top left BR - bottom right TB - target below
A1 | A2 | A3 | A4 | A5 |
B1 | TL | B3 | B4 | B5 |
C1 | C2 | C3 | C4 | C5 |
D1 | D2 | D3 | BR | D5 |
E1 | TB | E3 | E4 | E5 |
@spec move_x_just_right(t()) :: 0 | 1
Identifies by how much you have to move the x value of the new Section's top_left
point to just right another section.
Simply: A scenario: you want to find the top_left
point of section_2 based of the section_1 (which is a reference here).
If section_1 is empty, then section_2 can start from the same top_left
, so move by 0.
Otherwise, we have to move by 1.
@spec move_y_just_below(t()) :: 0 | 1
Identifies by how much you have to move the y value of the new Section's top_left
point to just below another section.
Simply: A scenario: you want to find the top_left
point of section_2 based of the section_1 (which is a reference here).
If section_1 is empty, then section_2 can start from the same top_left
, so move by 0.
Otherwise, we have to move by 1.
@spec reduce_to_excel_cells([t()]) :: XLSXComposer.CellDef.excel_cells()
@spec to_excel_cells(t()) :: XLSXComposer.CellDef.excel_cells()
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
A1 | A2 | A3 | A4 | A5 |
B1 | TL | B3 | B4 | TR |
C1 | C2 | C3 | C4 | C5 |
D1 | D2 | D3 | BR | D5 |
E1 | E2 | E3 | E4 | E5 |