-
Notifications
You must be signed in to change notification settings - Fork 384
refactor(Tools): Cleanup code for drawingSvg, make 'data-id' attribut… #1952
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for cornerstone-3d-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
function _draw( | ||
what: 'circle' | 'line' | 'ellipse' | 'rect' | 'path' | 'polyline' | 'g', | ||
svgDrawingHelper: SVGDrawingHelper, | ||
annotationUID: string, | ||
drawingId: string, | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
attributes: Record<string, any> | ||
): { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use an object instead of positional parameters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
over my dead body ;-). this is typically over engineering in my opinion.
( we are talking of 5 positional arguments that fit into a single line of text in most cases )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is, later on, we're developing another tool that needs to use the _draw
, but for some weird reason, it doesn't actually need drawingId
or whatever. Then we end up using _draw
like this:
_draw(null, svgDrawingHelper, null, ...)
I hope that makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see my comments
…e consistant
Context
When adding svg annotation, there is a custom attribute 'data-id' intended for automation test.
the feature was not consistently implemented ( most of the time missing ) and is somehow redundant with internal unique id.
This PR remove custom value for data-id and uses the internal uid.
Changes & Results
only impacts 'data-id' attribute in SVG elements.
Testing
use stack annotation tools / https://www.cornerstonejs.org/live-examples/stackannotationtools
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment