33import xml .etree .ElementTree as et
44
55HEADERS = b"""<?xml version=\" 1.0\" standalone=\" no\" ?>
6+ <?xml-stylesheet href="wheel.css" type="text/css"?>
67<!DOCTYPE svg PUBLIC \" -//W3C//DTD SVG 1.1//EN\"
78\" http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\" >
89"""
910
10- STYLES = """
11- .success { stroke: #4CAE4C; stroke-width: 1; fill: #5CB85C; }
12- .default { stroke: #cccccc; stroke-width: 1; fill: #ffffff; }
13- """
14-
1511PATH_TEMPLATE = """
1612M {start_outer_x},{start_outer_y}
1713A{outer_radius},{outer_radius} 0 0 1 {end_outer_x},{end_outer_y}
@@ -78,11 +74,11 @@ def angles(index, total):
7874
7975def add_fraction (wheel , packages , total ):
8076 text_attributes = {
77+ "class" : "wheel-text" ,
8178 "text-anchor" : "middle" ,
8279 "dominant-baseline" : "central" ,
8380 "font-size" : str (2 * OFFSET ),
8481 "font-family" : '"Helvetica Neue",Helvetica,Arial,sans-serif' ,
85- "fill" : "#333333" ,
8682 }
8783
8884 # Packages with some sort of wheel
@@ -109,7 +105,7 @@ def add_fraction(wheel, packages, total):
109105 y1 = str (CENTER ),
110106 x2 = str (CENTER + FRACTION_LINE // 2 ),
111107 y2 = str (CENTER ),
112- attrib = {"stroke " : "#333333 " , "stroke-width" : "2" },
108+ attrib = {"class " : "wheel-line " , "stroke-width" : "2" },
113109 )
114110
115111 # Total packages
@@ -133,9 +129,6 @@ def generate_svg_wheel(packages, total):
133129 version = "1.1" ,
134130 xmlns = "http://www.w3.org/2000/svg" ,
135131 )
136- style = et .SubElement (wheel , "style" , attrib = {"type" : "text/css" })
137- style .text = STYLES
138-
139132 add_annular_sectors (wheel , packages , total )
140133
141134 add_fraction (wheel , packages , total )
0 commit comments