diff --git a/lib/.comparisonView.js.swp b/lib/.comparisonView.js.swp new file mode 100644 index 0000000..6f77f0c Binary files /dev/null and b/lib/.comparisonView.js.swp differ diff --git a/lib/comparisonView.js b/lib/comparisonView.js index d0fda06..b721909 100644 --- a/lib/comparisonView.js +++ b/lib/comparisonView.js @@ -319,9 +319,15 @@ export default function ComparisonView({ listOfElementsForView }) { }) => { if (!dontPushSubmitButtonAnyMore) { if (inputValue < 1 && inputValue > 0) { - inputValue = 1 / inputValue; + let inverse = 1 / inputValue; + if (squiggleString == inputValue) { + inputValue = inverse; + squiggleString = inverse; + } else { + inputValue = inverse; + squiggleString = `(${squiggleString})^(-1)`; + } [element1, element2] = [element2, element1]; - squiggleString = `(${squiggleString})^(-1)`; } console.log(`posList@nextStepInput:`); console.log(posList); @@ -470,7 +476,7 @@ export default function ComparisonView({ listOfElementsForView }) { {/* Results section */}
{/* Graph */} -
+
number.toString().length; @@ -48,7 +48,7 @@ function drawGraphInner({ nodes, links }) { // Build the d3 graph removeOldSvg(); - var svg = d3 + let svg = d3 .select("#graph") .append("svg") .attr("width", width + margin.left + margin.right) @@ -147,6 +147,7 @@ function drawGraphInner({ nodes, links }) { }) .text(function (d) { let distanceFormatted = formatLargeOrSmall(Number(d.distance)); + return distanceFormatted; if (d.distance == d.squiggleString || !d.squiggleString) { return distanceFormatted; } else { @@ -158,6 +159,7 @@ function drawGraphInner({ nodes, links }) { //return(Number(d.distance).toPrecision(2).toString()) }) .style("text-anchor", "middle"); + // background } export function DrawGraph({ @@ -174,8 +176,11 @@ export function DrawGraph({ drawGraphInner({ nodes, links }); } return ( -
-
+
+
); }