def __init__(self, width=400, height=200, *args, **kw): Drawing.__init__(self, width, height, *args, **kw) self.transform = (1, 0, 0, 1, 0, 0) self.add( Wedge(200, 100, 75, -176.4, 90, yradius=75, annular=False, fillColor=Color(.27451, .509804, .705882, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 75, -180, -176.4, yradius=75, annular=False, fillColor=Color(.847059, .74902, .847059, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 75, -270, -180, yradius=75, annular=False, fillColor=Color(.392157, .584314, .929412, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None))
def _draw_segment(self, cur_drawing): """Draw a half circle representing the end of a linear chromosome.""" # set the coordinates of the segment -- it'll take up the MIDDLE part # of the space we have. width = (self.end_x_position - self.start_x_position) \ * self.chr_percent height = self.start_y_position - self.end_y_position center_x = 0.5 * (self.end_x_position + self.start_x_position) start_x = center_x - 0.5 * width if self._inverted: center_y = self.start_y_position start_angle = 180 end_angle = 360 else: center_y = self.end_y_position start_angle = 0 end_angle = 180 cap_wedge = Wedge(center_x, center_y, width / 2, start_angle, end_angle, height) cap_wedge.strokeColor = None cap_wedge.fillColor = self.fill_color cur_drawing.add(cap_wedge) # Now draw an arc for the curved edge of the wedge, # omitting the flat end. cap_arc = ArcPath() cap_arc.addArc(center_x, center_y, width / 2, start_angle, end_angle, height) cur_drawing.add(cap_arc)
def solid_shapes(): drawing = Drawing(width=400, height=200) rectangle = Rect(10, 10, 100, 100) rectangle.fillColor = colors.blue drawing.add(rectangle) ellipse = Ellipse(100, 50, 50, 25) ellipse.fillColor = colors.red drawing.add(ellipse) circle = Circle(50, 170, 25) circle.fillColor = colors.green drawing.add(circle) wedge = Wedge(150, 150, 65, startangledegrees=0, endangledegrees=45) wedge.fillColor = colors.yellow drawing.add(wedge) poly = Polygon(points=[250, 150, 280, 150, 280, 100, 250, 100 ]) poly.fillColor = colors.purple drawing.add(poly) drawing.save(formats=['pdf'], outDir='.', fnRoot='solid_shapes')
def sample1(): "Make up something from the individual Sectors" d = Drawing(400, 400) g = Group() s1 = Wedge(centerx=200, centery=200, radius=150, startangledegrees=0, endangledegrees=120, radius1=100) s1.fillColor = colors.red s1.strokeColor = None d.add(s1) s2 = Wedge(centerx=200, centery=200, radius=150, startangledegrees=120, endangledegrees=240, radius1=100) s2.fillColor = colors.green s2.strokeColor = None d.add(s2) s3 = Wedge(centerx=200, centery=200, radius=150, startangledegrees=240, endangledegrees=260, radius1=100) s3.fillColor = colors.blue s3.strokeColor = None d.add(s3) s4 = Wedge(centerx=200, centery=200, radius=150, startangledegrees=260, endangledegrees=360, radius1=100) s4.fillColor = colors.gray s4.strokeColor = None d.add(s4) return d
def _draw_segment(self, cur_drawing): """Draw a half circle representing the end of a linear chromosome. """ # set the coordinates of the segment -- it'll take up the left part # of the space we have. width = (self.end_x_position - self.start_x_position) \ * self.chr_percent height = self.start_y_position - self.end_y_position center_x = self.start_x_position + width / 2 if self._inverted: center_y = self.start_y_position start_angle = 180 end_angle = 360 else: center_y = self.end_y_position start_angle = 0 end_angle = 180 cap_wedge = Wedge(center_x, center_y, width / 2, start_angle, end_angle, height / 2) cap_wedge.fillColor = self.fill_color cur_drawing.add(cap_wedge) # draw a line to cover up the the bottom part of the wedge if self._inverted: cover_line = Line(self.start_x_position, self.start_y_position, self.start_x_position + width, self.start_y_position) else: cover_line = Line(self.start_x_position, self.end_y_position, self.start_x_position + width, self.end_y_position) if self.fill_color is not None: cover_color = self.fill_color else: cover_color = colors.white cover_line.strokeColor = cover_color cur_drawing.add(cover_line)
def __init__(self, width=400, height=400, *args, **kw): Drawing.__init__(self, width, height, *args, **kw) self.transform = (1, 0, 0, 1, 0, 0) self.add( Wedge(200, 200, 150, 0, 120, yradius=None, annular=False, fillColor=Color(1, 0, 0, 1), fillOpacity=None, strokeColor=None, strokeWidth=1, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=100)) self.add( Wedge(200, 200, 150, 120, 240, yradius=None, annular=False, fillColor=Color(0, .501961, 0, 1), fillOpacity=None, strokeColor=None, strokeWidth=1, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=100)) self.add( Wedge(200, 200, 150, 240, 260, yradius=None, annular=False, fillColor=Color(0, 0, 1, 1), fillOpacity=None, strokeColor=None, strokeWidth=1, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=100)) self.add( Wedge(200, 200, 150, 260, 360, yradius=None, annular=False, fillColor=Color(.501961, .501961, .501961, 1), fillOpacity=None, strokeColor=None, strokeWidth=1, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=100))
def makeSectors(self): # normalize slice data if type(self.data) in (ListType, TupleType) and type( self.data[0]) in (ListType, TupleType): #it's a nested list, more than one sequence normData = [] n = [] for l in self.data: t = self.normalizeData(l) normData.append(t) n.append(len(t)) self._seriesCount = max(n) else: normData = self.normalizeData(self.data) n = len(normData) self._seriesCount = n #labels checkLabelOverlap = self.checkLabelOverlap L = [] L_add = L.append if self.labels is None: labels = [] if type(n) not in (ListType, TupleType): labels = [''] * n else: for m in n: labels = list(labels) + [''] * m else: labels = self.labels #there's no point in raising errors for less than enough labels if #we silently create all for the extreme case of no labels. if type(n) not in (ListType, TupleType): i = n - len(labels) if i > 0: labels = list(labels) + [''] * i else: tlab = 0 for m in n: tlab += m i = tlab - len(labels) if i > 0: labels = list(labels) + [''] * i xradius = self.width / 2.0 yradius = self.height / 2.0 centerx = self.x + xradius centery = self.y + yradius if self.direction == "anticlockwise": whichWay = 1 else: whichWay = -1 g = Group() startAngle = self.startAngle #% 360 styleCount = len(self.slices) if type(self.data[0]) in (ListType, TupleType): #multi-series doughnut iradius = (self.height / 5.0) / len(self.data) for sn, series in enumerate(normData): for i, angle in enumerate(series): endAngle = (startAngle + (angle * whichWay)) #% 360 if abs(startAngle - endAngle) < 1e-5: startAngle = endAngle continue if startAngle < endAngle: a1 = startAngle a2 = endAngle else: a1 = endAngle a2 = startAngle startAngle = endAngle #if we didn't use %stylecount here we'd end up with the later sectors #all having the default style sectorStyle = self.slices[i % styleCount] # is it a popout? cx, cy = centerx, centery if sectorStyle.popout != 0: # pop out the sector averageAngle = (a1 + a2) / 2.0 aveAngleRadians = averageAngle * pi / 180.0 popdistance = sectorStyle.popout cx = centerx + popdistance * cos(aveAngleRadians) cy = centery + popdistance * sin(aveAngleRadians) if type(n) in (ListType, TupleType): theSector = Wedge( cx, cy, xradius + (sn * iradius) - iradius, a1, a2, yradius=yradius + (sn * iradius) - iradius, radius1=yradius + (sn * iradius) - (2 * iradius)) else: theSector = Wedge(cx, cy, xradius, a1, a2, yradius=yradius, radius1=iradius) theSector.fillColor = sectorStyle.fillColor theSector.strokeColor = sectorStyle.strokeColor theSector.strokeWidth = sectorStyle.strokeWidth theSector.strokeDashArray = sectorStyle.strokeDashArray g.add(theSector) if sn == 0: text = self.getSeriesName(i, '') if text: averageAngle = (a1 + a2) / 2.0 aveAngleRadians = averageAngle * pi / 180.0 labelRadius = sectorStyle.labelRadius rx = xradius * labelRadius ry = yradius * labelRadius labelX = centerx + (0.5 * self.width * cos(aveAngleRadians) * labelRadius) labelY = centery + (0.5 * self.height * sin(aveAngleRadians) * labelRadius) l = _addWedgeLabel(self, text, averageAngle, labelX, labelY, sectorStyle) if checkLabelOverlap: l._origdata = { 'x': labelX, 'y': labelY, 'angle': averageAngle, 'rx': rx, 'ry': ry, 'cx': cx, 'cy': cy, 'bounds': l.getBounds(), } L_add(l) else: #single series doughnut iradius = self.height / 5.0 for i, angle in enumerate(normData): endAngle = (startAngle + (angle * whichWay)) #% 360 if abs(startAngle - endAngle) < 1e-5: startAngle = endAngle continue if startAngle < endAngle: a1 = startAngle a2 = endAngle else: a1 = endAngle a2 = startAngle startAngle = endAngle #if we didn't use %stylecount here we'd end up with the later sectors #all having the default style sectorStyle = self.slices[i % styleCount] # is it a popout? cx, cy = centerx, centery if sectorStyle.popout != 0: # pop out the sector averageAngle = (a1 + a2) / 2.0 aveAngleRadians = averageAngle * pi / 180.0 popdistance = sectorStyle.popout cx = centerx + popdistance * cos(aveAngleRadians) cy = centery + popdistance * sin(aveAngleRadians) if n > 1: theSector = Wedge(cx, cy, xradius, a1, a2, yradius=yradius, radius1=iradius) elif n == 1: theSector = Wedge(cx, cy, xradius, a1, a2, yradius=yradius, iradius=iradius) theSector.fillColor = sectorStyle.fillColor theSector.strokeColor = sectorStyle.strokeColor theSector.strokeWidth = sectorStyle.strokeWidth theSector.strokeDashArray = sectorStyle.strokeDashArray g.add(theSector) # now draw a label if labels[i] != "": averageAngle = (a1 + a2) / 2.0 aveAngleRadians = averageAngle * pi / 180.0 labelRadius = sectorStyle.labelRadius labelX = centerx + (0.5 * self.width * cos(aveAngleRadians) * labelRadius) labelY = centery + (0.5 * self.height * sin(aveAngleRadians) * labelRadius) rx = xradius * labelRadius ry = yradius * labelRadius l = _addWedgeLabel(self, labels[i], averageAngle, labelX, labelY, sectorStyle) if checkLabelOverlap: l._origdata = { 'x': labelX, 'y': labelY, 'angle': averageAngle, 'rx': rx, 'ry': ry, 'cx': cx, 'cy': cy, 'bounds': l.getBounds(), } L_add(l) if checkLabelOverlap and L: fixLabelOverlaps(L) for l in L: g.add(l) return g
def __init__(self, width=400, height=200, *args, **kw): Drawing.__init__(self, width, height, *args, **kw) self.transform = (1, 0, 0, 1, 0, 0) self.add( Wedge(200, 100, 75, -278.8462, -85, yradius=75, annular=False, fillColor=Color(.27451, .509804, .705882, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 75, -306.5385, -278.8462, yradius=75, annular=False, fillColor=Color(.847059, .74902, .847059, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 75, -334.2308, -306.5385, yradius=75, annular=False, fillColor=Color(.392157, .584314, .929412, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 75, -361.9231, -334.2308, yradius=75, annular=False, fillColor=Color(.690196, .768627, .870588, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 75, -389.6154, -361.9231, yradius=75, annular=False, fillColor=Color(.498039, 1, .831373, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 75, -445, -389.6154, yradius=75, annular=False, fillColor=Color(.372549, .619608, .627451, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( String(110, 103.0202, 'example1', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(290, 183.0331, 'example2', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(290, 157.3868, 'example3', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(290, 118.5938, 'example4', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(290, 75.54129, 'example5', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(290, 24.2575, 'example6', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( Line(125.0422, 102.5168, 117.5211, 106.0202, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(117.5211, 106.0202, 110, 106.0202, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(228.9337, 169.1942, 259.4668, 186.0331, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(259.4668, 186.0331, 290, 186.0331, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(257.7757, 147.8223, 273.8878, 160.3868, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(273.8878, 160.3868, 290, 160.3868, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(273.3819, 115.4949, 281.691, 121.5938, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(281.691, 121.5938, 290, 121.5938, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(272.1773, 79.61774, 281.0887, 78.54129, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(281.0887, 78.54129, 290, 78.54129, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(240.5096, 36.88125, 265.2548, 27.2575, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(265.2548, 27.2575, 290, 27.2575, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None))
def makeSectors(self): # normalize slice data data = self.data multi = isListOfListOfNoneOrNumber(data) if multi: #it's a nested list, more than one sequence normData = [] n = [] for l in data: t = self.normalizeData(l) normData.append(t) n.append(len(t)) self._seriesCount = max(n) else: normData = self.normalizeData(data) n = len(normData) self._seriesCount = n #labels checkLabelOverlap = self.checkLabelOverlap L = [] L_add = L.append labels = self.labels if labels is None: labels = [] if not multi: labels = [''] * n else: for m in n: labels = list(labels) + [''] * m else: #there's no point in raising errors for less than enough labels if #we silently create all for the extreme case of no labels. if not multi: i = n - len(labels) if i > 0: labels = list(labels) + [''] * i else: tlab = 0 for m in n: tlab += m i = tlab - len(labels) if i > 0: labels = list(labels) + [''] * i self.labels = labels xradius = self.width / 2.0 yradius = self.height / 2.0 centerx = self.x + xradius centery = self.y + yradius if self.direction == "anticlockwise": whichWay = 1 else: whichWay = -1 g = Group() startAngle = self.startAngle #% 360 styleCount = len(self.slices) irf = self.innerRadiusFraction if multi: #multi-series doughnut ndata = len(data) if irf is None: yir = (yradius / 2.5) / ndata xir = (xradius / 2.5) / ndata else: yir = yradius * irf xir = xradius * irf ydr = (yradius - yir) / ndata xdr = (xradius - xir) / ndata for sn, series in enumerate(normData): for i, angle in enumerate(series): endAngle = (startAngle + (angle * whichWay)) #% 360 aa = abs(startAngle - endAngle) if aa < 1e-5: startAngle = endAngle continue if startAngle < endAngle: a1 = startAngle a2 = endAngle else: a1 = endAngle a2 = startAngle startAngle = endAngle #if we didn't use %stylecount here we'd end up with the later sectors #all having the default style sectorStyle = self.slices[sn, i % styleCount] # is it a popout? cx, cy = centerx, centery if sectorStyle.popout != 0: # pop out the sector averageAngle = (a1 + a2) / 2.0 aveAngleRadians = averageAngle * pi / 180.0 popdistance = sectorStyle.popout cx = centerx + popdistance * cos(aveAngleRadians) cy = centery + popdistance * sin(aveAngleRadians) yr1 = yir + sn * ydr yr = yr1 + ydr xr1 = xir + sn * xdr xr = xr1 + xdr if len(series) > 1: theSector = Wedge(cx, cy, xr, a1, a2, yradius=yr, radius1=xr1, yradius1=yr1) else: theSector = Wedge(cx, cy, xr, a1, a2, yradius=yr, radius1=xr1, yradius1=yr1, annular=True) theSector.fillColor = sectorStyle.fillColor theSector.strokeColor = sectorStyle.strokeColor theSector.strokeWidth = sectorStyle.strokeWidth theSector.strokeDashArray = sectorStyle.strokeDashArray shader = sectorStyle.shadingKind if shader: nshades = aa / float(sectorStyle.shadingAngle) if nshades > 1: shader = colors.Whiter if shader == 'lighten' else colors.Blacker nshades = 1 + int(nshades) shadingAmount = 1 - sectorStyle.shadingAmount if sectorStyle.shadingDirection == 'normal': dsh = (1 - shadingAmount) / float(nshades - 1) shf1 = shadingAmount else: dsh = (shadingAmount - 1) / float(nshades - 1) shf1 = 1 shda = (a2 - a1) / float(nshades) shsc = sectorStyle.fillColor theSector.fillColor = None for ish in range(nshades): sha1 = a1 + ish * shda sha2 = a1 + (ish + 1) * shda shc = shader(shsc, shf1 + dsh * ish) if len(series) > 1: shSector = Wedge(cx, cy, xr, sha1, sha2, yradius=yr, radius1=xr1, yradius1=yr1) else: shSector = Wedge(cx, cy, xr, sha1, sha2, yradius=yr, radius1=xr1, yradius1=yr1, annular=True) shSector.fillColor = shc shSector.strokeColor = None shSector.strokeWidth = 0 g.add(shSector) g.add(theSector) if sn == 0 and sectorStyle.visible and sectorStyle.label_visible: text = self.getSeriesName(i, '') if text: averageAngle = (a1 + a2) / 2.0 aveAngleRadians = averageAngle * pi / 180.0 labelRadius = sectorStyle.labelRadius rx = xradius * labelRadius ry = yradius * labelRadius labelX = centerx + (0.5 * self.width * cos(aveAngleRadians) * labelRadius) labelY = centery + (0.5 * self.height * sin(aveAngleRadians) * labelRadius) l = _addWedgeLabel(self, text, averageAngle, labelX, labelY, sectorStyle) if checkLabelOverlap: l._origdata = { 'x': labelX, 'y': labelY, 'angle': averageAngle, 'rx': rx, 'ry': ry, 'cx': cx, 'cy': cy, 'bounds': l.getBounds(), } L_add(l) else: #single series doughnut if irf is None: yir = yradius / 2.5 xir = xradius / 2.5 else: yir = yradius * irf xir = xradius * irf for i, angle in enumerate(normData): endAngle = (startAngle + (angle * whichWay)) #% 360 aa = abs(startAngle - endAngle) if aa < 1e-5: startAngle = endAngle continue if startAngle < endAngle: a1 = startAngle a2 = endAngle else: a1 = endAngle a2 = startAngle startAngle = endAngle #if we didn't use %stylecount here we'd end up with the later sectors #all having the default style sectorStyle = self.slices[i % styleCount] # is it a popout? cx, cy = centerx, centery if sectorStyle.popout != 0: # pop out the sector averageAngle = (a1 + a2) / 2.0 aveAngleRadians = averageAngle * pi / 180.0 popdistance = sectorStyle.popout cx = centerx + popdistance * cos(aveAngleRadians) cy = centery + popdistance * sin(aveAngleRadians) if n > 1: theSector = Wedge(cx, cy, xradius, a1, a2, yradius=yradius, radius1=xir, yradius1=yir) elif n == 1: theSector = Wedge(cx, cy, xradius, a1, a2, yradius=yradius, radius1=xir, yradius1=yir, annular=True) theSector.fillColor = sectorStyle.fillColor theSector.strokeColor = sectorStyle.strokeColor theSector.strokeWidth = sectorStyle.strokeWidth theSector.strokeDashArray = sectorStyle.strokeDashArray shader = sectorStyle.shadingKind if shader: nshades = aa / float(sectorStyle.shadingAngle) if nshades > 1: shader = colors.Whiter if shader == 'lighten' else colors.Blacker nshades = 1 + int(nshades) shadingAmount = 1 - sectorStyle.shadingAmount if sectorStyle.shadingDirection == 'normal': dsh = (1 - shadingAmount) / float(nshades - 1) shf1 = shadingAmount else: dsh = (shadingAmount - 1) / float(nshades - 1) shf1 = 1 shda = (a2 - a1) / float(nshades) shsc = sectorStyle.fillColor theSector.fillColor = None for ish in range(nshades): sha1 = a1 + ish * shda sha2 = a1 + (ish + 1) * shda shc = shader(shsc, shf1 + dsh * ish) if n > 1: shSector = Wedge(cx, cy, xradius, sha1, sha2, yradius=yradius, radius1=xir, yradius1=yir) elif n == 1: shSector = Wedge(cx, cy, xradius, sha1, sha2, yradius=yradius, radius1=xir, yradius1=yir, annular=True) shSector.fillColor = shc shSector.strokeColor = None shSector.strokeWidth = 0 g.add(shSector) g.add(theSector) # now draw a label if labels[ i] and sectorStyle.visible and sectorStyle.label_visible: averageAngle = (a1 + a2) / 2.0 aveAngleRadians = averageAngle * pi / 180.0 labelRadius = sectorStyle.labelRadius labelX = centerx + (0.5 * self.width * cos(aveAngleRadians) * labelRadius) labelY = centery + (0.5 * self.height * sin(aveAngleRadians) * labelRadius) rx = xradius * labelRadius ry = yradius * labelRadius l = _addWedgeLabel(self, labels[i], averageAngle, labelX, labelY, sectorStyle) if checkLabelOverlap: l._origdata = { 'x': labelX, 'y': labelY, 'angle': averageAngle, 'rx': rx, 'ry': ry, 'cx': cx, 'cy': cy, 'bounds': l.getBounds(), } L_add(l) if checkLabelOverlap and L: fixLabelOverlaps(L) for l in L: g.add(l) return g
def __init__(self, width=400, height=200, *args, **kw): Drawing.__init__(self, width, height, *args, **kw) self.transform = (1, 0, 0, 1, 0, 0) self.add( Line(0, 0, 0, 200, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(75, 100, 75, -351.4, -85, yradius=75, annular=False, fillColor=Color(.27451, .509804, .705882, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(75, 100, 75, -355, -351.4, yradius=75, annular=False, fillColor=Color(.847059, .74902, .847059, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(75, 100, 75, -358.6, -355, yradius=75, annular=False, fillColor=Color(.392157, .584314, .929412, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(75, 100, 75, -362.2, -358.6, yradius=75, annular=False, fillColor=Color(.690196, .768627, .870588, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(75, 100, 75, -365.8, -362.2, yradius=75, annular=False, fillColor=Color(.498039, 1, .831373, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(75, 100, 75, -445, -365.8, yradius=75, annular=False, fillColor=Color(.372549, .619608, .627451, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( String(-15, 155.6568, 'example1', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(165, 110.6564, 'example2', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(165, 105.0239, 'example3', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(165, 99.37169, 'example4', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(165, 93.72192, 'example5', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(165, 35.91766, 'example6', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( Line(16.06073, 146.3806, .530367, 158.6568, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(.530367, 158.6568, -15, 158.6568, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(149.4724, 108.8803, 157.2362, 113.6564, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(157.2362, 113.6564, 165, 113.6564, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(149.8831, 104.1866, 157.4415, 108.0239, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(157.4415, 108.0239, 165, 108.0239, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(149.9982, 99.47641, 157.4991, 102.3717, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(157.4991, 102.3717, 165, 102.3717, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(149.8173, 94.76826, 157.4087, 96.72192, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(157.4087, 96.72192, 165, 96.72192, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(127.6615, 46.59805, 146.3307, 38.91766, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(146.3307, 38.91766, 165, 38.91766, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None))
def __init__(self, width=400, height=200, *args, **kw): Drawing.__init__(self, width, height, *args, **kw) self.transform = (1, 0, 0, 1, 0, 0) self.add( Wedge(200, 100, 50, -147.8571, -135, yradius=50, annular=False, fillColor=Color(.27451, .509804, .705882, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -160.7143, -147.8571, yradius=50, annular=False, fillColor=Color(.847059, .74902, .847059, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -173.5714, -160.7143, yradius=50, annular=False, fillColor=Color(.392157, .584314, .929412, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -186.4286, -173.5714, yradius=50, annular=False, fillColor=Color(.690196, .768627, .870588, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -199.2857, -186.4286, yradius=50, annular=False, fillColor=Color(.498039, 1, .831373, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -212.1429, -199.2857, yradius=50, annular=False, fillColor=Color(.372549, .619608, .627451, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -225, -212.1429, yradius=50, annular=False, fillColor=Color(1, 1, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -237.8571, -225, yradius=50, annular=False, fillColor=Color(.27451, .509804, .705882, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -250.7143, -237.8571, yradius=50, annular=False, fillColor=Color(.847059, .74902, .847059, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -263.5714, -250.7143, yradius=50, annular=False, fillColor=Color(.392157, .584314, .929412, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -276.4286, -263.5714, yradius=50, annular=False, fillColor=Color(.690196, .768627, .870588, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -289.2857, -276.4286, yradius=50, annular=False, fillColor=Color(.498039, 1, .831373, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -302.1429, -289.2857, yradius=50, annular=False, fillColor=Color(.372549, .619608, .627451, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -315, -302.1429, yradius=50, annular=False, fillColor=Color(1, 1, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -327.8571, -315, yradius=50, annular=False, fillColor=Color(.27451, .509804, .705882, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -340.7143, -327.8571, yradius=50, annular=False, fillColor=Color(.847059, .74902, .847059, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -353.5714, -340.7143, yradius=50, annular=False, fillColor=Color(.392157, .584314, .929412, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -366.4286, -353.5714, yradius=50, annular=False, fillColor=Color(.690196, .768627, .870588, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -379.2857, -366.4286, yradius=50, annular=False, fillColor=Color(.498039, 1, .831373, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -392.1429, -379.2857, yradius=50, annular=False, fillColor=Color(.372549, .619608, .627451, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -405, -392.1429, yradius=50, annular=False, fillColor=Color(1, 1, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -417.8571, -405, yradius=50, annular=False, fillColor=Color(.27451, .509804, .705882, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -430.7143, -417.8571, yradius=50, annular=False, fillColor=Color(.847059, .74902, .847059, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -443.5714, -430.7143, yradius=50, annular=False, fillColor=Color(.392157, .584314, .929412, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -456.4286, -443.5714, yradius=50, annular=False, fillColor=Color(.690196, .768627, .870588, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -469.2857, -456.4286, yradius=50, annular=False, fillColor=Color(.498039, 1, .831373, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -482.1429, -469.2857, yradius=50, annular=False, fillColor=Color(.372549, .619608, .627451, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -495, -482.1429, yradius=50, annular=False, fillColor=Color(1, 1, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(160.9084, 68.82551, 150.4542, 65.59061, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(150.4542, 65.59061, 140, 65.59061, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(154.9516, 78.30581, 147.4758, 76.96698, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(147.4758, 76.96698, 140, 76.96698, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(151.2536, 88.87395, 145.6268, 89.64874, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(145.6268, 89.64874, 140, 89.64874, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(150, 100, 145, 103, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(145, 103, 140, 103, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(151.2536, 111.126, 145.6268, 116.3513, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(145.6268, 116.3513, 140, 116.3513, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(154.9516, 121.6942, 147.4758, 129.033, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(147.4758, 129.033, 140, 129.033, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(160.9084, 131.1745, 150.4542, 140.4094, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(150.4542, 140.4094, 140, 140.4094, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(168.8255, 139.0916, 154.4128, 149.9099, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(154.4128, 149.9099, 140, 149.9099, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(178.3058, 145.0484, 159.1529, 181.0581, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(159.1529, 181.0581, 140, 181.0581, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(188.874, 148.7464, 164.437, 173.4957, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(164.437, 173.4957, 140, 173.4957, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(200, 150, 170, 163, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(170, 163, 140, 163, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(211.126, 148.7464, 235.563, 167.4957, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(235.563, 167.4957, 260, 167.4957, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(221.6942, 145.0484, 240.8471, 157.0581, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(240.8471, 157.0581, 260, 157.0581, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(231.1745, 139.0916, 245.5872, 149.9099, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(245.5872, 149.9099, 260, 149.9099, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(239.0916, 131.1745, 249.5458, 140.4094, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(249.5458, 140.4094, 260, 140.4094, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(245.0484, 121.6942, 252.5242, 129.033, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(252.5242, 129.033, 260, 129.033, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(248.7464, 111.126, 254.3732, 116.3513, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(254.3732, 116.3513, 260, 116.3513, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(250, 100, 255, 103, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(255, 103, 260, 103, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(248.7464, 88.87395, 254.3732, 89.64874, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(254.3732, 89.64874, 260, 89.64874, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(245.0484, 78.30581, 252.5242, 76.96698, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(252.5242, 76.96698, 260, 76.96698, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(239.0916, 68.82551, 249.5458, 65.59061, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(249.5458, 65.59061, 260, 65.59061, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(231.1745, 60.90843, 245.5872, 56.09011, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(245.5872, 56.09011, 260, 56.09011, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(221.6942, 54.95156, 240.8471, 24.94187, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(240.8471, 24.94187, 260, 24.94187, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(211.126, 51.2536, 235.563, 32.50433, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(235.563, 32.50433, 260, 32.50433, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(200, 50, 230, 43, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(230, 43, 260, 43, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(188.874, 51.2536, 164.437, 38.50433, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(164.437, 38.50433, 140, 38.50433, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(178.3058, 54.95156, 159.1529, 48.94187, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(159.1529, 48.94187, 140, 48.94187, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(168.8255, 60.90843, 154.4128, 56.09011, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(154.4128, 56.09011, 140, 56.09011, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 140, 66.59061) v0.add( String(-38.88, -4, 'example1', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 140, 77.96698) v0.add( String(-38.88, -4, 'example2', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 140, 90.64874) v0.add( String(-38.88, -4, 'example3', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 140, 104) v0.add( String(-38.88, -4, 'example4', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 140, 117.3513) v0.add( String(-38.88, -4, 'example5', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 140, 130.033) v0.add( String(-38.88, -4, 'example6', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 140, 141.4094) v0.add( String(-38.88, -4, 'example7', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 140, 150.9099) v0.add( String(-38.88, -4, 'example8', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 140, 182.0581) v0.add( String(-38.88, -4, 'example9', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 140, 174.4957) v0.add( String(-43.88, -4, 'example10', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 140, 164) v0.add( String(-43.88, -4, 'example11', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 260, 168.4957) v0.add( String(0, -4, 'example12', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 260, 158.0581) v0.add( String(0, -4, 'example13', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 260, 150.9099) v0.add( String(0, -4, 'example14', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 260, 141.4094) v0.add( String(0, -4, 'example15', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 260, 130.033) v0.add( String(0, -4, 'example16', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 260, 117.3513) v0.add( String(0, -4, 'example17', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 260, 104) v0.add( String(0, -4, 'example18', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 260, 90.64874) v0.add( String(0, -4, 'example19', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 260, 77.96698) v0.add( String(0, -4, 'example20', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 260, 66.59061) v0.add( String(0, -4, 'example21', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 260, 57.09011) v0.add( String(0, -4, 'example22', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 260, 25.94187) v0.add( String(0, -4, 'example23', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 260, 33.50433) v0.add( String(0, -4, 'example24', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 260, 44) v0.add( String(0, -4, 'example25', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 140, 39.50433) v0.add( String(-43.88, -4, 'example26', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 140, 49.94187) v0.add( String(-43.88, -4, 'example27', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) v0 = self._nn(Group()) v0.transform = (1, 0, 0, 1, 140, 57.09011) v0.add( String(-43.88, -4, 'example28', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1)))
def _Flag_Brazil(self): s = _size # abbreviate as we will use this a lot g = Group() m = s / 14 self._width = w = (m * 20) def addStar(x, y, size, g=g, w=w, s=s, m=m): st = Star() st.fillColor = colors.mintcream st.size = size * m st.x = (w / 2) + (x * (0.35 * m)) st.y = (s / 2) + (y * (0.35 * m)) g.add(st) g.add( Rect(0, 0, w, s, fillColor=colors.green, strokeColor=None, strokeWidth=0)) g.add( Polygon(points=[ 1.7 * m, (s / 2), (w / 2), s - (1.7 * m), w - (1.7 * m), (s / 2), (w / 2), 1.7 * m ], fillColor=colors.yellow, strokeColor=None, strokeWidth=0)) g.add( Circle(cx=w / 2, cy=s / 2, r=3.5 * m, fillColor=colors.blue, strokeColor=None, strokeWidth=0)) g.add( Wedge((w / 2) - (2 * m), 0, 8.5 * m, 50, 98.1, 8.5 * m, fillColor=colors.mintcream, strokeColor=None, strokeWidth=0)) g.add( Wedge((w / 2), (s / 2), 3.501 * m, 156, 352, 3.501 * m, fillColor=colors.mintcream, strokeColor=None, strokeWidth=0)) g.add( Wedge((w / 2) - (2 * m), 0, 8 * m, 48.1, 100, 8 * m, fillColor=colors.blue, strokeColor=None, strokeWidth=0)) g.add( Rect(0, 0, w, (s / 4) + 1.7 * m, fillColor=colors.green, strokeColor=None, strokeWidth=0)) g.add( Polygon(points=[ 1.7 * m, (s / 2), (w / 2), s / 2 - 2 * m, w - (1.7 * m), (s / 2), (w / 2), 1.7 * m ], fillColor=colors.yellow, strokeColor=None, strokeWidth=0)) g.add( Wedge(w / 2, s / 2, 3.502 * m, 166, 342.1, 3.502 * m, fillColor=colors.blue, strokeColor=None, strokeWidth=0)) addStar(3.2, 3.5, 0.3) addStar(-8.5, 1.5, 0.3) addStar(-7.5, -3, 0.3) addStar(-4, -5.5, 0.3) addStar(0, -4.5, 0.3) addStar(7, -3.5, 0.3) addStar(-3.5, -0.5, 0.25) addStar(0, -1.5, 0.25) addStar(1, -2.5, 0.25) addStar(3, -7, 0.25) addStar(5, -6.5, 0.25) addStar(6.5, -5, 0.25) addStar(7, -4.5, 0.25) addStar(-5.5, -3.2, 0.25) addStar(-6, -4.2, 0.25) addStar(-1, -2.75, 0.2) addStar(2, -5.5, 0.2) addStar(4, -5.5, 0.2) addStar(5, -7.5, 0.2) addStar(5, -5.5, 0.2) addStar(6, -5.5, 0.2) addStar(-8.8, -3.2, 0.2) addStar(2.5, 0.5, 0.2) addStar(-0.2, -3.2, 0.14) addStar(-7.2, -2, 0.14) addStar(0, -8, 0.1) sTmp = "ORDEM E PROGRESSO" nTmp = len(sTmp) delta = 0.850848010347 / nTmp radius = 7.9 * m centerx = (w / 2) - (2 * m) centery = 0 for i in range(nTmp): rad = 2 * pi - i * delta - 4.60766922527 x = cos(rad) * radius + centerx y = sin(rad) * radius + centery if i == 6: z = 0.35 * m else: z = 0.45 * m g2 = Group( String(x, y, sTmp[i], fontName='Helvetica-Bold', fontSize=z, strokeColor=None, fillColor=colors.green)) g2.rotate(rad) g.add(g2) return g
def __init__(self, width=400, height=400, *args, **kw): Drawing.__init__(self, width, height, *args, **kw) self.transform = (1, 0, 0, 1, 0, 0) self.add( Wedge(200, 200, 150, 72.85714, 90, yradius=150, annular=False, fillColor=Color(0, .545098, .545098, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=60, yradius1=60)) self.add( Wedge(200, 200, 150, 38.57143, 72.85714, yradius=150, annular=False, fillColor=Color(.541176, .168627, .886275, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=60, yradius1=60)) self.add( Wedge(200, 200, 150, -12.85714, 38.57143, yradius=150, annular=False, fillColor=Color(0, 0, 1, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=60, yradius1=60)) self.add( Wedge(200, 200, 150, -81.42857, -12.85714, yradius=150, annular=False, fillColor=Color(0, 1, 1, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=60, yradius1=60)) self.add( Wedge(200, 200, 150, -167.1429, -81.42857, yradius=150, annular=False, fillColor=Color(1, .752941, .796078, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=60, yradius1=60)) self.add( Wedge(200, 200, 150, -270, -167.1429, yradius=150, annular=False, fillColor=Color(1, 0, 1, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=60, yradius1=60))
def __init__(self, width=400, height=400, *args, **kw): Drawing.__init__(self, width, height, *args, **kw) self.transform = (1, 0, 0, 1, 0, 0) self.add( Wedge(200, 200, 90, 72.85714, 90, yradius=90, annular=False, fillColor=Color(0, .545098, .545098, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=30, yradius1=30)) self.add( Wedge(200, 200, 90, 38.57143, 72.85714, yradius=90, annular=False, fillColor=Color(0, .545098, .545098, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=30, yradius1=30)) self.add( Wedge(200, 200, 90, -12.85714, 38.57143, yradius=90, annular=False, fillColor=Color(0, .545098, .545098, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=30, yradius1=30)) self.add( Wedge(200, 200, 90, -81.42857, -12.85714, yradius=90, annular=False, fillColor=Color(0, .545098, .545098, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=30, yradius1=30)) self.add( Wedge(200, 200, 90, -167.1429, -81.42857, yradius=90, annular=False, fillColor=Color(0, .545098, .545098, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=30, yradius1=30)) self.add( Wedge(200, 200, 90, -270, -167.1429, yradius=90, annular=False, fillColor=Color(0, .545098, .545098, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=30, yradius1=30)) self.add( Wedge(200, 200, 150, -306, -270, yradius=150, annular=False, fillColor=Color(.541176, .168627, .886275, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=90, yradius1=90)) self.add( Wedge(200, 200, 150, -378, -306, yradius=150, annular=False, fillColor=Color(.541176, .168627, .886275, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=90, yradius1=90)) self.add( Wedge(200, 200, 150, -486, -378, yradius=150, annular=False, fillColor=Color(.541176, .168627, .886275, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=90, yradius1=90)) self.add( Wedge(200, 200, 150, -630, -486, yradius=150, annular=False, fillColor=Color(.541176, .168627, .886275, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=0, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, radius1=90, yradius1=90)) self.add( String(226.8276, 377.9895, 'a', textAnchor='middle', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(301.3976, 348.723, 'b', textAnchor='middle', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(375.487, 240.0538, 'c', textAnchor='middle', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(322.4311, 68.05066, 'd', textAnchor='middle', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(98.60239, 51.27702, 'e', textAnchor='middle', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(59.27033, 312.2282, 'f', textAnchor='middle', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1)))
def draw(self): slices = self.slices _3d_angle = self.angle_3d _3dva = self._3dva = _360(_3d_angle+90) a0 = _2rad(_3dva) self._xdepth_3d = cos(a0)*self.depth_3d self._ydepth_3d = sin(a0)*self.depth_3d self._cx = self.x+self.width/2.0 self._cy = self.y+(self.height - self._ydepth_3d)/2.0 radiusx = radiusy = self._cx-self.x if self.xradius: radiusx = self.xradius if self.yradius: radiusy = self.yradius self._radiusx = radiusx self._radiusy = radiusy = (1.0 - self.perspective/100.0)*radiusy data = self.normalizeData() sum = self._sum CX = self.CX CY = self.CY OX = self.OX OY = self.OY rad_dist = self.rad_dist _fillSide = self._fillSide self._seriesCount = n = len(data) _sl3d = self._sl3d = [] g = Group() last = _360(self.startAngle) a0 = self.direction=='clockwise' and -1 or 1 for v in data: v *= a0 angle1, angle0 = last, v+last last = angle0 if a0>0: angle0, angle1 = angle1, angle0 _sl3d.append(_SL3D(angle0,angle1)) labels = _fixLabels(self.labels,n) a0 = _3d_angle a1 = _3d_angle+180 T = [] S = [] L = [] class WedgeLabel3d(WedgeLabel): _ydepth_3d = self._ydepth_3d def _checkDXY(self,ba): if ba[0]=='n': if not hasattr(self,'_ody'): self._ody = self.dy self.dy = -self._ody + self._ydepth_3d checkLabelOverlap = self.checkLabelOverlap for i in xrange(n): style = slices[i] if not style.visible: continue sl = _sl3d[i] lo = angle0 = sl.lo hi = angle1 = sl.hi if abs(hi-lo)<=1e-7: continue fillColor = _getShaded(style.fillColor,style.fillColorShaded,style.shading) strokeColor = _getShaded(style.strokeColor,style.strokeColorShaded,style.shading) or fillColor strokeWidth = style.strokeWidth cx0 = CX(i,0) cy0 = CY(i,0) cx1 = CX(i,1) cy1 = CY(i,1) #background shaded pie bottom g.add(Wedge(cx1,cy1,radiusx, lo, hi,yradius=radiusy, strokeColor=strokeColor,strokeWidth=strokeWidth,fillColor=fillColor, strokeLineJoin=1)) #connect to top if lo < a0 < hi: angle0 = a0 if lo < a1 < hi: angle1 = a1 if 1: p = ArcPath(strokeColor=strokeColor, fillColor=fillColor,strokeWidth=strokeWidth,strokeLineJoin=1) p.addArc(cx1,cy1,radiusx,angle0,angle1,yradius=radiusy,moveTo=1) p.lineTo(OX(i,angle1,0),OY(i,angle1,0)) p.addArc(cx0,cy0,radiusx,angle0,angle1,yradius=radiusy,reverse=1) p.closePath() if angle0<=_3dva and angle1>=_3dva: rd = 0 else: rd = min(rad_dist(angle0),rad_dist(angle1)) S.append((rd,p)) _fillSide(S,i,lo,strokeColor,strokeWidth,fillColor) _fillSide(S,i,hi,strokeColor,strokeWidth,fillColor) #bright shaded top fillColor = style.fillColor strokeColor = style.strokeColor or fillColor T.append(Wedge(cx0,cy0,radiusx,lo,hi,yradius=radiusy, strokeColor=strokeColor,strokeWidth=strokeWidth,fillColor=fillColor,strokeLineJoin=1)) text = labels[i] if style.label_visible and text: rat = style.labelRadius self._radiusx *= rat self._radiusy *= rat mid = sl.mid labelX = OX(i,mid,0) labelY = OY(i,mid,0) _addWedgeLabel(self,text,L.append,mid,labelX,labelY,style,labelClass=WedgeLabel3d) if checkLabelOverlap: l = L[-1] l._origdata = { 'x': labelX, 'y':labelY, 'angle': mid, 'rx': self._radiusx, 'ry':self._radiusy, 'cx':CX(i,0), 'cy':CY(i,0), 'bounds': l.getBounds(), } self._radiusx = radiusx self._radiusy = radiusy S.sort(lambda a,b: -cmp(a[0],b[0])) if checkLabelOverlap and L: fixLabelOverlaps(L) map(g.add,map(lambda x:x[1],S)+T+L) return g
def makeSectors(self): # normalize slice data if type(self.data) in (ListType, TupleType) and type( self.data[0]) in (ListType, TupleType): #it's a nested list, more than one sequence normData = [] n = [] for l in self.data: t = self.normalizeData(l) normData.append(t) n.append(len(t)) self._seriesCount = max(n) else: normData = self.normalizeData(self.data) n = len(normData) self._seriesCount = n #labels if self.labels is None: labels = [] if type(n) not in (ListType, TupleType): labels = [''] * n else: for m in n: labels = list(labels) + [''] * m else: labels = self.labels #there's no point in raising errors for less than enough labels if #we silently create all for the extreme case of no labels. if type(n) not in (ListType, TupleType): i = n - len(labels) if i > 0: labels = list(labels) + [''] * i else: tlab = 0 for m in n: tlab = tlab + m i = tlab - len(labels) if i > 0: labels = list(labels) + [''] * i xradius = self.width / 2.0 yradius = self.height / 2.0 centerx = self.x + xradius centery = self.y + yradius if self.direction == "anticlockwise": whichWay = 1 else: whichWay = -1 g = Group() sn = 0 startAngle = self.startAngle #% 360 styleCount = len(self.slices) if type(self.data[0]) in (ListType, TupleType): #multi-series doughnut iradius = (self.height / 5.0) / len(self.data) for series in normData: i = 0 for angle in series: endAngle = (startAngle + (angle * whichWay)) #% 360 if abs(startAngle - endAngle) >= 1e-5: if startAngle < endAngle: a1 = startAngle a2 = endAngle else: a1 = endAngle a2 = startAngle #if we didn't use %stylecount here we'd end up with the later sectors #all having the default style sectorStyle = self.slices[i % styleCount] # is it a popout? cx, cy = centerx, centery if sectorStyle.popout != 0: # pop out the sector averageAngle = (a1 + a2) / 2.0 aveAngleRadians = averageAngle * pi / 180.0 popdistance = sectorStyle.popout cx = centerx + popdistance * cos(aveAngleRadians) cy = centery + popdistance * sin(aveAngleRadians) if type(n) in (ListType, TupleType): theSector = Wedge( cx, cy, xradius + (sn * iradius) - iradius, a1, a2, yradius=yradius + (sn * iradius) - iradius, radius1=yradius + (sn * iradius) - (2 * iradius)) else: theSector = Wedge(cx, cy, xradius, a1, a2, yradius=yradius, radius1=iradius) theSector.fillColor = sectorStyle.fillColor theSector.strokeColor = sectorStyle.strokeColor theSector.strokeWidth = sectorStyle.strokeWidth theSector.strokeDashArray = sectorStyle.strokeDashArray g.add(theSector) startAngle = endAngle text = self.getSeriesName(i, '') if text: averageAngle = (a1 + a2) / 2.0 aveAngleRadians = averageAngle * pi / 180.0 labelRadius = sectorStyle.labelRadius labelX = centerx + (0.5 * self.width * cos(aveAngleRadians) * labelRadius) labelY = centery + (0.5 * self.height * sin(aveAngleRadians) * labelRadius) _addWedgeLabel(self, text, g.add, averageAngle, labelX, labelY, sectorStyle) i = i + 1 sn = sn + 1 else: i = 0 #single series doughnut iradius = self.height / 5.0 for angle in normData: endAngle = (startAngle + (angle * whichWay)) #% 360 if abs(startAngle - endAngle) >= 1e-5: if startAngle < endAngle: a1 = startAngle a2 = endAngle else: a1 = endAngle a2 = startAngle #if we didn't use %stylecount here we'd end up with the later sectors #all having the default style sectorStyle = self.slices[i % styleCount] # is it a popout? cx, cy = centerx, centery if sectorStyle.popout != 0: # pop out the sector averageAngle = (a1 + a2) / 2.0 aveAngleRadians = averageAngle * pi / 180.0 popdistance = sectorStyle.popout cx = centerx + popdistance * cos(aveAngleRadians) cy = centery + popdistance * sin(aveAngleRadians) if n > 1: theSector = Wedge(cx, cy, xradius, a1, a2, yradius=yradius, radius1=iradius) elif n == 1: theSector = Wedge(cx, cy, xradius, a1, a2, yradius=yradius, iradius=iradius) theSector.fillColor = sectorStyle.fillColor theSector.strokeColor = sectorStyle.strokeColor theSector.strokeWidth = sectorStyle.strokeWidth theSector.strokeDashArray = sectorStyle.strokeDashArray g.add(theSector) # now draw a label if labels[i] != "": averageAngle = (a1 + a2) / 2.0 aveAngleRadians = averageAngle * pi / 180.0 labelRadius = sectorStyle.labelRadius labelX = centerx + (0.5 * self.width * cos(aveAngleRadians) * labelRadius) labelY = centery + (0.5 * self.height * sin(aveAngleRadians) * labelRadius) theLabel = String(labelX, labelY, labels[i]) theLabel.textAnchor = "middle" theLabel.fontSize = sectorStyle.fontSize theLabel.fontName = sectorStyle.fontName theLabel.fillColor = sectorStyle.fontColor g.add(theLabel) startAngle = endAngle i = i + 1 return g
def __init__(self, width=400, height=200, *args, **kw): Drawing.__init__(self, width, height, *args, **kw) self.transform = (1, 0, 0, 1, 0, 0) self.add( Line(10, 10, 390, 190, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Circle(100, 100, 20, fillColor=Color(0, .501961, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Circle(200, 100, 40, fillColor=Color(0, .501961, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Circle(300, 100, 30, fillColor=Color(0, .501961, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(330, 100, 40, -10, 40, yradius=None, annular=False, fillColor=Color(0, .501961, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( PolyLine(points=[ 120, 10, 130, 20, 140, 10, 150, 20, 160, 10, 170, 20, 180, 10, 190, 20, 200, 10 ], strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None, fillColor=Color(0, .501961, 0, 1))) self.add( Polygon(points=[300, 20, 350, 20, 390, 80, 300, 75, 330, 40], fillColor=Color(0, .501961, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Ellipse(50, 150, 40, 20, fillColor=Color(0, .501961, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Rect(120, 150, 60, 30, rx=0, ry=0, fillColor=Color(0, .501961, 0, 1), fillOpacity=None, strokeColor=Color(1, 1, 0, 1), strokeWidth=10, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Rect(220, 150, 60, 30, rx=10, ry=10, fillColor=Color(0, .501961, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( String(10, 50, 'Basic Shapes', textAnchor='start', fontName='Helvetica', fontSize=10, fillColor=Color(0, 0, 0, 1)))
def __init__(self, width=400, height=200, *args, **kw): Drawing.__init__(self, width, height, *args, **kw) self.transform = (1, 0, 0, 1, 0, 0) self.add( Wedge(200, 100, 50, -172.236, -170, yradius=50, annular=False, fillColor=Color(.27451, .509804, .705882, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -174.472, -172.236, yradius=50, annular=False, fillColor=Color(.847059, .74902, .847059, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -176.7081, -174.472, yradius=50, annular=False, fillColor=Color(.392157, .584314, .929412, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -178.9441, -176.7081, yradius=50, annular=False, fillColor=Color(.690196, .768627, .870588, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -181.1801, -178.9441, yradius=50, annular=False, fillColor=Color(.498039, 1, .831373, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -248.2609, -181.1801, yradius=50, annular=False, fillColor=Color(.372549, .619608, .627451, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -360.0621, -248.2609, yradius=50, annular=False, fillColor=Color(1, 1, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -362.2981, -360.0621, yradius=50, annular=False, fillColor=Color(.27451, .509804, .705882, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -364.5342, -362.2981, yradius=50, annular=False, fillColor=Color(.847059, .74902, .847059, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -366.7702, -364.5342, yradius=50, annular=False, fillColor=Color(.392157, .584314, .929412, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -369.0062, -366.7702, yradius=50, annular=False, fillColor=Color(.690196, .768627, .870588, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -371.2422, -369.0062, yradius=50, annular=False, fillColor=Color(.498039, 1, .831373, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -373.4783, -371.2422, yradius=50, annular=False, fillColor=Color(.372549, .619608, .627451, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -462.9193, -373.4783, yradius=50, annular=False, fillColor=Color(1, 1, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -507.6398, -462.9193, yradius=50, annular=False, fillColor=Color(.27451, .509804, .705882, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -530, -507.6398, yradius=50, annular=False, fillColor=Color(.847059, .74902, .847059, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( String(140, 138.736, 'example1', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(140, 129.056, 'example2', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(140, 119.3865, 'example3', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(140, 109.724, 'example4', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(140, 100.065, 'example5', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(140, 134.1744, 'example6', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(260, 149.6475, 'example7', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(260, 128.7643, 'example8', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(260, 120.4247, 'example9', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(260, 112.0907, 'example10', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(260, 103.7656, 'example11', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(260, 95.45302, 'example12', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(260, 87.15654, 'example13', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(260, 49.00712, 'example14', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(140, 51.01934, 'example15', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(140, 78.32193, 'example16', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( Line(150.5996, 92.28001, 145.2998, 141.736, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(145.2998, 141.736, 140, 141.736, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(150.336, 94.2133, 145.168, 132.056, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(145.168, 132.056, 140, 132.056, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(150.148, 96.1554, 145.074, 122.3865, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(145.074, 122.3865, 140, 122.3865, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(150.036, 98.10336, 145.018, 112.724, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(145.018, 112.724, 140, 112.724, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(150, 100.0542, 145, 103.065, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(145, 103.065, 140, 103.065, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(158.903, 128.4787, 149.4515, 137.1744, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(149.4515, 137.1744, 140, 137.1744, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(228.0764, 141.3729, 244.0382, 152.6475, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(244.0382, 152.6475, 260, 152.6475, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(249.9894, 98.97022, 254.9947, 131.7643, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(254.9947, 131.7643, 260, 131.7643, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(249.9112, 97.02061, 254.9556, 123.4247, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(254.9556, 123.4247, 260, 123.4247, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(249.7569, 95.07554, 254.8785, 115.0907, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(254.8785, 115.0907, 260, 115.0907, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(249.5269, 93.13797, 254.7634, 106.7656, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(254.7634, 106.7656, 260, 106.7656, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(249.2214, 91.21085, 254.6107, 98.45302, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(254.6107, 98.45302, 260, 98.45302, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(248.8411, 89.29712, 254.4205, 90.15654, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(254.4205, 90.15654, 260, 90.15654, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(226.3487, 57.50594, 243.1744, 52.00712, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(243.1744, 52.00712, 260, 52.00712, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(171.1217, 59.18279, 155.5609, 54.01934, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(155.5609, 54.01934, 140, 54.01934, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(153.3775, 81.93494, 146.6888, 81.32193, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(146.6888, 81.32193, 140, 81.32193, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None))
def __init__(self, width=400, height=200, *args, **kw): Drawing.__init__(self, width, height, *args, **kw) self.transform = (1, 0, 0, 1, 0, 0) self.add( Wedge(200, 100, 50, 72.85714, 90, yradius=50, annular=False, fillColor=Color(0, .545098, .545098, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, 38.57143, 72.85714, yradius=50, annular=False, fillColor=Color(.541176, .168627, .886275, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -12.85714, 38.57143, yradius=50, annular=False, fillColor=Color(0, 0, 1, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(213.6035, 85.33896, 50, -81.42857, -12.85714, yradius=50, annular=False, fillColor=Color(0, 1, 1, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=2, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=[2, 2], strokeOpacity=None)) self.add( Wedge(200, 100, 50, -167.1429, -81.42857, yradius=50, annular=False, fillColor=Color(1, .752941, .796078, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(200, 100, 50, -270, -167.1429, yradius=50, annular=False, fillColor=Color(1, 0, 1, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( String(208.9425, 159.3298, 'a', textAnchor='middle', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(233.7992, 149.5743, 'b', textAnchor='middle', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(258.4957, 113.3513, 'c', textAnchor='middle', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(273.1186, 21.19692, 'd', textAnchor='middle', fontName='Times-Roman', fontSize=10, fillColor=Color(1, 0, 0, 1))) self.add( String(166.2008, 50.42567, 'e', textAnchor='middle', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(153.0901, 137.4094, 'f', textAnchor='middle', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1)))
def makeWedges(self): angles = self.makeAngles() n = len(angles) labels = _fixLabels(self.labels,n) self._seriesCount = n styleCount = len(self.slices) plMode = self.pointerLabelMode if plMode: checkLabelOverlap = False PL=self.makePointerLabels(angles,plMode) xradius = PL.xradius yradius = PL.yradius centerx = PL.centerx centery = PL.centery PL_data = PL.data gSN = lambda i: '' else: xradius = self.width*0.5 yradius = self.height*0.5 centerx = self.x + xradius centery = self.y + yradius if self.xradius: xradius = self.xradius if self.yradius: yradius = self.yradius if self.sameRadii: xradius=yradius=min(xradius,yradius) checkLabelOverlap = self.checkLabelOverlap gSN = lambda i: self.getSeriesName(i,'') g = Group() g_add = g.add if checkLabelOverlap: L = [] L_add = L.append else: L_add = g_add for i,(a1,a2) in angles: if a2 is None: continue #if we didn't use %stylecount here we'd end up with the later wedges #all having the default style wedgeStyle = self.slices[i%styleCount] if not wedgeStyle.visible: continue # is it a popout? cx, cy = centerx, centery text = gSN(i) popout = wedgeStyle.popout if text or popout: averageAngle = (a1+a2)/2.0 aveAngleRadians = averageAngle/_180_pi cosAA = cos(aveAngleRadians) sinAA = sin(aveAngleRadians) if popout: # pop out the wedge cx = centerx + popout*cosAA cy = centery + popout*sinAA if n > 1: theWedge = Wedge(cx, cy, xradius, a1, a2, yradius=yradius) elif n==1: theWedge = Ellipse(cx, cy, xradius, yradius) theWedge.fillColor = wedgeStyle.fillColor theWedge.strokeColor = wedgeStyle.strokeColor theWedge.strokeWidth = wedgeStyle.strokeWidth theWedge.strokeDashArray = wedgeStyle.strokeDashArray g_add(theWedge) if wedgeStyle.label_visible: if text: labelRadius = wedgeStyle.labelRadius rx = xradius*labelRadius ry = yradius*labelRadius labelX = cx + rx*cosAA labelY = cy + ry*sinAA _addWedgeLabel(self,text,L_add,averageAngle,labelX,labelY,wedgeStyle) if checkLabelOverlap: l = L[-1] l._origdata = { 'x': labelX, 'y':labelY, 'angle': averageAngle, 'rx': rx, 'ry':ry, 'cx':cx, 'cy':cy, 'bounds': l.getBounds(), } elif plMode and PL_data: l = PL_data[i] if l: data = l._origdata sinM = data['smid'] cosM = data['cmid'] lX = cx + xradius*cosM lY = cy + yradius*sinM lpel = wedgeStyle.label_pointer_elbowLength lXi = lX + lpel*cosM lYi = lY + lpel*sinM L_add(PolyLine((lX,lY,lXi,lYi,l.x,l.y), strokeWidth=wedgeStyle.label_pointer_strokeWidth, strokeColor=wedgeStyle.label_pointer_strokeColor)) L_add(l) if checkLabelOverlap and L: fixLabelOverlaps(L) map(g_add,L) return g
def __init__(self, width=400, height=200, *args, **kw): Drawing.__init__(self, width, height, *args, **kw) self.transform = (1, 0, 0, 1, 0, 0) self.add( Wedge(175, 100, 50, -127.3684, -95, yradius=50, annular=False, fillColor=Color(.27451, .509804, .705882, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -143.1579, -127.3684, yradius=50, annular=False, fillColor=Color(.847059, .74902, .847059, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -174.7368, -143.1579, yradius=50, annular=False, fillColor=Color(.392157, .584314, .929412, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -186.5789, -174.7368, yradius=50, annular=False, fillColor=Color(.690196, .768627, .870588, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -202.3684, -186.5789, yradius=50, annular=False, fillColor=Color(.498039, 1, .831373, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -226.0526, -202.3684, yradius=50, annular=False, fillColor=Color(.372549, .619608, .627451, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -265.5263, -226.0526, yradius=50, annular=False, fillColor=Color(1, 1, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -277.3684, -265.5263, yradius=50, annular=False, fillColor=Color(.27451, .509804, .705882, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -297.1053, -277.3684, yradius=50, annular=False, fillColor=Color(.847059, .74902, .847059, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -324.7368, -297.1053, yradius=50, annular=False, fillColor=Color(.392157, .584314, .929412, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -344.4737, -324.7368, yradius=50, annular=False, fillColor=Color(.690196, .768627, .870588, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -360.2632, -344.4737, yradius=50, annular=False, fillColor=Color(.498039, 1, .831373, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -383.9474, -360.2632, yradius=50, annular=False, fillColor=Color(.372549, .619608, .627451, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -415.5263, -383.9474, yradius=50, annular=False, fillColor=Color(1, 1, 0, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -431.3158, -415.5263, yradius=50, annular=False, fillColor=Color(.27451, .509804, .705882, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Wedge(175, 100, 50, -455, -431.3158, yradius=50, annular=False, fillColor=Color(.847059, .74902, .847059, 1), fillOpacity=None, strokeColor=Color(0, 0, 0, 1), strokeWidth=1, strokeLineCap=0, strokeLineJoin=1, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( String(115, 44.05459, 'example1', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(115, 57.7689, 'example2', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(115, 78.44648, 'example3', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(115, 100.6889, 'example4', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(115, 114.9961, 'example5', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(115, 133.7341, 'example6', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(115, 154.7227, 'example7', textAnchor='end', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(235, 165.9809, 'example8', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(235, 157.3053, 'example9', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(235, 145.3368, 'example10', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(235, 125.7311, 'example11', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(235, 107.9682, 'example12', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(235, 87.4175, 'example13', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(235, 61.64425, 'example14', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(235, 52.34088, 'example15', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( String(235, 40.42731, 'example16', textAnchor='start', fontName='Times-Roman', fontSize=10, fillColor=Color(0, 0, 0, 1))) self.add( Line(156.9316, 53.37883, 135.9658, 47.05459, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(135.9658, 47.05459, 115, 47.05459, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(139.4826, 64.80742, 127.2413, 60.7689, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(127.2413, 60.7689, 115, 60.7689, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(128.3375, 82.03873, 121.6687, 81.44648, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(121.6687, 81.44648, 115, 81.44648, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(125.0033, 100.5741, 120.0016, 103.6889, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(120.0016, 103.6889, 115, 103.6889, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(126.5869, 112.4968, 120.7934, 117.9961, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(120.7934, 117.9961, 115, 117.9961, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(133.6511, 128.1118, 124.3256, 136.7341, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(124.3256, 136.7341, 115, 136.7341, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(154.4955, 145.6022, 134.7477, 157.7227, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(134.7477, 157.7227, 115, 157.7227, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(176.2629, 149.984, 205.6315, 168.9809, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(205.6315, 168.9809, 235, 168.9809, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(189.8161, 147.7544, 212.4081, 160.3053, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(212.4081, 160.3053, 235, 160.3053, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(207.7509, 137.7806, 221.3755, 148.3368, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(221.3755, 148.3368, 235, 148.3368, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(220.1687, 121.4426, 227.5844, 128.7311, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(227.5844, 128.7311, 235, 128.7311, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(224.5571, 106.6401, 229.7786, 110.9682, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(229.7786, 110.9682, 235, 110.9682, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(223.8882, 89.51458, 229.4441, 90.4175, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(229.4441, 90.4175, 235, 90.4175, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(213.4494, 68.03688, 224.2247, 64.64425, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(224.2247, 64.64425, 235, 64.64425, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(197.3715, 55.28406, 216.1858, 55.34088, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(216.1858, 55.34088, 235, 55.34088, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(180.9567, 50.35609, 207.9783, 43.42731, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None)) self.add( Line(207.9783, 43.42731, 235, 43.42731, strokeColor=Color(0, 0, 0, 1), strokeWidth=.5, strokeLineCap=0, strokeLineJoin=0, strokeMiterLimit=0, strokeDashArray=None, strokeOpacity=None))