From ffa95ed18c63d2bf75700109ea56ddb4afdbc282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Delacotte?= Date: Thu, 8 May 2025 20:27:46 +0200 Subject: [PATCH] =?UTF-8?q?M=C3=A9nage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/static/js/functions.js | 98 +++++--------------------------------- src/templates/index.html | 15 +----- 2 files changed, 13 insertions(+), 100 deletions(-) diff --git a/src/static/js/functions.js b/src/static/js/functions.js index de82351..2ac6127 100644 --- a/src/static/js/functions.js +++ b/src/static/js/functions.js @@ -34,8 +34,6 @@ function loadJson(filename) { } }); -// renderChart(data, '', true) - } else { const div = document.createElement('div'); div.innerHTML = `
${JSON.stringify(data, null, 2)}
`; @@ -66,32 +64,6 @@ function jsonToUl(json) { return ul; } -//function jsonToTable(obj, depth = 0) { -// const table = document.createElement('table'); -// table.border = 1; -// -// for (const key in obj) { -// const row = document.createElement('tr'); -// -// const cellKey = document.createElement('td'); -// cellKey.textContent = key; -// row.appendChild(cellKey); -// -// const cellValue = document.createElement('td'); -// const value = obj[key]; -// -// if (typeof value === 'object' && value !== null && depth < 4) { -// cellValue.appendChild(jsonToTable(value, depth + 1)); // recurse -// } else { -// cellValue.textContent = value; -// } -// -// row.appendChild(cellValue); -// table.appendChild(row); -// } -// -// return table; -//} function jsonToTable(data, depth = 0) { if (Array.isArray(data)) { @@ -168,8 +140,6 @@ function jsonToTable(data, depth = 0) { } } - - function addTab(name, index, content) { const tabButtons = document.getElementById('tab-buttons'); const tabContents = document.getElementById('tab-contents'); @@ -237,13 +207,6 @@ function graph() { function renderChart(data, filename, create_columns) { - // Table -// const table = document.getElementById('data-table'); -// if (data.length > 0) { -// let header = '' + Object.keys(data[0]).map(k => `${k}`).join('') + ''; -// let rows = data.map(row => '' + Object.values(row).map(v => `${v}`).join('') + ''); -// table.innerHTML = header + rows.join(''); -// } let signals = JSON.parse(sessionStorage.getItem("signals")); let exited = JSON.parse(sessionStorage.getItem("exited")); let market = JSON.parse(sessionStorage.getItem("market")); @@ -255,7 +218,6 @@ function renderChart(data, filename, create_columns) { const cols = Object.keys(data[0]) if (create_columns === true) { -// string = "" string = "