GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Custom graph of github repo contributions
Homepage: http://spinach.andascarygoat.com/tags/tribby
Clone URL: git://github.com/zmack/tribby.git
Releaseworthy ? Somewhat !
zmack (author)
Wed Jul 23 02:20:45 -0700 2008
commit  89e0f940e6ea84667a9b9127af3cfdeaa67d47a8
tree    eac2d046a9bfa3d17ee14fca2edf21bfcd339a98
parent  9be0f5e019e4f993c9d5c46ed137db6db615f2c0
...
10
11
12
13
 
14
15
16
...
10
11
12
 
13
14
15
16
0
@@ -10,7 +10,7 @@ p = project_model :model do |m|
0
   m.language = 'as3'
0
   m.background_color = '#FFFFFF'
0
   m.width = 400
0
- m.height = 200
0
+ m.height = 100
0
   # m.src_dir = 'src'
0
   # m.lib_dir = 'lib'
0
   # m.swc_dir = 'lib'
...
21
22
23
24
 
25
26
27
...
46
47
48
49
 
 
50
51
52
53
 
 
54
55
56
...
21
22
23
 
24
25
26
27
...
46
47
48
 
49
50
51
52
53
 
54
55
56
57
58
0
@@ -21,7 +21,7 @@ package {
0
     }
0
 
0
     private function getPointWidth():Number {
0
- return _pointWidth ||= (0.9 * _width) / 52;
0
+ return _pointWidth ||= ( _width - 20 ) / 52;
0
     }
0
 
0
     private function getMaxCommits():uint {
0
@@ -46,11 +46,13 @@ package {
0
       this.graphics.beginFill(0x0000FF);
0
       this.graphics.lineStyle(1, 0x0000FF);
0
       for( var i:uint = 0; i < _data.length - 1; i++ ) {
0
- this.graphics.drawCircle(i*pointW, _height - _data[i].own * pointH, 2);
0
+ if ( pointW > 5 )
0
+ this.graphics.drawCircle(i*pointW, _height - _data[i].own * pointH, 2);
0
         this.graphics.moveTo(i*pointW, _height - _data[i].own * pointH);
0
         this.graphics.lineTo((i+1)*pointW, _height - _data[i+1].own * pointH);
0
       }
0
- this.graphics.drawCircle((_data.length - 1)*pointW, _height - _data[_data.length - 1].own * pointH, 2);
0
+ if ( pointW > 5 )
0
+ this.graphics.drawCircle((_data.length - 1)*pointW, _height - _data[_data.length - 1].own * pointH, 2);
0
       this.graphics.endFill();
0
     }
0
 
...
1
2
3
 
 
 
 
4
5
6
7
 
 
 
8
9
10
 
11
12
 
 
 
 
 
 
 
 
13
14
15
16
 
 
17
18
19
...
1
2
 
3
4
5
6
7
8
9
10
11
12
13
14
15
 
16
17
18
19
20
21
22
23
24
25
26
27
28
 
29
30
31
32
33
34
0
@@ -1,19 +1,34 @@
0
 package {
0
   import flash.display.Sprite;
0
- import skins.TribbySkin;
0
+ import flash.external.ExternalInterface;
0
+ import flash.display.StageScaleMode;
0
+ import flash.display.StageAlign;
0
+ import flash.display.LoaderInfo;
0
   
0
   public class Tribby extends Sprite {
0
 
0
     public function Tribby() {
0
+ stage.scaleMode = StageScaleMode.NO_SCALE;
0
+ stage.align = StageAlign.TOP_LEFT;
0
+
0
       var c:ContributionFetcher = new ContributionFetcher();
0
       c.addEventListener(ContributionEvent.DATA_RECEIVED, onDataLoaded);
0
- c.loadProject('http://github.com/technoweenie/attachment_fu/graphs/owner_participation');
0
+ c.loadProject(getProjectUrl());
0
     }
0
 
0
+ private function getProjectUrl():String {
0
+ var params:Object = LoaderInfo(this.loaderInfo).parameters;
0
+ var user:String = params.gitUser || 'zmack';
0
+ var project:String = params.gitProject || 'tribby';
0
+
0
+ return 'http://github.com/' + user + '/' + project + '/graphs/owner_participation';
0
+ }
0
+
0
     private function onDataLoaded(e:ContributionEvent):void {
0
       var graph:LineGraph = new LineGraph(e.data, stage.stageWidth, stage.stageHeight);
0
-
0
       addChild(graph);
0
+
0
+ graph.x = 10;
0
     }
0
   }
0
 }

Comments

    No one has commented yet.