Changeset - 864e4daef963
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 14 years ago 2011-07-16 12:33:40
marcin@python-works.com
improved rendering of dag (they are not trimmed anymore when number of heads exceeds 5)
3 files changed with 19 insertions and 10 deletions:
0 comments (0 inline, 0 general)
rhodecode/public/css/style.css
Show inline comments
 
@@ -1733,21 +1733,20 @@ text-align:left;
 
 
#graph {
 
overflow:hidden;
 
}
 
 
#graph_nodes {
 
width:160px;
 
float:left;
 
margin-left:-50px;
 
margin-top:5px;
 
}
 
 
#graph_content {
 
width:800px;
 
float:left;
 
 
}
 
 
#graph_content .container_header {
 
border:1px solid #CCC;
 
padding:10px;
 
}
rhodecode/public/js/graph.js
Show inline comments
 
@@ -55,16 +55,16 @@ function BranchRenderer() {
 
		blue = Math.round(blue * 255);
 
		var s = 'rgb(' + red + ', ' + green + ', ' + blue + ')';
 
		this.ctx.strokeStyle = s;
 
		this.ctx.fillStyle = s;
 
	}
 

	
 
	this.render = function(data) {
 
	this.render = function(data,pad) {
 
		var idx = 1;
 
		var rela = document.getElementById('graph');
 
		var pad = 160;
 
		var pad = pad;
 
		var scale = 22;
 
		
 
		for (var i in data) {
 
			this.scale(scale);
 
			var row = document.getElementById("chg_"+idx);
 
			var	next = document.getElementById("chg_"+idx+1);
rhodecode/templates/changelog/changelog.html
Show inline comments
 
@@ -136,27 +136,37 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
 
                        else{
 
                        	YUD.setStyle('rev_range_container','display','none');
 
                        	
 
                        }
 
                    });					
 
					
 
					function set_canvas() {
 
					function set_canvas(heads) {
 
						var c = document.getElementById('graph_nodes');
 
						var t = document.getElementById('graph_content');
 
						canvas = document.getElementById('graph_canvas');
 
						var div_h = t.clientHeight;
 
						c.style.height=div_h+'px';
 
						canvas.setAttribute('height',div_h);
 
						canvas.setAttribute('width',160);
 
						c.style.height=max_w+'px';
 
						canvas.setAttribute('width',max_w);
 
					};
 
					set_canvas();
 
					var heads = 1;
 
					var max_heads = 0;
 
					var jsdata = ${c.jsdata|n};
 
					
 
					for( var i=0;i<jsdata.length;i++){
 
					    var m = Math.max.apply(Math, jsdata[i][1]);
 
					    if (m>max_heads){
 
					        max_heads = m;
 
					    }
 
					}
 
					var max_w = Math.max(100,max_heads*25);
 
					set_canvas(max_w);
 
					
 
					var r = new BranchRenderer();
 
					r.render(jsdata);
 
					
 

	
 
					r.render(jsdata,max_w);
 
					
 
				});
 
			</script>
 
		%else:
 
			${_('There are no changes yet')}
 
		%endif  
0 comments (0 inline, 0 general)