mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 07:28:35 +02:00
working on origin
This commit is contained in:
parent
da53aabe13
commit
dd9f05eaa3
6 changed files with 97 additions and 30 deletions
|
@ -7030,6 +7030,14 @@ GitEngine.prototype.init = function() {
|
|||
this.commit();
|
||||
};
|
||||
|
||||
GitEngine.prototype.hasOrigin = function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
GitEngine.prototype.isOrigin = function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
GitEngine.prototype.exportTree = function() {
|
||||
// need to export all commits, their connectivity / messages, branches, and state of head.
|
||||
// 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.deferred = [];
|
||||
|
||||
// eventually have origin support here
|
||||
this.posBoundaries = {
|
||||
min: 0,
|
||||
max: 1
|
||||
};
|
||||
this.flipFraction = 0.65;
|
||||
|
||||
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() {
|
||||
var min = this.posBoundaries.min;
|
||||
var max = this.posBoundaries.max;
|
||||
var bounds = this.getPosBoundaries();
|
||||
var min = bounds.min;
|
||||
var max = bounds.max;
|
||||
return this.flipFraction * (max - min) + min;
|
||||
};
|
||||
|
||||
|
@ -15280,10 +15302,11 @@ GitVisuals.prototype.calcBranchStacks = function() {
|
|||
GitVisuals.prototype.calcWidth = function() {
|
||||
this.maxWidthRecursive(this.rootCommit);
|
||||
|
||||
var bounds = this.getPosBoundaries();
|
||||
this.assignBoundsRecursive(
|
||||
this.rootCommit,
|
||||
this.posBoundaries.min,
|
||||
this.posBoundaries.max
|
||||
bounds.min,
|
||||
bounds.max
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -22443,6 +22466,14 @@ GitEngine.prototype.init = function() {
|
|||
this.commit();
|
||||
};
|
||||
|
||||
GitEngine.prototype.hasOrigin = function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
GitEngine.prototype.isOrigin = function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
GitEngine.prototype.exportTree = function() {
|
||||
// need to export all commits, their connectivity / messages, branches, and state of head.
|
||||
// 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.deferred = [];
|
||||
|
||||
// eventually have origin support here
|
||||
this.posBoundaries = {
|
||||
min: 0,
|
||||
max: 1
|
||||
};
|
||||
this.flipFraction = 0.65;
|
||||
|
||||
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() {
|
||||
var min = this.posBoundaries.min;
|
||||
var max = this.posBoundaries.max;
|
||||
var bounds = this.getPosBoundaries();
|
||||
var min = bounds.min;
|
||||
var max = bounds.max;
|
||||
return this.flipFraction * (max - min) + min;
|
||||
};
|
||||
|
||||
|
@ -31143,10 +31188,11 @@ GitVisuals.prototype.calcBranchStacks = function() {
|
|||
GitVisuals.prototype.calcWidth = function() {
|
||||
this.maxWidthRecursive(this.rootCommit);
|
||||
|
||||
var bounds = this.getPosBoundaries();
|
||||
this.assignBoundsRecursive(
|
||||
this.rootCommit,
|
||||
this.posBoundaries.min,
|
||||
this.posBoundaries.max
|
||||
bounds.min,
|
||||
bounds.max
|
||||
);
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
1
build/bundle.min.js
vendored
1
build/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -426,7 +426,7 @@
|
|||
For a much easier time perusing the source, see the individual files at:
|
||||
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 downside? No raw logs to parse for analytics, so I have to include
|
||||
|
|
|
@ -68,6 +68,14 @@ GitEngine.prototype.init = function() {
|
|||
this.commit();
|
||||
};
|
||||
|
||||
GitEngine.prototype.hasOrigin = function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
GitEngine.prototype.isOrigin = function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
GitEngine.prototype.exportTree = function() {
|
||||
// need to export all commits, their connectivity / messages, branches, and state of head.
|
||||
// this would be simple if didn't have circular structures.... :P
|
||||
|
|
|
@ -38,11 +38,6 @@ function GitVisuals(options) {
|
|||
this.branchCollection.on('remove', this.removeBranch, this);
|
||||
this.deferred = [];
|
||||
|
||||
// eventually have origin support here
|
||||
this.posBoundaries = {
|
||||
min: 0,
|
||||
max: 1
|
||||
};
|
||||
this.flipFraction = 0.65;
|
||||
|
||||
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() {
|
||||
var min = this.posBoundaries.min;
|
||||
var max = this.posBoundaries.max;
|
||||
var bounds = this.getPosBoundaries();
|
||||
var min = bounds.min;
|
||||
var max = bounds.max;
|
||||
return this.flipFraction * (max - min) + min;
|
||||
};
|
||||
|
||||
|
@ -472,10 +486,11 @@ GitVisuals.prototype.calcBranchStacks = function() {
|
|||
GitVisuals.prototype.calcWidth = function() {
|
||||
this.maxWidthRecursive(this.rootCommit);
|
||||
|
||||
var bounds = this.getPosBoundaries();
|
||||
this.assignBoundsRecursive(
|
||||
this.rootCommit,
|
||||
this.posBoundaries.min,
|
||||
this.posBoundaries.max
|
||||
bounds.min,
|
||||
bounds.max
|
||||
);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue