summaryrefslogtreecommitdiff
path: root/src/marker.ml
blob: 7d37e2a67d03507d5c5a0eef5563b196a3aefb1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
type t =
  | Point
  | Pixel
  | Circle
  | TriangleDown
  | TriangleUp
  | TriangleLeft
  | TriangleRight
  | Custom of string

exception Invalid_marker_length

let of_string s =
  if String.length s <> 1 then raise Invalid_marker_length else Custom s

let pp formatter n =
  (match n with
  | Point -> "."
  | Pixel -> ","
  | Circle -> "o"
  | TriangleDown -> "v"
  | TriangleUp -> "^"
  | TriangleLeft -> ">"
  | TriangleRight -> "<"
  | Custom s -> s)
  |> Format.fprintf formatter "%s"