Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
menocsk27 committed Jan 23, 2025
1 parent 9c904bb commit 3dd33ee
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/public/js/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ window.onload = function () {

project.innerHTML = proj;
project.onclick = () => {
window.location.replace("/?id=" + proj);
window.location.replace("/proof?id=" + proj); // TODO only for study, remove `proof`
}

projects.appendChild(project);
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/js/proof/proof.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const conf = {
const file = path ? path : "../data/" + getSessionId() + "/" + getFileName();

const url = new URL(window.location.toLocaleString()).searchParams;
if (url.get("cond") === "sp") {
if (url.get("cond") === "sp") { // TODO remove this, and extra extract-examples in package.json
proof.showSubProofs = true;
proof.showPopover = false;
}
Expand Down
6 changes: 4 additions & 2 deletions frontend/public/js/proof/rules/cd/linear/linear.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,9 @@ function visualizeUniqueSolution(plot, _data) {
const v = Fraction(row[row.length - 1]).sub(Fraction(constantTerm)).div(Fraction(independentTerm));
// f(v) === f(solutions[independentIndex]), could use either
annotations.push({ x: eval(f(v)), color });
const ind = annotations.length-1
hl[id] = {
svg: () => document.querySelectorAll(`#${plot} .annotations path`)[annotations.length-1],
svg: () => document.querySelectorAll(`#${plot} .annotations path`)[ind],
evaluate: point =>
Fraction(v).gt(Fraction(point.x - eval_tolerance)) &&
Fraction(v).lt(Fraction(point.x + eval_tolerance)),
Expand Down Expand Up @@ -533,8 +534,9 @@ function visualizeEquations(plot, _data, annotate = true) {

const v = Fraction(constantTerm).sub(Fraction(replacedSum)).div(Fraction(independentCoef));
annotations.push({ x: eval(f(v)), text: `${x.varName} = ${f(v)}`, color });
const ind = annotations.length-1;
hl[id] = {
svg: () => document.querySelectorAll(`#${plot} .annotations path`)[annotations.length-1],
svg: () => document.querySelectorAll(`#${plot} .annotations path`)[ind],
evaluate: point =>
Fraction(v).gt(Fraction(point.x - eval_tolerance)) &&
Fraction(v).lt(Fraction(point.x + eval_tolerance)),
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/js/utils/session-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async function loadExample(name, id) {
console.log(response)
console.log(response.ok)
if (response.ok) {
window.location.href = "/proof?id=" + id;
window.location.href = "/proof?id=" + id; // TODO remove `proof`
} else {
document.getElementById("generating-example").innerHTML = "Something went wrong. Please reload this page and try again. If the problem persists, feel free to contact the authors";
}
Expand Down

0 comments on commit 3dd33ee

Please sign in to comment.