diff --git a/src/construct.jl b/src/construct.jl index b57dd0b83f17a632288060772c64438b53bd709f..b5e41f33d423e78625c6d3190fc2ead2ef2779e1 100644 --- a/src/construct.jl +++ b/src/construct.jl @@ -1,6 +1,5 @@ export @construct - function make_widget(binding) if binding.head != :(=) error("@construct syntax error.") @@ -17,7 +16,7 @@ end function map_block(block, symbols) lambda = Expr(:(->), Expr(:tuple, symbols...), block) - :(map($lambda, $(map(s->:(observe($s)), symbols)...))) + :(map($lambda, $(map(s->:(InteractNext.observe($s)), symbols)...))) end function symbols(bindings) diff --git a/src/svg_helper.jl b/src/svg_helper.jl index 53b3001328b830dcaf0b194c6ce1eccd193dbd85..32bf02f4b489c8df3dbcdf7b26db07cf196068c9 100644 --- a/src/svg_helper.jl +++ b/src/svg_helper.jl @@ -1,7 +1,7 @@ #Provides some routines for easier svg construction, along with some #(hopefully!) sane defaults -export svg_rect, svg_circle, svg_line, svg_polyline, svg_polygon, svg_text, default_height, default_width, default_posy, default_posx, s_black, s_red, s_green, s_blue, stdstyle, stdattr, svgsvg_symb +export svg_rect, svg_circle, svg_line, svg_polyline, svg_polygon, svg_text, default_height, default_width, default_posy, default_posx, s_black, s_red, s_green, s_blue, stdstyle, stdattr, svgsvg_symb, s_color global const default_height = 900 global const default_width = 600 global const default_posy = 0 @@ -21,6 +21,8 @@ global const stdstyle = Dict(:fill => "rgb$s_black") global const svgsvg_symb = instanceof(dom"svg:svg"()) +s_color(color) = Dict(:fill => "rgb$(Int.(floor.(color)))") + #################### function svg_rect(width, height, x=0, y=0, style = stdstyle)