working on origin

This commit is contained in:
Peter Cottle 2013-05-13 10:01:41 -07:00
parent da53aabe13
commit dd9f05eaa3
6 changed files with 97 additions and 30 deletions

View file

@ -7030,6 +7030,14 @@ GitEngine.prototype.init = function() {
this.commit(); this.commit();
}; };
GitEngine.prototype.hasOrigin = function() {
return false;
};
GitEngine.prototype.isOrigin = function() {
return false;
};
GitEngine.prototype.exportTree = function() { GitEngine.prototype.exportTree = function() {
// need to export all commits, their connectivity / messages, branches, and state of head. // need to export all commits, their connectivity / messages, branches, and state of head.
// this would be simple if didn't have circular structures.... :P // this would be simple if didn't have circular structures.... :P
@ -14846,11 +14854,6 @@ function GitVisuals(options) {
this.branchCollection.on('remove', this.removeBranch, this); this.branchCollection.on('remove', this.removeBranch, this);
this.deferred = []; this.deferred = [];
// eventually have origin support here
this.posBoundaries = {
min: 0,
max: 1
};
this.flipFraction = 0.65; this.flipFraction = 0.65;
var Main = require('../app'); var Main = require('../app');
@ -14924,9 +14927,28 @@ GitVisuals.prototype.getScreenPadding = function() {
}; };
}; };
GitVisuals.prototype.getPosBoundaries = function() {
if (this.gitEngine.hasOrigin()) {
return {
min: 0,
max: 0.5
};
} else if (this.gitEngine.isOrigin()) {
return {
min: 0.5,
max: 1
};
}
return {
min: 0,
max: 1
};
};
GitVisuals.prototype.getFlipPos = function() { GitVisuals.prototype.getFlipPos = function() {
var min = this.posBoundaries.min; var bounds = this.getPosBoundaries();
var max = this.posBoundaries.max; var min = bounds.min;
var max = bounds.max;
return this.flipFraction * (max - min) + min; return this.flipFraction * (max - min) + min;
}; };
@ -15280,10 +15302,11 @@ GitVisuals.prototype.calcBranchStacks = function() {
GitVisuals.prototype.calcWidth = function() { GitVisuals.prototype.calcWidth = function() {
this.maxWidthRecursive(this.rootCommit); this.maxWidthRecursive(this.rootCommit);
var bounds = this.getPosBoundaries();
this.assignBoundsRecursive( this.assignBoundsRecursive(
this.rootCommit, this.rootCommit,
this.posBoundaries.min, bounds.min,
this.posBoundaries.max bounds.max
); );
}; };
@ -22443,6 +22466,14 @@ GitEngine.prototype.init = function() {
this.commit(); this.commit();
}; };
GitEngine.prototype.hasOrigin = function() {
return false;
};
GitEngine.prototype.isOrigin = function() {
return false;
};
GitEngine.prototype.exportTree = function() { GitEngine.prototype.exportTree = function() {
// need to export all commits, their connectivity / messages, branches, and state of head. // need to export all commits, their connectivity / messages, branches, and state of head.
// this would be simple if didn't have circular structures.... :P // this would be simple if didn't have circular structures.... :P
@ -30709,11 +30740,6 @@ function GitVisuals(options) {
this.branchCollection.on('remove', this.removeBranch, this); this.branchCollection.on('remove', this.removeBranch, this);
this.deferred = []; this.deferred = [];
// eventually have origin support here
this.posBoundaries = {
min: 0,
max: 1
};
this.flipFraction = 0.65; this.flipFraction = 0.65;
var Main = require('../app'); var Main = require('../app');
@ -30787,9 +30813,28 @@ GitVisuals.prototype.getScreenPadding = function() {
}; };
}; };
GitVisuals.prototype.getPosBoundaries = function() {
if (this.gitEngine.hasOrigin()) {
return {
min: 0,
max: 0.5
};
} else if (this.gitEngine.isOrigin()) {
return {
min: 0.5,
max: 1
};
}
return {
min: 0,
max: 1
};
};
GitVisuals.prototype.getFlipPos = function() { GitVisuals.prototype.getFlipPos = function() {
var min = this.posBoundaries.min; var bounds = this.getPosBoundaries();
var max = this.posBoundaries.max; var min = bounds.min;
var max = bounds.max;
return this.flipFraction * (max - min) + min; return this.flipFraction * (max - min) + min;
}; };
@ -31143,10 +31188,11 @@ GitVisuals.prototype.calcBranchStacks = function() {
GitVisuals.prototype.calcWidth = function() { GitVisuals.prototype.calcWidth = function() {
this.maxWidthRecursive(this.rootCommit); this.maxWidthRecursive(this.rootCommit);
var bounds = this.getPosBoundaries();
this.assignBoundsRecursive( this.assignBoundsRecursive(
this.rootCommit, this.rootCommit,
this.posBoundaries.min, bounds.min,
this.posBoundaries.max bounds.max
); );
}; };

File diff suppressed because one or more lines are too long

1
build/bundle.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -426,7 +426,7 @@
For a much easier time perusing the source, see the individual files at: For a much easier time perusing the source, see the individual files at:
https://github.com/pcottle/learnGitBranching https://github.com/pcottle/learnGitBranching
--> -->
<script src="build/bundle.min.689c25b5.js"></script> <script src="build/bundle.js"></script>
<!-- The advantage of github pages: super-easy, simple, slick static hostic. <!-- The advantage of github pages: super-easy, simple, slick static hostic.
The downside? No raw logs to parse for analytics, so I have to include The downside? No raw logs to parse for analytics, so I have to include

View file

@ -68,6 +68,14 @@ GitEngine.prototype.init = function() {
this.commit(); this.commit();
}; };
GitEngine.prototype.hasOrigin = function() {
return false;
};
GitEngine.prototype.isOrigin = function() {
return false;
};
GitEngine.prototype.exportTree = function() { GitEngine.prototype.exportTree = function() {
// need to export all commits, their connectivity / messages, branches, and state of head. // need to export all commits, their connectivity / messages, branches, and state of head.
// this would be simple if didn't have circular structures.... :P // this would be simple if didn't have circular structures.... :P

View file

@ -38,11 +38,6 @@ function GitVisuals(options) {
this.branchCollection.on('remove', this.removeBranch, this); this.branchCollection.on('remove', this.removeBranch, this);
this.deferred = []; this.deferred = [];
// eventually have origin support here
this.posBoundaries = {
min: 0,
max: 1
};
this.flipFraction = 0.65; this.flipFraction = 0.65;
var Main = require('../app'); var Main = require('../app');
@ -116,9 +111,28 @@ GitVisuals.prototype.getScreenPadding = function() {
}; };
}; };
GitVisuals.prototype.getPosBoundaries = function() {
if (this.gitEngine.hasOrigin()) {
return {
min: 0,
max: 0.5
};
} else if (this.gitEngine.isOrigin()) {
return {
min: 0.5,
max: 1
};
}
return {
min: 0,
max: 1
};
};
GitVisuals.prototype.getFlipPos = function() { GitVisuals.prototype.getFlipPos = function() {
var min = this.posBoundaries.min; var bounds = this.getPosBoundaries();
var max = this.posBoundaries.max; var min = bounds.min;
var max = bounds.max;
return this.flipFraction * (max - min) + min; return this.flipFraction * (max - min) + min;
}; };
@ -472,10 +486,11 @@ GitVisuals.prototype.calcBranchStacks = function() {
GitVisuals.prototype.calcWidth = function() { GitVisuals.prototype.calcWidth = function() {
this.maxWidthRecursive(this.rootCommit); this.maxWidthRecursive(this.rootCommit);
var bounds = this.getPosBoundaries();
this.assignBoundsRecursive( this.assignBoundsRecursive(
this.rootCommit, this.rootCommit,
this.posBoundaries.min, bounds.min,
this.posBoundaries.max bounds.max
); );
}; };