-
Notifications
You must be signed in to change notification settings - Fork 162
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
Add tree-related types #1864
Add tree-related types #1864
Commits on Nov 6, 2024
-
ES2015 allows iteration of sets which is used in this codebase.
Configuration menu - View commit details
-
Copy full SHA for c4bcae9 - Browse repository at this point
Copy the full SHA c4bcae9View commit details -
Use named imports from the package instead of direct imports from source. This allows proper typing by the external types/d3 package.
Configuration menu - View commit details
-
Copy full SHA for d06d095 - Browse repository at this point
Copy the full SHA d06d095View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b4c441 - Browse repository at this point
Copy the full SHA 1b4c441View commit details -
render(): Convert from positional to named parameters
For improved readability.
Configuration menu - View commit details
-
Copy full SHA for cb7e657 - Browse repository at this point
Copy the full SHA cb7e657View commit details -
Use context-specific dispatch type
The AppDispatch type is already used elsewhere.
Configuration menu - View commit details
-
Copy full SHA for fd26d53 - Browse repository at this point
Copy the full SHA fd26d53View commit details
Commits on Nov 12, 2024
-
Converted most but not all tree-related files. There are many type errors exposed by conversion. They will be addressed in subsequent commits. I removed a few comments that are now self-explanatory with the added types. I also moved all JSDoc types and descriptions into the function signature. Note that there are many optional properties in the newly defined interfaces. This is not ideal and doesn't capture the fact that many properties are conditional on things such as layout. But it's a starting point to be improved over time.
Configuration menu - View commit details
-
Copy full SHA for 7b3a0e1 - Browse repository at this point
Copy the full SHA 7b3a0e1View commit details -
These are not directly used by other TypeScript files, but I've inferred them from existing JavaScript files.
Configuration menu - View commit details
-
Copy full SHA for 402a5e6 - Browse repository at this point
Copy the full SHA 402a5e6View commit details -
tsconfig: Disable strictNullChecks
The conversion done in the previous commits came with hundreds of violations of this rule. While this could be addressed by better types, it will take some work and can be deferred. A new issue/PR will be created after this is merged. <#1864 (comment)>
Configuration menu - View commit details
-
Copy full SHA for b1b2488 - Browse repository at this point
Copy the full SHA b1b2488View commit details -
Add override keyword for React lifecycle methods
To satisfy the TypeScript rule noImplicitOverride.
Configuration menu - View commit details
-
Copy full SHA for 2e96210 - Browse repository at this point
Copy the full SHA 2e96210View commit details -
Add _ prefix for unused variables
To satisfy the ESLint rule @typescript-eslint/no-unused-vars.
Configuration menu - View commit details
-
Copy full SHA for 7d22da0 - Browse repository at this point
Copy the full SHA 7d22da0View commit details -
Define the list of layouts in a single place.
Configuration menu - View commit details
-
Copy full SHA for 75fd6ad - Browse repository at this point
Copy the full SHA 75fd6adView commit details -
Use Math.trunc instead of parseInt
Previous usage of parseInt was to convert float to integer. However, this isn't the intended usage of parseInt, which is made apparent with type checking - the parameter is expected to be a string type. Replace it with Math.trunc which is intended for converting float to integer.
Configuration menu - View commit details
-
Copy full SHA for e02e0ce - Browse repository at this point
Copy the full SHA e02e0ceView commit details -
Use Math.min/max instead of min/max
Thse are typed to return a value that is not undefined.
Configuration menu - View commit details
-
Copy full SHA for a79226e - Browse repository at this point
Copy the full SHA a79226eView commit details -
Use separate variables for array and set of legend values
This is easier for the TypeScript compiler to understand.
Configuration menu - View commit details
-
Copy full SHA for 5f4fe7e - Browse repository at this point
Copy the full SHA 5f4fe7eView commit details -
D3 expects the empty value to be null, not undefined.
Configuration menu - View commit details
-
Copy full SHA for aa30581 - Browse repository at this point
Copy the full SHA aa30581View commit details -
Properly handle unknown errors when creating color scales
Previously, there was no guarantee that an unknown error would produce a helpful message.
Configuration menu - View commit details
-
Copy full SHA for 6083f73 - Browse repository at this point
Copy the full SHA 6083f73View commit details -
Properly check for stroke-width
svgPropsToUpdate is Set<string>, not Set<string[]>.
Configuration menu - View commit details
-
Copy full SHA for 83326a2 - Browse repository at this point
Copy the full SHA 83326a2View commit details -
Properly check window.event.shiftKey
Only KeyboardEvent has the shiftKey property.
Configuration menu - View commit details
-
Copy full SHA for 25294e8 - Browse repository at this point
Copy the full SHA 25294e8View commit details -
calcTipRadii takes a key name of tipSelectedIdx. Previously, the value of idx was unused.
Configuration menu - View commit details
-
Copy full SHA for aedce7e - Browse repository at this point
Copy the full SHA aedce7eView commit details -
Properly set timeSliceHasPotentiallyChanged
This should be a boolean, not whatever value newDistance is when defined.
Configuration menu - View commit details
-
Copy full SHA for 02b7206 - Browse repository at this point
Copy the full SHA 02b7206View commit details -
This should be a boolean, not whatever value ReduxNode.parentInfo.original is when defined.
Configuration menu - View commit details
-
Copy full SHA for 5b81e88 - Browse repository at this point
Copy the full SHA 5b81e88View commit details -
Properly set PhyloNode.branch to [string, string]
Not [string], [], [[string], [string]], or [string, [string]].
Configuration menu - View commit details
-
Copy full SHA for 79608a5 - Browse repository at this point
Copy the full SHA 79608a5View commit details -
Remove unused parameter to numDate
The extra value `true` had no effect.
Configuration menu - View commit details
-
Copy full SHA for 9d57be8 - Browse repository at this point
Copy the full SHA 9d57be8View commit details -
Remove unused mapLegendOpen, treeLegendOpen from controls state
These were initialized with default values but unused in the code.
Configuration menu - View commit details
-
Copy full SHA for 5803970 - Browse repository at this point
Copy the full SHA 5803970View commit details -
Remove unused selectedNode from state
Follow-up to "Lift node-selected modal to redux state" (f7e944d). This is left over from before we shifted the selected node to redux state.
Configuration menu - View commit details
-
Copy full SHA for 4d2e633 - Browse repository at this point
Copy the full SHA 4d2e633View commit details -
Remove unused default value for performanceFlags
This value was causing a type error because {} is not a Map. Remove it entirely since it isn't actually used - the value is created from scratch in src/middleware/performanceFlags.js.
Configuration menu - View commit details
-
Copy full SHA for 8c6a301 - Browse repository at this point
Copy the full SHA 8c6a301View commit details -
Remove broken/unused searchNodes parameter
There is a type error that prevents this from working properly: includes() takes a single string, but an array of PhyloNodes is given. It's not used on any existing calls to updateTipRadii, so just remove it entirely.
Configuration menu - View commit details
-
Copy full SHA for 3bd4b55 - Browse repository at this point
Copy the full SHA 3bd4b55View commit details -
Convert RGBColor to hex string
This previously worked because d3 was able to properly parse a color string out of RGBColor. However, it's better to keep things consistent and simple. Convert so that range is simply an array of hex color strings.
Configuration menu - View commit details
-
Copy full SHA for 56b791b - Browse repository at this point
Copy the full SHA 56b791bView commit details -
Set default colorings in getDefaultControlsState
Centralize the defaults for consistency. Also, this avoids the need to mark the property as optional on the state.
Configuration menu - View commit details
-
Copy full SHA for 5a681ff - Browse repository at this point
Copy the full SHA 5a681ffView commit details -
Set default value of focus to false
This is more consistent with other booleans.
Configuration menu - View commit details
-
Copy full SHA for 931f1e6 - Browse repository at this point
Copy the full SHA 931f1e6View commit details -
Allow setState to take a partial state
React will shallow merge the provided object into the existing state¹ which works for our usage. The type definition of setState does not allow partial state by default. Use 'never' to configure it to expect no fields in particular². ¹ <https://react.dev/reference/react/Component#setstate-parameters> ² <https://stackoverflow.com/a/55824499>
Configuration menu - View commit details
-
Copy full SHA for 9c7644b - Browse repository at this point
Copy the full SHA 9c7644bView commit details