Skip to content

Commit

Permalink
Fix report rendering when executor comparison inline plot only has on…
Browse files Browse the repository at this point in the history
…e data series (#192)
  • Loading branch information
smarr authored Mar 24, 2024
2 parents 1d6a399 + 9d0f3c7 commit 289387b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"compile": "tsc",
"postcompile": "npm run prep-static && npm run download-font",
"prep-static": "cp dist/src/frontend/*.js dist/src/shared/*.js ./resources/",
"download-font": "node dist/src/download.js https://github.com/googlefonts/roboto/releases/download/v2.136/roboto-hinted.zip tmp/roboto-hinted.zip && unzip -o -d dist tmp/roboto-hinted.zip",
"download-font": "if ! [ -f dist/roboto-hinted/Roboto-Black.ttf ]; then node dist/src/download.js https://github.com/googlefonts/roboto/releases/download/v2.136/roboto-hinted.zip tmp/roboto-hinted.zip && unzip -o -d dist tmp/roboto-hinted.zip; fi",
"start": "node --enable-source-maps --experimental-json-modules ./dist/src/index.js",
"nodemon": "DEV=true nodemon --enable-source-maps --experimental-json-modules ./dist/src/index.js --watch ./dist/src --watch ./package.json --watch ./src --ext js,json,html",
"format": "prettier --config .prettierrc '{src,tests}/**/*.ts' --write",
Expand Down
4 changes: 2 additions & 2 deletions src/backend/compare/charts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ function toDataSetWithBaseChangeBackground(data: ChangeData): any[] {
}

function toDataSetWithExeColors(data: ChangeData, exeColors: string[]): any[] {
if (data.labels.length < 2) {
if (data.labels.length < 1) {
throw new Error(
'Expect at least two data series, but only got ' + data.labels.length
'Expect at least one data series, but only got ' + data.labels.length
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/backend/compare/html/gen-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{%- include('header.html') %}

{% if (it.generatingReport) { %}
<meta http-equiv="refresh" content="30" />
<meta http-equiv="refresh" content="5" />
{% } %}
</head>
<body class="compare timeline-multi">
Expand Down
2 changes: 1 addition & 1 deletion src/backend/compare/prep-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ export async function calculateAcrossExesStatsForBenchmark(
row.exeStats[j].criteria[criterion] = stats[j];
}

if (criterion === siteConfig.inlinePlotCriterion) {
if (criterion === siteConfig.inlinePlotCriterion && exesArr.length >= 1) {
lastPlotId += 1;
row.inlinePlot = await createExeInlinePlot(
exesArr,
Expand Down

0 comments on commit 289387b

Please sign in to comment.