-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Privateer Database with Reviewers Comments #91
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reorganized the TorsionPlot and TorsionMultiPlot components to a shared directory for better code management. Enhanced database fetching in Database.tsx by replacing 'NaN' values with 'null' to prevent parsing errors. Added a new TorsionGraph component for detailed torsions analysis. These changes enhance the functionality while improving code maintainability and efficiency.
Cleaned up various TorsionPlot components and organized them under a shared directory for easier navigation. Improved data handling in Database.tsx by replacing 'NaN' values with 'null', preventing potential parsing issues. Introduced a TorsionGraph component for more detailed torsion analysis, overall enhancing code maintainability and application functionality.
Fixed formatting issue in GlycanDetailTorsionPlot and removed unnecessary console log in TorsionPlot. The refactoring leads to better readability, easier navigation, and improved maintainability of the code.
Customized scrollbar appearance and replaced DatabaseFetch import with DatabaseInput in several components. Added a new implementation for the DatabaseSearchTable and modified related dependencies. Also introduced changes for handling 'NaN' values in TorsionPlot component.
Expanded Constants.tsx to include definition of sugarLinkageMap that defines several sugar linkages. Implemented use of this new constant in DatabaseSearch.tsx, replacing the previous inline definition of sugars.
Sorting feature is added to the DatabaseSearchTable. 'SortingState' from '@tanstack/react-table' was used to add state for the sorting criteria. The initial state is set to sort by the "count" column in descending order. The debugTable property is also changed to false.
The debug 'console.warn(data)' has been removed from DatabaseSearchTable.tsx. This console output was unnecessary for the production code and its removal will enhance performance
The 'state' assignment in DatabaseSearchTable.tsx has been refactored to improve code readability. The 'sorting' property is now clearly commented, making it easier to understand the purpose of this piece of code.
A tooltip was added to the sugar list component to provide in-depth explanation of the sugar concepts. A refactored rendering for 'monosaccharide validation data' text span and an svg icon were also included, improving user interactivity and understanding of the data presented.
The scrollbar colors in index.css have been updated for improved visual appeal. The linkage search functionality in the database component has been expanded to include an 'Any' option, allowing users to search without specifying a particularlinkage.
Code has been refactored to use consistent quote types and formatting, and enhance search functionality in the database component. The sugarLinkageMap constant's type has been explicitly specified, and the default linkage search value has been changed to 'Any' to improve user flexibility
CSS color values in the index.css file have been revised to maintain consistency across the code. All hex color values are now in the same format, lowercased, contributing to improved code readability and maintenance.
Incorporated Google Analytics 4 into the project to track page views and web vital metrics. Updates include initializing GA4 in `main.tsx` with `ReactGA.initialize` and capturing CLS, LCP, FID metrics via web-vitals library. Added dependency for `react-ga4` and `web-vitals` in `package.json`.
Adjusted the color setting in the 'scatter' type and added legend configuration in the 'layout' part of CremerPopleGraph.tsx. The scatter plot color updated from green to blue and the legend was made visible with additional settings such as position and border color.
This commit enhances UI and implements conditional rendering in multiple components. Notably, CremerPopleGraph's scatter plots receive color and legend updates, while DatabaseHeader and DatabaseResult's flex containers are widened. Improvements are made to SugarList and BFactorVsRSCC visual elements, and an extraneous hover title in SNFGList is removed. Additionally, a new data extraction function is included in Constants.tsx for better data accessibility and presentation.
In this commit, new dependencies "@tanstack/react-table", "react-ga4" and "web-vitals" have been added to the project's package-lock.json file. The version of "es5-ext" and "ip" have also been updated and necessary information about these updated modules have been added as well.
The color determination logic based on diagnostic values has been extracted into a separate function called `getColour`. This function is then utilized in two different places, which enhances code readability and maintainability.
The color logic within the `getColour` function in Constants.tsx has been modified. The color for the 'yes' diagnostic is updated from "text-red-400" to "text-red-600" in order to provide more optic distinction in the application's UI.
The code has been updated to handle cases where 'torsions' data is undefined. If the torsions data is undefined, the code now shows a relevant message to the user. By adding checks for empty data and appropriate response mechanisms, the system's usability improves and the potential for confusion in such scenarios is minimized.
This commit replaces the null state for 'torsions' with an explicit undefined state when 'sortedTorsionList' has no entries. It also improves readability of the code by altering the condition for rendering 'Linkage Torsion Analysis', making it dependent on 'torsions' being defined, not the existence of keys in 'torsions'. This makes the execution path clearer.
The changes in this commit refactor 'getColour' and 'extracted' functions in Constants.tsx file for cleaner, more readable code. Specifically, the ternary operator in 'getColour' function was simplified and the unnecessary return parentheses in 'extracted' function were removed. Also, missing semicolons were added after function calls for better coding practices.
Included an early return statement in TorsionPlot.tsx's useEffect to prevent execution when sortedTorsionList is undefined. Also introduced a return statement in the promise error catch block, although its effect would generally be limited as it is the last action in the block.
Modified the calculatePoints function to clearly distinguish and handle 'issue' and 'no issue' sugars. Altered data plotting to accurately reflect this improved diagnostic handling, and implemented a comprehensive legend for user-friendly data distinction.
This commit simplifies the TorsionPlot.tsx file by eliminating a return statement in the error catch block that was superfluous. Also, it removes unnecessary blank lines to improve code readability.
This commit cleans up the BFactorVsRSCC.tsx file. It modifies the calculatePoints function declaration layout and improves console.log formatting. It also eliminates unnecessary blank lines and corrects syntax to enhance code readability.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds the following features
Testing
This PR includes the new search interface which needs proper testing, as well as this, the web app should be tested to ensure no side-effects have been caused by these changes.