Archaeological Stratigraphy Diagrammer

Archaeological Stratigraphy Diagrammer

Define layers, visualize composition, and log associated finds and contexts.

1. Site & Trench Details

2. Stratum Definition (Add Top to Bottom)

Stratigraphic Column List:

No layers defined.

'; return; } let previousDepth = 0; strata.forEach(s => { const depthRange = `${previousDepth.toFixed(2)}m - ${s.depth.toFixed(2)}m`; const heightFactor = (s.depth - previousDepth) * 100; // Visual scaling factor // a. Visualization Layer const layer = document.createElement('div'); layer.className = 'asdt-stratum'; layer.style.setProperty('--stratum-color', s.color); layer.style.minHeight = Math.max(heightFactor, 50) + 'px'; // Ensure visibility layer.innerHTML = ` ${s.contextId} ${escapeHtml(s.description)} `; vizDiv.appendChild(layer); // b. Log Table Row const tr = document.createElement('tr'); tr.innerHTML = ` ${s.contextId} ${depthRange}   ${escapeHtml(s.description.split('(')[0].trim())} ${escapeHtml(s.finds || 'N/A')} `; logTbody.appendChild(tr); previousDepth = s.depth; }); vizDiv.innerHTML += `

STERILE SUBSOIL

`; }; // --- PDF Download --- window.asdtDownloadPDF = function() { // Ensure preview is up to date asdtUpdatePreview(); const element = document.getElementById('asdt-print-area'); const siteId = document.getElementById('asdt-site-id').value.split('/')[0].trim() || "Stratigraphy_Report"; document.body.classList.add('asdt-generating-pdf'); const opt = { margin: [0.75, 0.75], filename: `${siteId.replace(/\s+/g, '_')}_Stratigraphy_Report.pdf`, image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2, useCORS: true }, jsPDF: { unit: 'in', format: 'letter', orientation: 'landscape' } }; html2pdf().set(opt).from(element).save().then(() => { document.body.classList.remove('asdt-generating-pdf'); }); }; // Utility: HTML Escape function escapeHtml(text) { if (!text) return ''; return text.replace(/[&<>"']/g, function(m) { switch (m) { case '&': return '&'; case '<': return '<'; case '>': return '>'; case '"': return '"'; case "'": return '''; default: return m; } }); }
Scroll to Top