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

formatting etc

parent 7a8b582a
No related branches found
No related tags found
No related merge requests found
#Provides some routines for easier svg construction, along with some
#(hopefully!) sane defaults
export svg_rect, svg_circle, svg_line, svg_polyline, svg_polygon, 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
global const default_height = 900
global const default_width = 600
global const default_posy = 0
......@@ -64,3 +64,9 @@ function svg_polygon(ptsvector, color)
style = Dict( :fill => "rgb$color")
svg_poly(ptsvector, style)
end
function svg_text(x, y, text, style=stdstyle)
attr = Dict("y" => "$y",
"x" => "$x")
Node(instanceof(dom"svg:text"(text)), style = style, attributes = attr)
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment