Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/plotly.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,16 @@ module Layout = struct
let axis_tickformat s = ("tickformat", Base.Value.Value (Base.Value.string s))
end

module Font = struct
let font_family s = ("family", Base.Value.Value (Base.Value.string s))
let font_size sz = ("size", Base.Value.Value (Base.Value.float sz))
let font_color c = ("color", Base.Value.Value (Base.Value.string c))
end

let xaxis ax = [("xaxis", Base.Value.Object ax)]
let yaxis ay = [("yaxis", Base.Value.Object ay)]
let zaxis az = [("zaxis", Base.Value.Object az)]
let font f = [("font", Base.Value.Object f)]

let layout ats = ats

Expand Down
14 changes: 14 additions & 0 deletions src/plotly.mli
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ module Layout : sig
val axis_tickformat : string -> string * Base.Value.value
end

module Font : sig
(** HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available. *)
val font_family : string -> string * Base.Value.value

val font_size : float -> string * Base.Value.value

val font_color : string -> string * Base.Value.value
end

(** Set the x-axis properties *)
val xaxis : (string * Base.Value.value) list -> t

Expand All @@ -139,6 +148,11 @@ module Layout : sig
(** Set the z-axis properties *)
val zaxis : (string * Base.Value.value) list -> t

(** Set the global font properties for the graph.

Note that fonts used in traces and other layout components inherit from the global font. *)
val font : (string * Base.Value.value) list -> t

val layout : Attribute.t list -> t

val to_json : t -> Ezjsonm.value
Expand Down