Skip to content
Snippets Groups Projects
Commit b8c7d965 authored by Jacob Wikmark's avatar Jacob Wikmark
Browse files

some fixes for easier use

parent 1b69871e
Branches
No related tags found
No related merge requests found
export @construct export @construct
function make_widget(binding) function make_widget(binding)
if binding.head != :(=) if binding.head != :(=)
error("@construct syntax error.") error("@construct syntax error.")
...@@ -17,7 +16,7 @@ end ...@@ -17,7 +16,7 @@ end
function map_block(block, symbols) function map_block(block, symbols)
lambda = Expr(:(->), Expr(:tuple, symbols...), lambda = Expr(:(->), Expr(:tuple, symbols...),
block) block)
:(map($lambda, $(map(s->:(observe($s)), symbols)...))) :(map($lambda, $(map(s->:(InteractNext.observe($s)), symbols)...)))
end end
function symbols(bindings) function symbols(bindings)
......
#Provides some routines for easier svg construction, along with some #Provides some routines for easier svg construction, along with some
#(hopefully!) sane defaults #(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_height = 900
global const default_width = 600 global const default_width = 600
global const default_posy = 0 global const default_posy = 0
...@@ -21,6 +21,8 @@ global const stdstyle = Dict(:fill => "rgb$s_black") ...@@ -21,6 +21,8 @@ global const stdstyle = Dict(:fill => "rgb$s_black")
global const svgsvg_symb = instanceof(dom"svg:svg"()) 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) function svg_rect(width, height, x=0, y=0, style = stdstyle)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment