diff --git a/src/renderers/InfluenceConditionsRenderer.js b/src/renderers/InfluenceConditionsRenderer.js index a01dd8e2f41ccef8eb8d0ba6f988e2717cab3d00..0ba0f2477c96b5cbb9fd5ac60b79de1be61bc8a3 100644 --- a/src/renderers/InfluenceConditionsRenderer.js +++ b/src/renderers/InfluenceConditionsRenderer.js @@ -36,7 +36,7 @@ export class InfluenceConditionsRenderer { const valueStr = this._formatQuantity(qty, true); summaryText += ` : ${valueStr}`; } - // Use innerHTML here so that any HTML markup in the unit is rendered + // Use innerHTML so that HTML markup in the unit is rendered summary.innerHTML = summaryText; details.appendChild(summary); @@ -57,9 +57,9 @@ export class InfluenceConditionsRenderer { table.style.width = '100%'; table.style.borderCollapse = 'collapse'; - // Header row for the table + // Header row for the table (removed "Additional Info" column) const headerRow = document.createElement('tr'); - ['Quantity', 'Value', 'Description', 'Additional Info'].forEach(text => { + ['Quantity', 'Value', 'Description'].forEach(text => { const th = document.createElement('th'); th.textContent = text; th.style.border = '1px solid #ccc'; @@ -85,7 +85,7 @@ export class InfluenceConditionsRenderer { valueCell.style.padding = '4px'; const formattedValue = this._formatQuantity(q, false); valueCell.innerHTML = formattedValue; - // If additional (non-standard) data exists, attach a tooltip + // Attach tooltip for additional data if present const additional = this._getAdditionalData(q); if (Object.keys(additional).length > 0) { const infoSpan = document.createElement('span'); @@ -104,13 +104,6 @@ export class InfluenceConditionsRenderer { descCell.textContent = this._getText(q['dcc:description']); row.appendChild(descCell); - // Column 4: Additional info (if any) - const additionalCell = document.createElement('td'); - additionalCell.style.border = '1px solid #ccc'; - additionalCell.style.padding = '4px'; - additionalCell.textContent = Object.keys(additional).length > 0 ? JSON.stringify(additional) : ''; - row.appendChild(additionalCell); - table.appendChild(row); }); contentDiv.appendChild(table); @@ -143,8 +136,12 @@ export class InfluenceConditionsRenderer { return quantities; } - // Helper: format a quantity's value. - // If plain is true, render unit as plain text; otherwise use HTML from DSIUnit. + /** + * Helper: Format a quantity's value. + * @param {Object} quantity - The quantity node. + * @param {boolean} plain - If true, render unit as plain text; otherwise use HTML from DSIUnit. + * @returns {string} + */ _formatQuantity(quantity, plain = false) { // Handle noQuantity (categorical data) if (quantity['dcc:noQuantity']) { @@ -163,7 +160,7 @@ export class InfluenceConditionsRenderer { if (real['si:unit']) { const rawUnit = real['si:unit'].trim(); const unitObj = new DSIUnit(rawUnit); - unit = plain ? unitObj.toHTML() : unitObj.toHTML({ oneLine: true }); + unit = plain ? unitObj.toHTML() : unitObj.toHTML({ oneLine: true }); } let uncertainty = ''; if (real['si:measurementUncertaintyUnivariate'] &&