|
|
|
@ -51,7 +51,7 @@ for (var i = 0; i < listFamilies.length; i++) { |
|
|
|
|
} |
|
|
|
|
var listParametersRepeated2 = new Set(listParametersRepeated); |
|
|
|
|
var listParameters = Array.from(listParametersRepeated2); |
|
|
|
|
cl(listParameters); |
|
|
|
|
// cl(listParameters);
|
|
|
|
|
var listParametersOptions = ""; |
|
|
|
|
// Get parameters select options
|
|
|
|
|
for (var i = 0; i < listParameters.length; i++) { |
|
|
|
@ -343,7 +343,7 @@ document.getElementById("HDParameter").innerHTML = listParametersOptions; |
|
|
|
|
//-----------------------------
|
|
|
|
|
// createParallel
|
|
|
|
|
async function createParallel(myid,formId, myFormData) { |
|
|
|
|
cl("form data:: "+myFormData); |
|
|
|
|
// cl("form data:: "+myFormData);
|
|
|
|
|
// API Request
|
|
|
|
|
// Static query paramenters:
|
|
|
|
|
const myForm = document.getElementById(formId); |
|
|
|
@ -941,9 +941,11 @@ function do_grid_yearly(myid, year, myData) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------
|
|
|
|
|
// HORIZON d3 diagram
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function do_horizon_row(data, myid, title, myDates) { |
|
|
|
|
var horizonChart = d3.horizonChart() |
|
|
|
|
.height(50) |
|
|
|
@ -962,16 +964,18 @@ function do_horizon_row(data, myid, title, myDates) { |
|
|
|
|
.each(function (d, i) { |
|
|
|
|
var canvas = d3.select(this).select('canvas'); |
|
|
|
|
|
|
|
|
|
canvas.on('mouseover', function () { |
|
|
|
|
canvas.on('mouseover', function (dd, i) { |
|
|
|
|
// Get the mouse position relative to the canvas
|
|
|
|
|
var [x, y] = d3.mouse(this); |
|
|
|
|
|
|
|
|
|
// Calculate the y-value based on the mouse position
|
|
|
|
|
var chartHeight = horizonChart.height(); |
|
|
|
|
var yValue = (y / chartHeight) * (d[0][0].max - d[0][0].min) + d[0][0].min; |
|
|
|
|
// var yValue = horizonChart.y().invert(y);
|
|
|
|
|
|
|
|
|
|
// Retrieve the corresponding date
|
|
|
|
|
var dateIndex = Math.floor(x / (canvas.node().width / myDates.length)); |
|
|
|
|
//var date = myDates[dateIndex];
|
|
|
|
|
var date = myDates[dateIndex]; |
|
|
|
|
|
|
|
|
|
// Create a tooltip element
|
|
|
|
@ -985,7 +989,8 @@ function do_horizon_row(data, myid, title, myDates) { |
|
|
|
|
.style('font-size', '12px'); |
|
|
|
|
|
|
|
|
|
// Position the tooltip next to the mouse
|
|
|
|
|
tooltip.style('right', (x + 2) + 'px') |
|
|
|
|
tooltip |
|
|
|
|
.style('right', (x + 2) + 'px') |
|
|
|
|
.style('top', (y + 10) + 'px') |
|
|
|
|
.style('position', 'relative'); |
|
|
|
|
|
|
|
|
@ -1132,9 +1137,9 @@ document.querySelectorAll('button[type="submit"]').forEach(button => { |
|
|
|
|
var div = doc.querySelector('div[data-lt-tmp-id^="lt-"]'); |
|
|
|
|
var textData = div ? div.innerHTML : 'No div found'; |
|
|
|
|
writeInTXT(formId, textData);
|
|
|
|
|
cl("Addtext:"); |
|
|
|
|
cl(fromEditor); |
|
|
|
|
cl(textData); |
|
|
|
|
// cl("Addtext:");
|
|
|
|
|
// cl(fromEditor);
|
|
|
|
|
// cl(textData);
|
|
|
|
|
} else { |
|
|
|
|
writeIn(formId, formData); |
|
|
|
|
} |
|
|
|
@ -1446,10 +1451,7 @@ function makeApiRequest(formId, apiUrl, myid, myTitle, ...args) { |
|
|
|
|
// Make an AJAX request to your Flask API
|
|
|
|
|
var apiRequest = `http://localhost:5000/${apiUrl}`; ///parallel/daily?family=${family}&type=${type}&day=${day}`;
|
|
|
|
|
cl(apiRequest); |
|
|
|
|
|
|
|
|
|
var myCol = getName(formId[0]).split("-")[1]; |
|
|
|
|
// cl("myCol");
|
|
|
|
|
// cl(myCol);
|
|
|
|
|
document.getElementById(myid).setAttribute("apiurl", apiUrl); |
|
|
|
|
|
|
|
|
|
fetch(apiRequest) |
|
|
|
|