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