mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 17:27:22 +02:00
BIG graphics update
This commit is contained in:
parent
d16b8b61d3
commit
cc65ae7491
4 changed files with 101 additions and 18 deletions
|
@ -65,6 +65,7 @@ GitVisuals.prototype.toScreenCoords = function(pos) {
|
|||
GitVisuals.prototype.refreshTree = function() {
|
||||
this.calculateTreeCoords();
|
||||
this.animateNodePositions();
|
||||
this.animateEdges();
|
||||
};
|
||||
|
||||
GitVisuals.prototype.calculateTreeCoords = function() {
|
||||
|
@ -99,6 +100,8 @@ GitVisuals.prototype.assignBoundsRecursive = function(commit, min, max) {
|
|||
// I always center myself within my bounds
|
||||
var myWidthPos = (min + max) / 2.0;
|
||||
commit.get('visNode').get('pos').x = myWidthPos;
|
||||
// TODO get rid of
|
||||
// commit.get('visNode').get('pos').x = Math.random();
|
||||
|
||||
if (commit.get('children').length == 0) {
|
||||
return;
|
||||
|
@ -137,6 +140,23 @@ GitVisuals.prototype.calcDepth = function() {
|
|||
}, this);
|
||||
};
|
||||
|
||||
/***************************************
|
||||
== END Tree Calculation ==
|
||||
_ __ __ _
|
||||
\\/ / \ \//_
|
||||
\ \ / __| __
|
||||
\ \___/ /_____/ /
|
||||
| _______ \
|
||||
\ ( ) / \_\
|
||||
\ /
|
||||
| |
|
||||
| |
|
||||
____+-_=+-^ ^+-=_=__________
|
||||
|
||||
^^ I drew that :D
|
||||
|
||||
**************************************/
|
||||
|
||||
GitVisuals.prototype.animateNodePositions = function() {
|
||||
_.each(this.visNodeMap, function(visNode) {
|
||||
console.log(visNode);
|
||||
|
@ -144,6 +164,12 @@ GitVisuals.prototype.animateNodePositions = function() {
|
|||
}, this);
|
||||
};
|
||||
|
||||
GitVisuals.prototype.animateEdges = function() {
|
||||
this.edgeCollection.each(function(edge) {
|
||||
edge.animateUpdatedPath();
|
||||
}, this);
|
||||
};
|
||||
|
||||
GitVisuals.prototype.getDepthIncrement = function(maxDepth) {
|
||||
// assume there are at least 7 layers until later
|
||||
maxDepth = Math.max(maxDepth, 7);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue