Skip to content

Commit c27182a

Browse files
committed
fix: set default chart size to small
1 parent af2c8cd commit c27182a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ app.get('/history/charts/:country/:chartSize(sm|md|lg)?', async (req, res, next)
134134
const userAgent = req.headers['user-agent'],
135135
countryData = req.params.country,
136136
chartType = req.params.chartType || 'cases',
137-
chartSize = req.params.chartSize || 'md',
137+
chartSize = req.params.chartSize || 'sm',
138138
summary = await axios.get(`${apiBaseURL}/countries/${countryData}`),
139139
history = await axios.get(`${apiBaseURL}/v2/historical/${summary.data.country}?lastdays=all`),
140140
s = summary.data,

lib/cli/gfx/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const patchBlessed = () => {
3838

3939
patchBlessed();
4040

41-
exports.historyCountryTracker = (req, res, n, c, tC, d, tD, r, a, cl, cPOM, u, h, chartType, countryInfo, chartSize = 'md') => {
41+
exports.historyCountryTracker = (req, res, n, c, tC, d, tD, r, a, cl, cPOM, u, h, chartType, countryInfo, chartSize = 'sm') => {
4242
const name = n, cases = c, todayCases = tC,
4343
deaths = d, todayDeaths = tD, recovered = r,
4444
active = a, critical = cl, casesPerOneMillion = cPOM,
@@ -53,7 +53,7 @@ exports.historyCountryTracker = (req, res, n, c, tC, d, tD, r, a, cl, cPOM, u, h
5353
defaultHeader = header+br+tagline,
5454
footer = (n.toLowerCase() == 'philippines') ? tableFooter+br+specialfooter+br+source+br+repo : tableFooter+br+defaultfooter+br+source+br+repo,
5555
allowedDefaultChartSize = ['sm', 'md', 'lg'],
56-
defaultChartStyle = require(`../gfx/layout/${allowedDefaultChartSize.indexOf(chartSize) != -1 ? chartSize: allowedDefaultChartSize[1] }.json`);
56+
defaultChartStyle = require(`../gfx/layout/${allowedDefaultChartSize.indexOf(chartSize) != -1 ? chartSize: allowedDefaultChartSize[0] }.json`);
5757

5858
// load template with data
5959
// serverUtil.loadTemplate(template, {jsonStyle}, {jsonData}, callback)

0 commit comments

Comments
 (0)