feat: Propagate squiggleString
This commit is contained in:
parent
f8fafb837f
commit
b52ddbcfdf
|
@ -178,7 +178,7 @@ export default function ComparisonView({ listOfElementsForView }) {
|
|||
let binaryComparisons2 = [];
|
||||
links.shift();
|
||||
for (let link of links) {
|
||||
let { source, target, distance, reasoning } = link;
|
||||
let { source, target, distance, reasoning, squiggleString } = link;
|
||||
let searchByName = (name, candidate) => candidate.name == name;
|
||||
let testForSource = (candidate) => searchByName(source, candidate);
|
||||
let testForTarget = (candidate) => searchByName(target, candidate);
|
||||
|
@ -190,7 +190,13 @@ export default function ComparisonView({ listOfElementsForView }) {
|
|||
console.log(target);
|
||||
throw new Error("Comparisons include unknown elements, please retry");
|
||||
}
|
||||
quantitativeComparisons2.push([element1, element2, distance, reasoning]);
|
||||
quantitativeComparisons2.push([
|
||||
element1,
|
||||
element2,
|
||||
distance,
|
||||
reasoning,
|
||||
squiggleString || distance,
|
||||
]);
|
||||
binaryComparisons2.push([element1, element2]);
|
||||
}
|
||||
// return ({quantitativeComparisons: quantitativeComparisons2, binaryComparisons: binaryComparisons2})
|
||||
|
@ -315,6 +321,7 @@ export default function ComparisonView({ listOfElementsForView }) {
|
|||
if (inputValue < 1 && inputValue > 0) {
|
||||
inputValue = 1 / inputValue;
|
||||
[element1, element2] = [element2, element1];
|
||||
squiggleString = `(${squiggleString})^(-1)`;
|
||||
}
|
||||
console.log(`posList@nextStepInput:`);
|
||||
console.log(posList);
|
||||
|
|
|
@ -122,9 +122,10 @@ function drawGraphInner({ nodes, links }) {
|
|||
);
|
||||
})
|
||||
.style("fill", "none")
|
||||
.attr("stroke", "black");
|
||||
.attr("stroke", "green"); // black
|
||||
|
||||
// labels for links
|
||||
// smaller font.
|
||||
svg
|
||||
.selectAll("mylinks")
|
||||
.data(links)
|
||||
|
@ -149,7 +150,8 @@ function drawGraphInner({ nodes, links }) {
|
|||
if (d.distance == d.squiggleString || !d.squiggleString) {
|
||||
return distanceFormatted;
|
||||
} else {
|
||||
return `${d.squiggleString} → ${distanceFormatted}`;
|
||||
// return `${d.squiggleString} → ${distanceFormatted}`;
|
||||
return `(${d.squiggleString})`;
|
||||
}
|
||||
|
||||
// return (truncateValueForDisplay(Number(d.distance)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user