mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 17:27:22 +02:00
git log now done, fixed up result rendering
This commit is contained in:
parent
543f5986ae
commit
9c7ec69e2f
10 changed files with 189 additions and 35 deletions
|
@ -71,7 +71,7 @@ GitVisuals.prototype.toScreenCoords = function(pos) {
|
|||
**************************************/
|
||||
|
||||
GitVisuals.prototype.refreshTree = function() {
|
||||
if (!this.paperReady) { return; }
|
||||
if (!this.paperReady) { console.warn('called refresh tree when not ready yet'); return; }
|
||||
|
||||
this.calculateTreeCoords();
|
||||
this.animateNodePositions();
|
||||
|
@ -79,6 +79,13 @@ GitVisuals.prototype.refreshTree = function() {
|
|||
this.animateRefs();
|
||||
};
|
||||
|
||||
GitVisuals.prototype.refreshTreeHarsh = function() {
|
||||
this.calculateTreeCoords();
|
||||
|
||||
this.animateEdges();
|
||||
this.animateNodePositions();
|
||||
};
|
||||
|
||||
GitVisuals.prototype.calculateTreeCoords = function() {
|
||||
if (!this.rootCommit) {
|
||||
throw new Error('grr, no root commit!');
|
||||
|
@ -142,6 +149,13 @@ GitVisuals.prototype.assignBoundsRecursive = function(commit, min, max) {
|
|||
|
||||
GitVisuals.prototype.calcDepth = function() {
|
||||
var maxDepth = this.calcDepthRecursive(this.rootCommit, 0);
|
||||
if (maxDepth > 15) {
|
||||
// issue warning
|
||||
events.trigger('issueWarning',
|
||||
'Max Depth Exceeded! Visuals may degrade here. ' +
|
||||
'Please start fresh or use reset to reduce the max depth'
|
||||
);
|
||||
}
|
||||
|
||||
var depthIncrement = this.getDepthIncrement(maxDepth);
|
||||
_.each(this.visNodeMap, function(visNode) {
|
||||
|
@ -279,6 +293,8 @@ GitVisuals.prototype.drawTreeFirstTime = function() {
|
|||
this.visBranchCollection.each(function(visBranch) {
|
||||
visBranch.genGraphics(paper);
|
||||
}, this);
|
||||
|
||||
this.refreshTree();
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue