Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
monstasat committed Aug 16, 2019
1 parent e902990 commit fce6ddc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 20 deletions.
29 changes: 19 additions & 10 deletions lib/chartjs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -770,9 +770,14 @@ class type ['a] cartesianAxis = object

method scaleLabel : scaleLabel Js.t Js.prop

method ticks : (#cartesianTicks as 'a) Js.t Js.prop
method ticks : 'a. (#cartesianTicks as 'a) Js.t Js.prop
end

class type basicCartesianAxis = [cartesianTicks] cartesianAxis

let coerce_cartesian_axis (axis : 'a #cartesianAxis Js.t) =
(axis :> basicCartesianAxis Js.t)

let create_cartesian_axis () = Js.Unsafe.obj [||]

(** {3 Category axis} *)
Expand All @@ -782,9 +787,9 @@ class type categoryCartesianTicks = object

method labels : Js.js_string Js.t Js.optdef_prop

method min : Js.js_string Js.t Js.optdef_prop
method min : Js.js_string Js.t Js.optdef Js.prop

method max : Js.js_string Js.t Js.optdef_prop
method max : Js.js_string Js.t Js.optdef Js.prop
end

class type categoryCartesianAxis = [categoryCartesianTicks] cartesianAxis
Expand All @@ -801,19 +806,19 @@ class type linearCartesianTicks = object

method beginAtZero : bool Js.t Js.optdef_prop

method min : float Js.optdef_prop
method min : float Js.optdef Js.prop

method max : float Js.optdef_prop
method max : float Js.optdef Js.prop

method maxTicksLimit : int Js.prop

method precision : int Js.optdef_prop

method stepSize : int Js.optdef_prop

method suggestedMax : float Js.optdef_prop
method suggestedMax : float Js.optdef Js.prop

method suggestedMin : float Js.optdef_prop
method suggestedMin : float Js.optdef Js.prop
end

class type linearCartesianAxis = [linearCartesianTicks] cartesianAxis
Expand All @@ -828,9 +833,9 @@ let create_linear_cartesian_axis () =
class type logarithmicCartesianTicks = object
inherit cartesianTicks

method min : float Js.optdef_prop
method min : float Js.optdef Js.prop

method max : float Js.optdef_prop
method max : float Js.optdef Js.prop
end

class type logarithmicCartesianAxis = [logarithmicCartesianTicks] cartesianAxis
Expand Down Expand Up @@ -914,7 +919,7 @@ let create_time_cartesian_axis () =
class type dataset = object
method _type : Js.js_string Js.t Js.optdef_prop

method label : Js.js_string Js.t Js.optdef_prop
method label : Js.js_string Js.t Js.prop
end

let coerce_dataset x = (x :> dataset Js.t)
Expand Down Expand Up @@ -1338,6 +1343,10 @@ and ['chart] tooltip = object('self)
method borderWidth : int Js.prop
end

let create_tooltip_model () = Js.Unsafe.obj [||]

let create_tooltip_callbacks () = Js.Unsafe.obj [||]

let create_tooltip () = Js.Unsafe.obj [||]

class type hover = object
Expand Down
28 changes: 18 additions & 10 deletions lib/chartjs.mli
Original file line number Diff line number Diff line change
Expand Up @@ -842,10 +842,14 @@ class type ['a] cartesianAxis = object
method scaleLabel : scaleLabel Js.t Js.prop
(** Scale title configuration. *)

method ticks : (#cartesianTicks as 'a) Js.t Js.prop
method ticks : 'a. (#cartesianTicks as 'a) Js.t Js.prop
(** Tick configuration. *)
end

class type basicCartesianAxis = [cartesianTicks] cartesianAxis

val coerce_cartesian_axis : 'a #cartesianAxis Js.t -> basicCartesianAxis Js.t

val create_cartesian_axis : unit -> 'a cartesianAxis Js.t

(** {3 Category axis} *)
Expand All @@ -856,10 +860,10 @@ class type categoryCartesianTicks = object
method labels : Js.js_string Js.t Js.optdef_prop
(** An array of labels to display. *)

method min : Js.js_string Js.t Js.optdef_prop
method min : Js.js_string Js.t Js.optdef Js.prop
(** The minimum item to display. *)

method max : Js.js_string Js.t Js.optdef_prop
method max : Js.js_string Js.t Js.optdef Js.prop
(** The maximum item to display. *)
end

Expand All @@ -877,11 +881,11 @@ class type linearCartesianTicks = object
method beginAtZero : bool Js.t Js.optdef_prop
(** If [true], scale will include 0 if it is not already included. *)

method min : float Js.optdef_prop
method min : float Js.optdef Js.prop
(** User defined minimum number for the scale,
overrides minimum value from data. *)

method max : float Js.optdef_prop
method max : float Js.optdef Js.prop
(** User defined maximum number for the scale,
overrides maximum value from data. *)

Expand All @@ -895,10 +899,10 @@ class type linearCartesianTicks = object
method stepSize : int Js.optdef_prop
(** User defined fixed step size for the scale. *)

method suggestedMax : float Js.optdef_prop
method suggestedMax : float Js.optdef Js.prop
(** Adjustment used when calculating the maximum data value. *)

method suggestedMin : float Js.optdef_prop
method suggestedMin : float Js.optdef Js.prop
(** Adjustment used when calculating the minimum data value. *)
end

Expand All @@ -913,11 +917,11 @@ val create_linear_cartesian_axis : unit -> linearCartesianAxis Js.t
class type logarithmicCartesianTicks = object
inherit cartesianTicks

method min : float Js.optdef_prop
method min : float Js.optdef Js.prop
(** User defined minimum number for the scale,
overrides minimum value from data. *)

method max : float Js.optdef_prop
method max : float Js.optdef Js.prop
(** User defined maximum number for the scale,
overrides maximum value from data. *)
end
Expand Down Expand Up @@ -1024,7 +1028,7 @@ val create_time_cartesian_axis : unit -> timeCartesianAxis Js.t
class type dataset = object
method _type : Js.js_string Js.t Js.optdef_prop

method label : Js.js_string Js.t Js.optdef_prop
method label : Js.js_string Js.t Js.prop
end

val coerce_dataset : #dataset Js.t -> dataset Js.t
Expand Down Expand Up @@ -1563,6 +1567,10 @@ and ['chart] tooltip = object('self)
(** Size of the border. *)
end

val create_tooltip_model : unit -> tooltipModel Js.t

val create_tooltip_callbacks : unit -> 'a tooltipCallbacks Js.t

val create_tooltip : unit -> 'a tooltip Js.t

(** {2 Interactions} *)
Expand Down

0 comments on commit fce6ddc

Please sign in to comment.