Updated ExtendedGitGraph version
This commit is contained in:
parent
315f37c826
commit
7a7437e6d3
@ -14,6 +14,8 @@ class ExtendedGitGraph {
|
||||
|
||||
const PROGRESS_SESSION_COOKIE = 'ajax_progress_egh_refresh';
|
||||
|
||||
const COMMITCOUNT_COLOR_UPPERLIMIT = 16;
|
||||
|
||||
private $username;
|
||||
private $token;
|
||||
private $tokenHeader;
|
||||
@ -243,7 +245,7 @@ class ExtendedGitGraph {
|
||||
public function generate($year) {
|
||||
$ymap = $this->generateYearMap($year); // unused on purpose (template.php needs it)
|
||||
|
||||
$ymapmax = $this->getMaxCommitCount(); // unused on purpose (template.php needs it)
|
||||
$ymapmax = min($this->getMaxCommitCount(), self::COMMITCOUNT_COLOR_UPPERLIMIT); // unused on purpose (template.php needs it)
|
||||
|
||||
ob_start();
|
||||
include('template.php');
|
||||
|
@ -49,7 +49,7 @@ $monthlist = array_fill(0, 12, [0, 0]);
|
||||
}
|
||||
|
||||
$c_count = $ymap[$date->format('Y-m-d')];
|
||||
$color_idx = ceil(pow($c_count/$ymapmax, $exponent) * (count($COLORS)-1));
|
||||
$color_idx = min((count($COLORS)-1), ceil(pow($c_count/$ymapmax, $exponent) * (count($COLORS)-1)));
|
||||
$color = $COLORS[$color_idx];
|
||||
|
||||
$wday = ($date->format('N') - 1);
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user