From b8c7d965c4c73d9bb65d5743de48fa19b697fdee Mon Sep 17 00:00:00 2001 From: jwikmark <jacob@wikmark.se> Date: Wed, 14 Mar 2018 16:35:56 +0100 Subject: [PATCH] some fixes for easier use --- src/construct.jl | 3 +-- src/svg_helper.jl | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/construct.jl b/src/construct.jl index b57dd0b..b5e41f3 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 53b3001..32bf02f 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) -- GitLab