diff --git a/webapp/path_navigator.html b/webapp/path_navigator.html
index 4d050f7..efa25d5 100644
--- a/webapp/path_navigator.html
+++ b/webapp/path_navigator.html
@@ -406,6 +406,19 @@
return parseFloat(fracStr);
}
+ // Normalize display ratio so numerator >= denominator
+ function normalizeDisplayRatio(label) {
+ const parts = label.split('/');
+ if (parts.length === 2) {
+ const num = parseInt(parts[0]);
+ const den = parseInt(parts[1]);
+ if (num < den) {
+ return den + '/' + num;
+ }
+ }
+ return label;
+ }
+
// Multiply two fractions and return as string
function multiplyFractions(frac1, frac2) {
const f1 = parseFraction(frac1);
@@ -653,8 +666,8 @@
'label': 'data(ratio)',
'font-size': '12px',
'color': '#ffffff',
- 'text-rotation': 'autorotate',
- 'text-margin-y': -10,
+ 'text-rotation': '0deg',
+ 'text-margin-y': 0,
'text-background-color': '#000000',
'text-background-opacity': 0.8,
'text-background-padding': '2px',
@@ -836,7 +849,7 @@
id: previewEdgeId,
source: node.id(),
target: previewGhostId,
- ratio: nearestSnap.label,
+ ratio: normalizeDisplayRatio(nearestSnap.label),
}
});
@@ -953,7 +966,7 @@
id: edgeId,
source: node.id(),
target: ghostId,
- ratio: nearestSnap.label,
+ ratio: normalizeDisplayRatio(nearestSnap.label),
}
});
@@ -1286,7 +1299,7 @@
data: {
source: idMap[e.source],
target: idMap[e.target],
- ratio: e.ratio,
+ ratio: normalizeDisplayRatio(e.ratio),
},
});
});