Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diffusion/behavior-commit-graph.js
Show All 38 Lines | JX.behavior('diffusion-commit-graph', function(config) { | ||||
function fstroke(c) { | function fstroke(c) { | ||||
cxt.lineWidth = 1; | cxt.lineWidth = 1; | ||||
cxt.fillStyle = color(c); | cxt.fillStyle = color(c); | ||||
cxt.strokeStyle = '#ffffff'; | cxt.strokeStyle = '#ffffff'; | ||||
cxt.fill(); | cxt.fill(); | ||||
cxt.stroke(); | cxt.stroke(); | ||||
} | } | ||||
// If the graph is going to be wide, squish it a bit so it doesn't take up | |||||
// quite as much space. | |||||
var default_width; | |||||
if (config.count >= 8) { | |||||
default_width = 6; | |||||
} else { | |||||
default_width = 12; | |||||
} | |||||
for (var ii = 0; ii < nodes.length; ii++) { | for (var ii = 0; ii < nodes.length; ii++) { | ||||
var data = JX.Stratcom.getData(nodes[ii]); | var data = JX.Stratcom.getData(nodes[ii]); | ||||
var cell = 12; // Width of each thread. | var cell = default_width; | ||||
var xpos = function(col) { | var xpos = function(col) { | ||||
return (col * cell) + (cell / 2); | return (col * cell) + (cell / 2); | ||||
}; | }; | ||||
var h = 34; | var h = 34; | ||||
var w = cell * config.count; | var w = cell * config.count; | ||||
var canvas = JX.$N('canvas', {width: w, height: h}); | var canvas = JX.$N('canvas', {width: w, height: h}); | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |