Browse files

[all] update to recent js_of_ocaml

The CSS module in js_of_ocaml has been updated in non backward compatible ways.
This patch updates the d3 bindings to js_of_ocaml 1.1.1 version interface.
  • Loading branch information...
1 parent f403e23 commit d9f672b02fd8bf6917bd1e80d4687eea0833f120 @raphael-proust committed Jun 25, 2012
Showing with 22 additions and 22 deletions.
  1. +6 −6 src/bindings/d3.ml
  2. +6 −6 src/bindings/d3.mli
  3. +8 −8 src/lib/d3m.ml
  4. +1 −1 src/lib/d3m.mli
  5. +1 −1 tests/interpolation.ml
View
12 src/bindings/d3.ml
@@ -389,13 +389,13 @@ object
-> (float -> int) Js.meth
method interpolateRgb :
- CSS.js_color
- -> CSS.js_color
- -> (float -> CSS.js_color) Js.meth
+ CSS.Color.js_t
+ -> CSS.Color.js_t
+ -> (float -> CSS.Color.js_t) Js.meth
method interpolateHsl :
- CSS.js_color
- -> CSS.js_color
- -> (float -> CSS.js_color) Js.meth
+ CSS.Color.js_t
+ -> CSS.Color.js_t
+ -> (float -> CSS.Color.js_t) Js.meth
method interpolateString :
Js.js_string Js.t
View
12 src/bindings/d3.mli
@@ -389,13 +389,13 @@ object
-> (float -> int) Js.meth
method interpolateRgb :
- CSS.js_color
- -> CSS.js_color
- -> (float -> CSS.js_color) Js.meth
+ CSS.Color.js_t
+ -> CSS.Color.js_t
+ -> (float -> CSS.Color.js_t) Js.meth
method interpolateHsl :
- CSS.js_color
- -> CSS.js_color
- -> (float -> CSS.js_color) Js.meth
+ CSS.Color.js_t
+ -> CSS.Color.js_t
+ -> (float -> CSS.Color.js_t) Js.meth
method interpolateString :
Js.js_string Js.t
View
16 src/lib/d3m.ml
@@ -166,15 +166,15 @@ struct
let float x y = d3##interpolateNumber_float(x, y)
let color x y =
- let open CSS in
+ let open CSS.Color in
match (x, y) with
(*HSL*)
| (HSL _, HSL _) ->
- (d3##interpolateHsl(color x, color y) :> float -> Js.js_string Js.t)
+ (d3##interpolateHsl(js x, js y) :> float -> Js.js_string Js.t)
| (HSLA _, HSLA _) ->
- let x = (color x :> Js.js_string Js.t)
- and y = (color y :> Js.js_string Js.t)
+ let x = (js x :> Js.js_string Js.t)
+ and y = (js y :> Js.js_string Js.t)
in
d3##interpolateString(x, y)
@@ -184,10 +184,10 @@ struct
(*RGB*)
| (RGB _, RGB _) ->
- (d3##interpolateRgb(color x, color y) :> float -> Js.js_string Js.t)
+ (d3##interpolateRgb(js x, js y) :> float -> Js.js_string Js.t)
| (RGBA _, RGBA _) ->
- let x = (color x :> Js.js_string Js.t)
- and y = (color y :> Js.js_string Js.t)
+ let x = (js x :> Js.js_string Js.t)
+ and y = (js y :> Js.js_string Js.t)
in
d3##interpolateString(x, y)
@@ -197,7 +197,7 @@ struct
(*All that is left is RGB and named colors (that can be mixed).*)
| _ ->
- (d3##interpolateRgb(color x, color y) :> float -> Js.js_string Js.t)
+ (d3##interpolateRgb(js x, js y) :> float -> Js.js_string Js.t)
end
View
2 src/lib/d3m.mli
@@ -122,7 +122,7 @@ sig
value.. It does not work either when one of the two colors has an alpha
channel. *)
(*TODO: make return type CSS.js_color*)
- val color : CSS.color -> CSS.color -> Js.js_string Js.t t
+ val color : CSS.Color.t -> CSS.Color.t -> Js.js_string Js.t t
end
View
2 tests/interpolation.ml
@@ -4,7 +4,7 @@
open D3m
let rainbow =
- Interval.color (CSS.HSL (0, 80, 50)) (CSS.HSL (359, 80, 50))
+ Interval.color (CSS.Color.HSL (0, 80, 50)) (CSS.Color.HSL (359, 80, 50))
let widths = Interval.string "50px" "120px"

0 comments on commit d9f672b

Please sign in to comment.