Changeset 96 for trunk

Show
Ignore:
Timestamp:
09/12/08 01:30:22 (4 years ago)
Author:
lgs
Message:

Kill the whitespace

Location:
trunk/src
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/chart.py

    r93 r96  
    267267            h += self.options.padding.top + self.options.padding.bottom 
    268268            cx.rectangle(x, y, w, h) 
    269             cx.fill()  
     269            cx.fill() 
    270270 
    271271        if self.options.background.chartColor: 
    272272            cx.set_source_rgb(*hex2rgb(self.options.background.chartColor)) 
    273273            cx.rectangle(self.area.x, self.area.y, self.area.w, self.area.h) 
    274             cx.fill()  
     274            cx.fill() 
    275275 
    276276        if self.options.background.lineColor: 
    277277            cx.set_source_rgb(*hex2rgb(self.options.background.lineColor)) 
    278278            cx.set_line_width(self.options.axis.lineWidth) 
    279             self._renderLines(cx)  
     279            self._renderLines(cx) 
    280280 
    281281        cx.restore() 
     
    410410        else: 
    411411            cx.move_to(x - labelWidth / 2.0, y + fontAscent) 
    412              
     412 
    413413        cx.show_text(label) 
    414414 
     
    471471    def _renderTitle(self, cx): 
    472472        if self.options.title: 
    473             cx.save()            
     473            cx.save() 
    474474            cx.select_font_face(self.options.titleFont, 
    475475                                cairo.FONT_SLANT_NORMAL, 
    476476                                cairo.FONT_WEIGHT_BOLD) 
    477             cx.set_font_size(self.options.titleFontSize)  
     477            cx.set_font_size(self.options.titleFontSize) 
    478478 
    479479            title = unicode(self.options.title) 
    480480            extents = cx.text_extents(title) 
    481             titleWidth = extents[2]  
    482  
    483             x = self.area.x + self.area.w / 2.0 - titleWidth / 2.0  
    484             y = cx.font_extents()[0] # font ascent  
     481            titleWidth = extents[2] 
     482 
     483            x = self.area.x + self.area.w / 2.0 - titleWidth / 2.0 
     484            y = cx.font_extents()[0] # font ascent 
    485485 
    486486            cx.move_to(x, y) 
    487487            cx.show_text(title) 
    488              
     488 
    489489            cx.restore() 
    490490 
  • trunk/src/color.py

    r85 r96  
    2525        return maxValue 
    2626    return value 
    27      
     27 
    2828def hex2rgb(hexstring, digits=2): 
    2929    """Converts a hexstring color to a rgb tuple. 
     
    4848            clamp(0.0, 1.0, g + amount), 
    4949            clamp(0.0, 1.0, b + amount)) 
    50      
     50 
    5151def generateColorscheme(masterColor, keys): 
    5252    """Generates a dictionary where the keys match the keys argument and 
  • trunk/src/line.py

    r85 r96  
    2020 
    2121class LineChart(Chart): 
    22      
     22 
    2323    def __init__(self, surface=None, options={}): 
    2424        super(LineChart, self).__init__(surface, options) 
    2525        self.points = [] 
    26          
     26 
    2727    def _updateChart(self): 
    2828        """Evaluates measures for line charts""" 
     
    3535                y = 1.0 - (yval - self.minyval) * self.yscale 
    3636                point = Point(x, y, xval, yval, name) 
    37                  
     37 
    3838                if 0.0 <= point.x <= 1.0 and 0.0 <= point.y <= 1.0: 
    3939                    self.points.append(point) 
    40      
     40 
    4141    def _renderChart(self, cx): 
    42         """Renders a line chart"""         
     42        """Renders a line chart""" 
    4343        def preparePath(storeName): 
    4444            cx.new_path() 
     
    7272                cx.set_source_rgb(*self.options.colorScheme[storeName]) 
    7373                cx.stroke() 
    74          
     74 
    7575 
    7676        cx.save() 
     
    8686                    cx.fill() 
    8787                    cx.restore() 
    88                  
     88 
    8989                # fill the line 
    9090                cx.set_source_rgb(*self.options.colorScheme[storeName]) 
    9191                preparePath(storeName) 
    9292                cx.fill() 
    93                  
     93 
    9494                if not self.options.stroke.hide: 
    9595                    # draw stroke 
  • trunk/src/pie.py

    r85 r96  
    7878        if self.options.background.hide: 
    7979            return 
    80          
     80 
    8181        cx.save() 
    8282 
     
    8888            cx.rectangle(x, y, w, h) 
    8989            cx.fill() 
    90          
     90 
    9191        cx.restore() 
    9292 
     
    187187        cx.line_to(centerx, centery) 
    188188        cx.close_path() 
    189      
     189 
    190190    def getNormalisedAngle(self): 
    191191        normalisedAngle = (self.startAngle + self.endAngle) / 2 
  • trunk/src/scatter.py

    r85 r96  
    2121 
    2222class ScatterplotChart(LineChart): 
    23        
     23 
    2424    def _renderChart(self, cx): 
    2525        """Renders a scatterplot""" 
     
    3131            cx.move_to(ox     , oy-size) 
    3232            cx.line_to(ox     , oy+size) 
    33                         
     33 
    3434        def preparePath(storeName, size=2): 
    3535            cx.new_path() 
     
    3838                    drawSymbol(point, size) 
    3939            cx.close_path() 
    40          
     40 
    4141        cx.save() 
    42          
     42 
    4343        cx.set_line_width(self.options.stroke.width) 
    4444        # TODO: self.options.stroke.shadow 
     
    4747            preparePath(key) 
    4848            cx.stroke() 
    49              
     49 
    5050        cx.restore() 
    5151