public
Fork of Caged/gitnub
Description: A Gitk-like application written in RubyCocoa that looks like it belongs on a Mac. See the wiki for downloads and screenshots.
Homepage: http://alternateidea.com
Clone URL: git://github.com/eventualbuddha/gitnub.git
Search Repo:
Some playing with the visualization.  Getting a clean head
Caged (author)
Fri Apr 25 14:02:08 -0700 2008
commit  8230ca3ae817a025a64a2aa2af1bf13cda4391a1
tree    de13b36e74513908b413a9916e940dff829be148
parent  7e0f6a4ada7e6778359939bed8187a521a4b12c8
...
7
8
9
 
 
10
11
12
13
14
15
...
26
27
28
29
 
30
31
32
 
33
34
35
 
 
 
 
 
36
37
38
39
40
41
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
44
45
...
7
8
9
10
11
12
13
14
15
16
17
...
28
29
30
 
31
32
33
 
34
35
36
 
37
38
39
40
41
42
 
 
 
 
 
 
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
0
@@ -7,6 +7,8 @@
0
 #
0
 
0
 require 'osx/cocoa'
0
+require 'ostruct'
0
+require 'pp'
0
 
0
 class VisualizationView < OSX::NSView
0
   ib_outlet :application_controller
0
0
0
0
@@ -26,20 +28,49 @@
0
   end
0
   
0
   def drawRect(rect)
0
- points = []
0
+ nodes = {}
0
     context = NSGraphicsContext.currentContext
0
     NSColor.darkGrayColor.set
0
- NSRectFill(self.bounds)
0
+ NSRectFill(bounds)
0
     
0
     path = NSBezierPath.bezierPath
0
- path.lineWidth = 2
0
+ path.lineWidth = 3
0
+
0
+ path.moveToPoint([100, 105])
0
+ path.appendBezierPathWithOvalInRect(NSMakeRect(100, 100, 10, 10))
0
+ path.relativeMoveToPoint([0, 3.5])
0
     
0
- path.moveToPoint([100, 100])
0
- @repo.commits(:master, 50, 0).each_with_index do |commit, index|
0
- point = NSMakePoint(((index + 1) * 25), 100)
0
- path.lineToPoint([25 * index, 100])
0
- path.appendBezierPathWithOvalInRect(NSMakeRect(point[0] - 10, point[1], 10, 10))
0
- end
0
+ context.saveGraphicsState
0
+ path.relativeLineToPoint([90, 0])
0
+ context.restoreGraphicsState
0
+
0
+ path.relativeMoveToPoint([5, 5])
0
+ path.relativeCurveToPoint_controlPoint1_controlPoint2([40, 20], [0, 20], [-5, 20])
0
+
0
+ path.appendBezierPathWithOvalInRect(NSMakeRect(200, 100, 10, 10))
0
+ path.relativeMoveToPoint([0, 3.5])
0
+ path.relativeLineToPoint([90, 0])
0
+ path.appendBezierPathWithOvalInRect(NSMakeRect(300, 100, 10, 10))
0
+
0
+
0
+
0
+ # commits = @repo.git.rev_list({:topo_order => true, :all => true, :pretty => 'raw', :full_history => true})
0
+ # commits = Grit::Commit.list_from_string(@repo, commits)
0
+ # commits.each_with_index do |commit, index|
0
+ # current_offset = 25 * (index + path_offset)
0
+ # path.moveToPoint([current_offset - ((path_offset * 25) + 40), 105])
0
+ # path.lineToPoint([current_offset, 105])
0
+ # path.appendBezierPathWithOvalInRect(NSMakeRect(current_offset, 100, 10, 10))
0
+ # commit.parents.each do |parent|
0
+ # npath = NSBezierPath.bezierPathWithOvalInRect(NSMakeRect((current_offset + 25), 125, 10, 10))
0
+ # NSColor.blueColor.set
0
+ # npath.fill
0
+ # npath.lineWidth = 3
0
+ # NSColor.whiteColor.set
0
+ # npath.stroke
0
+ # path_offset += 1
0
+ # end if commit.parents.size > 1
0
+ # end
0
     
0
     NSColor.blackColor.set
0
     path.fill

Comments

    No one has commented yet.