Skip to content
Snippets Groups Projects
Commit 2863d45a authored by Benedikt's avatar Benedikt
Browse files

fixed conformity color coding in table

parent 2a40bdf9
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,6 @@ const conformityColors = {
nofail: '#9e9e9e'
};
// Render all measurement results in a tabbed layout
export function renderMeasurementResults(measurementResults, language) {
console.debug('renderMeasurementResults called with:', measurementResults);
const container = document.getElementById('measurementResults');
......@@ -459,7 +458,7 @@ export function renderSingleMeasurementResult(resultObj, language, tabPanel) {
margin: { t: 20, b: 40 }
};
Plotly.newPlot(graphDiv, allTraces, layout).then(() => {
// Force a resize after a short delay to ensure full width
// Force a resize to ensure full width
setTimeout(() => { Plotly.Plots.resize(graphDiv); }, 100);
const caption = document.createElement('div');
caption.innerHTML = '<b>' + group[0].name + '</b>';
......@@ -501,8 +500,11 @@ export function renderSingleMeasurementResult(resultObj, language, tabPanel) {
}
} else {
cell.textContent = cellData;
if (tableData[0][cellIndex] && tableData[0][cellIndex].toLowerCase().includes('conformity') && conformityMapping[cellIndex] !== undefined) {
cell.style.backgroundColor = conformityMapping[cellIndex];
if (tableData[0][cellIndex] && tableData[0][cellIndex].toLowerCase().includes('conformity')) {
const confKey = cellData.trim().toLowerCase();
if (conformityColors[confKey]) {
cell.style.backgroundColor = conformityColors[confKey];
}
}
}
cell.style.padding = '4px';
......@@ -520,9 +522,10 @@ export function renderSingleMeasurementResult(resultObj, language, tabPanel) {
let mapping = {};
let col = 1; // Column 0 is X-Axis.
for (let i = 0; i < dataHeaders.length; i++) {
col++; // value column.
mapping[col] = palette[i % palette.length]; // Color the data header column
col++;
if (extraInfo[i] && extraInfo[i].conformity) {
mapping[col] = palette[i % palette.length];
mapping[col] = palette[i % palette.length]; // Color the conformity header column
col++;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment