diff --git a/paper.md b/paper.md index b723d20890c1638fc050e183736df8f34778f6fd..4bbe2e7d86fad265f271344ca94b8d4b5bea822c 100644 --- a/paper.md +++ b/paper.md @@ -119,6 +119,7 @@ Figure 3 exposes the cartographic interface of Predihood, used mostly by people Our approach Predihood has been presented during the DATA conference [@barretpredicting]. Results vary from 30% to 65% depending on the environment variable, but proposing new algorithms can help to improve these results. +The project is available here: [https://gitlab.liris.cnrs.fr/fduchate/predihood](https://gitlab.liris.cnrs.fr/fduchate/predihood). # Acknowledgements diff --git a/predihood/main.py b/predihood/main.py index 7b24e0ed1b8c998732fa68c46d29bab029ceafc5..8a267c3d62a19e204a5c02a856804d5462780421 100644 --- a/predihood/main.py +++ b/predihood/main.py @@ -247,7 +247,6 @@ def get_environment_values(): return json.dumps(variables_with_values) # {"result": variables_with_values} - @app.route('/add_iris_to_csv', methods=["GET"]) def add_iris_to_csv(): """ diff --git a/predihood/static/css/styles.css b/predihood/static/css/styles.css index 02f6de538a1e22ed1e6a164d539b1f2a0d0374a8..2dd2154dc0fff1e20cfbf5d25b752647b354abac 100644 --- a/predihood/static/css/styles.css +++ b/predihood/static/css/styles.css @@ -112,4 +112,8 @@ h3 { .wrapperTable { margin-top: 2rem; +} + +body.busy-cursor { + cursor: wait !important; } \ No newline at end of file diff --git a/predihood/static/js/algorithms.js b/predihood/static/js/algorithms.js index 2dc9343daf89c89b17c4432e7c15b592bc47d614..ffdb33b9dc803c6464cd0bfeec691bfc71a10b6c 100644 --- a/predihood/static/js/algorithms.js +++ b/predihood/static/js/algorithms.js @@ -57,7 +57,8 @@ $("#testPercentage") // run the classifier with specified parameters and display results in the results section. $("#runBtn").click("on", function () { - $("body").css("cursor", "progress"); + // $("body").css("cursor", "progress"); + document.body.classList.add('busy-cursor'); $(".wrapperTable input[type='checkbox']:not(:checked)").each(function () { $(this).parent().parent().empty(); // remove tables that are not checked in the interface }); @@ -193,12 +194,14 @@ $("#runBtn").click("on", function () { // append all to HTML $("#resultsDiv").append(containing_table); - $("body").css("cursor", "default"); + // $("body").css("cursor", "default"); + document.body.classList.remove('busy-cursor'); }, error: function (result, textStatus, errorThrown) { console.log(errorThrown); alert("something went wrong while training. Please check your parameters<br>" + textStatus); - $("body").css("cursor", "default"); + // $("body").css("cursor", "default"); + document.body.classList.remove('busy-cursor'); } }); diff --git a/predihood/static/js/carto.js b/predihood/static/js/carto.js index c14e74330df757d3387c3f9c7f51ce0fe51016da..c8828021d391d0f20f5a79a98901ef72924b3f53 100644 --- a/predihood/static/js/carto.js +++ b/predihood/static/js/carto.js @@ -105,52 +105,53 @@ function displayPopup(e) { } - if($("#assessmentMode").is(":checked")) { - // alert("assessment mode"); - - for(let env in environment_variables) { - let env_values = environment_variables[env] - let div_container = $("<div>").prop("id", "assessment"+env) - let list_values = $("<select>"); - for(let value in env_values) { console.log(value); list_values.append($("<option>").prop("value", env_values[value]).text(env_values[value])) } - div_container.append(env).append(list_values) - divInformation.append(div_container) - } - - let to_csv_button = $("<button>").prop("id", "addAssessmentButton"); - if(preferred_language_carto === "french") { - to_csv_button.text("Ajouter au jeu de données"); - } else { - to_csv_button.text("Add to dataset"); - } - - let messageTooltip = divInformation[0].outerHTML + to_csv_button[0].outerHTML; - layer.bindPopup(messageTooltip) - layer.bringToFront(); - layer.openPopup(); - - $("#addAssessmentButton").on("click", function() { - let data_param = {} - for(let env in environment_variables) { - data_param[env] = $("#assessment"+env)[0].children[0].value - } - data_param["code_iris"] = code_iris - console.log(data_param) - $.ajax({ - type: "GET", - url: "/add_iris_to_csv", - data: data_param, - "async": false, - contentType: 'application/json;charset=UTF-8', - success: function(result) { - alert(result) - }, - error: function(result, textStatus, errorThrown) { - console.log(errorThrown); - } - }); - }); - } else { + // if($("#assessmentMode").is(":checked")) { + // // alert("assessment mode"); + // + // for(let env in environment_variables) { + // let env_values = environment_variables[env] + // let div_container = $("<div>").prop("id", "assessment"+env) + // let list_values = $("<select>"); + // for(let value in env_values) { console.log(value); list_values.append($("<option>").prop("value", env_values[value]).text(env_values[value])) } + // div_container.append(env).append(list_values) + // divInformation.append(div_container) + // } + // + // let to_csv_button = $("<button>").prop("id", "addAssessmentButton"); + // if(preferred_language_carto === "french") { + // to_csv_button.text("Ajouter au jeu de données"); + // } else { + // to_csv_button.text("Add to dataset"); + // } + // + // let messageTooltip = divInformation[0].outerHTML + to_csv_button[0].outerHTML; + // layer.bindPopup(messageTooltip) + // layer.bringToFront(); + // layer.openPopup(); + // + // $("#addAssessmentButton").on("click", function() { + // let data_param = {} + // for(let env in environment_variables) { + // data_param[env] = $("#assessment"+env)[0].children[0].value + // } + // data_param["code_iris"] = code_iris + // console.log(data_param) + // $.ajax({ + // type: "GET", + // url: "/add_iris_to_csv", + // data: data_param, + // "async": false, + // contentType: 'application/json;charset=UTF-8', + // success: function(result) { + // alert(result) + // }, + // error: function(result, textStatus, errorThrown) { + // console.log(errorThrown); + // } + // }); + // }); + // } + // else { if (selected_algorithm !== "undefined" && selected_algorithm !== undefined) { predictions = predict(code_iris, selected_algorithm) console.log(predictions) @@ -179,7 +180,7 @@ function displayPopup(e) { $("#selectAlgorithmTooltip").val(previously_selected_algorithm); // must be after binding the popup to be effective $("#selectAlgorithmTooltip").on("click", function() { displayPopup(e)}) // update popup (env variables) when click on an algorithm - } + // } } /** diff --git a/predihood/templates/form.html b/predihood/templates/form.html index 2538de17910a191a26661198c2fd54d7e8bcb306..828650ca152baa7958ea828b39c7215061c8d952 100644 --- a/predihood/templates/form.html +++ b/predihood/templates/form.html @@ -55,13 +55,13 @@ <br> </div> - <div> - {% if language == "french" %} - Expertise manuelle: <input type="checkbox" id="assessmentMode"/> - {% else %} - Manual assessment: <input type="checkbox" id="assessmentMode"/> - {% endif %} - </div> +{#<div>#} +{# {% if language == "french" %}#} +{# Expertise manuelle: <input type="checkbox" id="assessmentMode"/>#} +{# {% else %}#} +{# Manual assessment: <input type="checkbox" id="assessmentMode"/>#} +{# {% endif %}#} +{#</div>#} <div class="input-group mb-3"> <button class="btn" type="button" id="boutonEffacer">