attempting another fix for the svg cable sorting to prevent cables flipping
This commit is contained in:
parent
337986f88f
commit
708a1568a6
1 changed files with 2 additions and 2 deletions
|
|
@ -507,9 +507,9 @@ export default function BinSVGV2(props: Props) {
|
||||||
//if the cables have the same number of nodes
|
//if the cables have the same number of nodes
|
||||||
if (b.temperatures.length === a.temperatures.length) {
|
if (b.temperatures.length === a.temperatures.length) {
|
||||||
//sort by temp only last and any type that has humidity first
|
//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;
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue