Upsize graphs

This commit is contained in:
Wilson Lin 2020-01-12 20:32:37 +11:00
parent 80d619eeac
commit d5ecc020f3
4 changed files with 5 additions and 2 deletions

View File

@ -19,7 +19,7 @@ Speed and effectiveness of Node.js version compared to [html-minfier](https://gi
Used average of results from running on [common web pages](./bench/tests). See [bench](./bench) folder for more details. Used average of results from running on [common web pages](./bench/tests). See [bench](./bench) folder for more details.
![Chart showing speed of HTML minifiers](./bench/speed.png) ![Chart showing effectiveness of HTML minifiers](./bench/minification.png) <img width="435" alt="Chart showing speed of HTML minifiers" src="./bench/speed.png"> <img width="435" alt="Chart showing effectiveness of HTML minifiers" src="./bench/minification.png">
## Usage ## Usage

View File

@ -18,6 +18,7 @@ const chartOptions = (title, displayLegend, yTick = t => t) => ({
display: true, display: true,
text: title, text: title,
fontColor: '#333', fontColor: '#333',
fontSize: 24,
}, },
scales: { scales: {
xAxes: [{ xAxes: [{
@ -27,6 +28,7 @@ const chartOptions = (title, displayLegend, yTick = t => t) => ({
}, },
ticks: { ticks: {
fontColor: '#666', fontColor: '#666',
fontSize: 20,
}, },
}], }],
yAxes: [{ yAxes: [{
@ -38,6 +40,7 @@ const chartOptions = (title, displayLegend, yTick = t => t) => ({
max: 1, max: 1,
callback: yTick, callback: yTick,
fontColor: '#666', fontColor: '#666',
fontSize: 20,
}, },
}], }],
}, },
@ -52,7 +55,7 @@ const chartOptions = (title, displayLegend, yTick = t => t) => ({
}); });
const renderChart = async (file, cfg) => { const renderChart = async (file, cfg) => {
const chart = new chartjs(435, 320); const chart = new chartjs(900, 650);
await chart.drawChart(cfg); await chart.drawChart(cfg);
await chart.writeImageToFile('image/png', path.join(__dirname, `${file}.png`)); await chart.writeImageToFile('image/png', path.join(__dirname, `${file}.png`));
}; };

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 32 KiB