From f45fa854f35947eda3f2d0b4c850c76c1591e553 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Wed, 27 Aug 2008 23:10:27 +0200 Subject: [PATCH] Add some Grapher Documentation --- Documentation/GraphingAPI.txt | 33 +++++++++++++++++++++++++++++++++ Documentation/README | 1 + 2 files changed, 34 insertions(+) create mode 100644 Documentation/GraphingAPI.txt create mode 100644 Documentation/README diff --git a/Documentation/GraphingAPI.txt b/Documentation/GraphingAPI.txt new file mode 100644 index 0000000..b600491 --- /dev/null +++ b/Documentation/GraphingAPI.txt @@ -0,0 +1,33 @@ +The core of the graphing functionality is in the PBGitGrapher class. This +class has one function - parseCommits() that takes an NSArray of commits and +creates a PBGraphCellInfo for each commit. These PBGraphCellInfo are stored in +an array that can later be accessed using the cellInfoForRow: function. + +The PBGraphCellInfo has only basic information -- The column the commit +associated with this commit should be drawn in, and other lines that should be +drawn. + +These lines are in an array of PBLines. A PBLine has three pieces of +information -- a start column, an end column and whether the line should be +drawn on the top or bottom part of the row. This should later be extended to +add color information for the lines. + +In the PBDetailController, the - +(void)tableView:willDisplayCell:forTableColumn:row: is implemented which sets +the correct PBGraphCellInfo for the cell to be drawn. This cell is of the +class PBGitRevisionCell, which has the actual drawing implementation. + +The basic algorithm for the graphing is like this: + +For each commit + For each previous column + If this commit should be in this column + mark this position and set this commits first parent + as the next commit for this lane + Else if this commit should be in a previous column + add a line to that column and discard the previous + column + Else + Keep this column for the current row + For each parent of this commit + If it has not been displayed, add it as a column \ No newline at end of file diff --git a/Documentation/README b/Documentation/README new file mode 100644 index 0000000..1517f92 --- /dev/null +++ b/Documentation/README @@ -0,0 +1 @@ +This directory is meant to document some of the API's that we use \ No newline at end of file