VEuPathDB / web-components

Library of React components for plotting data
Apache License 2.0
1 stars 0 forks source link

Bug - 2x2 table setup #458

Closed jernestmyers closed 1 year ago

jernestmyers commented 1 year ago

Depends on https://github.com/VEuPathDB/web-eda/pull/1667

Resolves https://github.com/VEuPathDB/web-eda/issues/1663

jernestmyers commented 1 year ago

@dmfalke Based on your comments, it occurred to me this could be improved (and consistent with how the other reversals take place). Just wanted to point it out to ensure I'm not overlooking anything:

       dataCopy.values =
         selectedReferenceValues[0] !== data.independentLabels[0]
-          ? [dataCopy.values[1], dataCopy.values[0]]
-          : [data.values[1], data.values[0]];
+          ? [...dataCopy.values].reverse()
+          : [...data.values].reverse();
dmfalke commented 1 year ago

@dmfalke Based on your comments, it occurred to me this could be improved (and consistent with how the other reversals take place). Just wanted to point it out to ensure I'm not overlooking anything:

       dataCopy.values =
         selectedReferenceValues[0] !== data.independentLabels[0]
-          ? [dataCopy.values[1], dataCopy.values[0]]
-          : [data.values[1], data.values[0]];
+          ? [...dataCopy.values].reverse()
+          : [...data.values].reverse();

Yes, I agree!

jernestmyers commented 1 year ago

I'm including screenshots conveying the correct order using the same study (GEMS1 Case Control) and parameter selections as shown in https://github.com/VEuPathDB/web-eda/issues/1663:

image

image

image

image