-
Notifications
You must be signed in to change notification settings - Fork 29
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
Annotation visualisation #1121
Annotation visualisation #1121
Conversation
* Update to API access request feature - Do not auto approve when academic user requested API access - Include justification in slack channel - Show API Access Justification in User page - Allow admin to change API access justification in User page * update screenshot tests
selectedAnnotationColumns: string[]; | ||
selectedTreatmentColumns: string[]; | ||
} | ||
export class AnnotationVisualisation extends React.Component< |
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.
Could you make this a function component. So just export function AnnotationVisualisation() { ... }
'selectedTreatmentColumns' | ||
); | ||
|
||
if (savedAnnotationColumns && savedTreatmentColumns) { |
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 only one of them be set? What happens in that case?
return filteredColumns.map(column => ({ | ||
...getDefaultColumnDefinition( | ||
column.key, | ||
1200 / this.state.selectedAnnotationColumns.length |
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.
I wouldn't just make every column have an even portion of the table width. Also you assume the table width is always 1200 I imagine. What about on changing screen sizes?
); | ||
}; | ||
|
||
export function getDefaultColumnDefinition<T>( |
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.
Not using template parameter
); | ||
}; | ||
|
||
handleTreatmentColumnsChange = (selectedOptions: 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 the type instead of 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.
This comment applies above as well and in most places you see any
unless there is a good reason to use it
); | ||
const totalColumns = selectedKeys.length; | ||
const calculatedWidth = hasAnnotation | ||
? 800 / (totalColumns - 1) |
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.
Again, I'd be careful with these hardcoded widths. See my other comment for details.
render() { | ||
return ( | ||
<> | ||
{this.props.isPatientInfoVisible && ( |
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.
It looks like patientId
and patientInfo
are only used when isPatientInfoVisible === true
. However, the first two props I mentioned are not optional. I would prefer to have these bundled into an optional object like the following:
patientInfo?: {
id: string
info: string
}
id
and info
could also be optional.
</div> | ||
</div> | ||
)} | ||
<Tabs |
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.
Just wondering why you didn't use the Tabs
component we already had?
ba957e8
to
e3987e2
Compare
This is the first draft of the visualisation component for OncoKB annotations.
To do: