Skip to content

Commit

Permalink
really fixed margins
Browse files Browse the repository at this point in the history
  • Loading branch information
akeaswaran committed Sep 13, 2024
1 parent cec6dfb commit a9e94e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion frontend/cfb/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,12 @@ function retrieveValue(dictionary, key) {
return sub;
}

router.route('/year/:year/epa')
router.route('/charts/team/epa')
.get(async function(req, res, next) {
return res.redirect(`/year/2024/charts/team/epa`)
})

router.route('/year/:year/charts/team/epa')
.get(async function(req, res, next) {
try {
const baseData = await retrieveLeagueData(req.params.year, "overall")
Expand Down
6 changes: 3 additions & 3 deletions frontend/public/assets/js/epa_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function generateConfig(title, teams) {
}

const margin = 0.075
const baseMultiplier = 0.5
const baseMultiplier = 0.475
const lineMultiplier = 0.125
const xAdjust = 0.06

Expand Down Expand Up @@ -188,7 +188,7 @@ function generateConfig(title, teams) {
chart.ctx.globalAlpha = 0.5;
chart.ctx.fillStyle = window.matchMedia('(prefers-color-scheme: dark)').matches ? '#e8e6e3' : '#525252';
chart.ctx.fillText("Good Offense, Good Defense", sizeWidth * (1 - margin + xAdjust), sizeHeight * margin)
chart.ctx.fillText("Good Offense, Bad Defense", sizeWidth * (1 - margin + xAdjust), sizeHeight * (1 - margin - 0.01))
chart.ctx.fillText("Good Offense, Bad Defense", sizeWidth * (1 - margin + xAdjust), sizeHeight * (1 - margin - 0.005))
chart.ctx.restore();

chart.ctx.save()
Expand All @@ -197,7 +197,7 @@ function generateConfig(title, teams) {
chart.ctx.globalAlpha = 0.5;
chart.ctx.fillStyle = window.matchMedia('(prefers-color-scheme: dark)').matches ? '#e8e6e3' : '#525252';
chart.ctx.fillText("Bad Offense, Good Defense", sizeWidth * (margin - 0.02), sizeHeight * margin)
chart.ctx.fillText("Bad Offense, Bad Defense", sizeWidth * (margin - 0.02), sizeHeight * (1 - margin - 0.01))
chart.ctx.fillText("Bad Offense, Bad Defense", sizeWidth * (margin - 0.02), sizeHeight * (1 - margin - 0.005))
chart.ctx.restore();
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/views/partials/nav-header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</a>
<ul class="dropdown-menu">
<h6 class="dropdown-header">Team Level</h6>
<li><a class="dropdown-item" href="/cfb/teams/epa">Adj EPA/Play</a></li>
<li><a class="dropdown-item" href="/charts/team/epa">Adj EPA/Play</a></li>
</ul>
</li>
<li class="nav-item dropdown">
Expand Down

0 comments on commit a9e94e5

Please sign in to comment.