package matrix

  1. Overview
  2. Docs

Module Matrix_grid.BorderSource

Box-drawing characters.

Box-drawing characters, the sets Matrix_grid.draw_box draws borders with.

A border gives the 11 scalars that draw a box and the lines that divide it. These are the four corners, the horizontal and vertical edges, the four T-junctions, and the cross. Each must be one cell wide, since a box gives each one cell.

Borders

Sourcetype t = {
  1. top_left : Uchar.t;
  2. top_right : Uchar.t;
  3. bottom_left : Uchar.t;
  4. bottom_right : Uchar.t;
  5. horizontal : Uchar.t;
  6. vertical : Uchar.t;
  7. top_t : Uchar.t;
  8. bottom_t : Uchar.t;
  9. left_t : Uchar.t;
  10. right_t : Uchar.t;
  11. cross : Uchar.t;
}

The type for borders.

Presets

Sourceval single : t

single is the light border ┌ ┐ └ ┘ ─ │ ┬ ┴ ├ ┤ ┼.

Sourceval double : t

double is the double border ╔ ╗ ╚ ╝ ═ ║ ╦ ╩ ╠ ╣ ╬.

Sourceval rounded : t

rounded is the light border with round corners ╭ ╮ ╰ ╯ ─ │ ┬ ┴ ├ ┤ ┼.

Sourceval heavy : t

heavy is the heavy border ┏ ┓ ┗ ┛ ━ ┃ ┳ ┻ ┣ ┫ ╋.

Sourceval ascii : t

ascii is the border of ASCII characters + + + + - | + + + + +, for terminals without box-drawing characters.

Sourceval empty : t

empty is the border of spaces.

Customizing

Sourceval modify : ?top_left:Uchar.t -> ?top_right:Uchar.t -> ?bottom_left:Uchar.t -> ?bottom_right:Uchar.t -> ?horizontal:Uchar.t -> ?vertical:Uchar.t -> ?top_t:Uchar.t -> ?bottom_t:Uchar.t -> ?left_t:Uchar.t -> ?right_t:Uchar.t -> ?cross:Uchar.t -> t -> t

modify ?top_left ... base is base with the characters given in place of its own.

Sides

Sourcetype side = [
  1. | `Top
  2. | `Right
  3. | `Bottom
  4. | `Left
]

The type for box sides.

Sourceval all : side list

all is [\`Top; \`Right; \`Bottom; \`Left].