Skip to content

Commit

Permalink
Fix #250 : shift titles if we have multiple of them
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreaubert committed Feb 20, 2024
1 parent cf75fe4 commit bc56831
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
24 changes: 19 additions & 5 deletions src/website/assets/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,19 @@ function setGraphOptions(spin, windowWidth, windowHeight, nb_graphs) {
function displayMeasurementsLimits(datas) {
let shapes = [];
const mins = showMinMaxMeasurements(datas);
let title = '';
mins.forEach((min_freq, speaker_name) => {
if (min_freq > 40) {
shapes.push({
if (title.length > 1) {
title += '<br>';
}
title += 'No data below ' + Math.round(min_freq) + 'Hz for' + speaker_name;
}
});
let i = 0;
mins.forEach((min_freq, speaker_name) => {
if (min_freq > 40) {
let shape = {
type: 'rect',
xref: 'x',
yref: 'y',
Expand All @@ -395,12 +405,16 @@ function setGraphOptions(spin, windowWidth, windowHeight, nb_graphs) {
fillcolor: '#d3d3d3',
opacity: 0.2,
line: { width: 2 },
label: {
text: 'No data below ' + Math.round(min_freq) + 'Hz for' + speaker_name,
};
if (i == 0) {
shape.label = {
text: title,
font: { size: 10, color: 'green' },
textposition: 'top center',
},
});
};
}
shapes.push(shape);
i += 1;
}
});
return shapes;
Expand Down
1 change: 0 additions & 1 deletion src/website/assets/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@
export const urlSite = '${site}' + '/';
export const metadataFilename = '${metadata_filename}';
// export const metadataFilenameChunks = 'metadata_filename_chunks';

0 comments on commit bc56831

Please sign in to comment.