From 8fcfee73b2b1977f1816bd7b6bd2cd53a46ea64b Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Thu, 23 Jan 2025 18:10:28 -0700 Subject: add option to select trendline type --- templates/index.html | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/index.html b/templates/index.html index 46b53e0..ca40c20 100644 --- a/templates/index.html +++ b/templates/index.html @@ -194,7 +194,29 @@
- +
+
+ + +
+
+
+ +
+
+ +
+
@@ -242,6 +264,18 @@ // add change handler for textarea and execute processData function //document.getElementById('excelData').addEventListener('change', processData); + window.onload = async() => { + document.getElementById('trendlineSelect').addEventListener('change', function () { + const trendlineType = this.value; + const orderContainer = document.getElementById('polynomialOrderContainer'); + if (trendlineType === 'polynomial') { + orderContainer.style.display = 'block'; + } else { + orderContainer.style.display = 'none'; + } + }); + } + function prepareSubmission() { const data = document.getElementById('excelData').value; @@ -271,8 +305,8 @@ function processData() { const data = document.getElementById('excelData').value; - // const rows = data.split('\n').map(row => row.split('\t')); - const rows = data.split('\n').filter(row => row.trim() !== '').map(row => row.split('\t')); + const rows = data.split('\n').map(row => row.split('\t')); + // const rows = data.split('\n').filter(row => row.trim() !== '').map(row => row.split('\t')); if (rows.length === 0) { alert('No data found'); return; -- cgit v1.2.3