Fix stargazers display (#58)

This commit is contained in:
Simon Lecoq
2021-01-12 22:03:50 +01:00
committed by GitHub
parent aa7ffb1043
commit 9632f5faf6
4 changed files with 8 additions and 8 deletions

View File

@@ -14,9 +14,9 @@
<section class="column chart">
<h3>Total stargazers</h3>
<div class="chart-bars">
<% { let previous = null; for (const [date, value] of Object.entries(plugins.stargazers.total.dates)) { const p = 0.05+0.95*(value-plugins.stargazers.total.min)/(plugins.stargazers.total.max-plugins.stargazers.total.min); const [y, m, d] = date.split("-").map(Number) %>
<% { let previous = null; for (const [date, {value, text}] of Object.entries(plugins.stargazers.total.dates)) { const p = 0.05+0.95*(value-plugins.stargazers.total.min)/(plugins.stargazers.total.max-plugins.stargazers.total.min); const [y, m, d] = date.split("-").map(Number) %>
<div class="entry">
<span class="value"><%= (value-(previous ?? 0)) ? value : "" %></span>
<span class="value"><%= (value-(previous ?? 0)) ? text : "" %></span>
<div class="bar" style="height: <%= p*50 %>px; background-color: var(--color-calendar-graph-day-L<%= Math.ceil(p/0.25) %>-bg)"></div>
<%= d %>
<% if ((previous === null)||(d === 1)) { %>
@@ -29,9 +29,9 @@
<section class="column chart">
<h3>New stargazers per day</h3>
<div class="chart-bars">
<% { let previous = null; for (const [date, value] of Object.entries(plugins.stargazers.increments.dates)) { const p = value/plugins.stargazers.increments.max; const [y, m, d] = date.split("-").map(Number) %>
<% { let previous = null; for (const [date, {value, text}] of Object.entries(plugins.stargazers.increments.dates)) { const p = value/plugins.stargazers.increments.max; const [y, m, d] = date.split("-").map(Number) %>
<div class="entry">
<span class="value"><%= value != 0 ? value : "" %></span>
<span class="value"><%= value != 0 ? text : "" %></span>
<div class="bar" style="height: <%= p*50 %>px; background-color: var(--color-calendar-graph-day-L<%= Math.ceil(p/0.25) %>-bg)"></div>
<%= d %>
<% if ((previous === null)||(d === 1)) { %>

View File

@@ -343,7 +343,7 @@
}
.chart-bars .entry .value {
font-size: 9px;
font-size: 7px;
}
.chart-bars .bar {