attempting another fix for the svg cable sorting to prevent cables flipping

This commit is contained in:
csawatzky 2025-09-30 16:26:28 -06:00
parent 337986f88f
commit 708a1568a6

View file

@ -507,9 +507,9 @@ export default function BinSVGV2(props: Props) {
//if the cables have the same number of nodes
if (b.temperatures.length === a.temperatures.length) {
//sort by temp only last and any type that has humidity first
if ((avg(a.humidities) === 0 || a.humidities.length === 0) && (avg(b.humidities) !== 0 || b.humidities.length > 0)) {
if ((avg(a.humidities) === 0) && (avg(b.humidities) !== 0)) {
return 1;
} else if ((avg(b.humidities) === 0 || b.humidities.length === 0) && (avg(a.humidities) !== 0 || a.humidities.length > 0)) {
} else if ((avg(b.humidities) === 0) && (avg(a.humidities) !== 0)) {
return -1;
}
else {