-
Notifications
You must be signed in to change notification settings - Fork 1
VAF chart changes and refactoring #42
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: timeline-VAF-grouprows
Are you sure you want to change the base?
VAF chart changes and refactoring #42
Conversation
f165aab to
c2d3728
Compare
|
|
||
| @computed get sampleIds() { | ||
| const sampleIds: string[] = []; | ||
| this.sampleEvents.forEach((sample, i) => { |
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.
super minor but i like to use reduce for this kind of operation so that you get direct assignment, or even just direct return. Matters more in longer routines. You don't need to fix this.
const sampleIds = this.sampleEvents.reduce()
| Mutation[] | ||
| > { | ||
| @observable.ref private mouseOverMutation: Readonly<Mutation> | null = null; | ||
| @observable mouseOverMutation: Readonly<Mutation> | null = null; |
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.
did you mean to take @observable.ref off?
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.
Yes, although I am not sure whether it's needed.
The documentation says:
@observable.ref - Decorator that creates an observable that only observes the references, but doesn't try to turn the assigned value into an observable.ts.
We reassign mouseOverMutation from the setter. Won't the field stop to be observable after reassignment then?
| ); | ||
| } | ||
|
|
||
| groupColor(sampleId: string) { |
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.
should be computed
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 guess I know why: Because you need to trigger recalculation when some of the variables groupColor rely on change.
I am wondering when one would not choose to make something @computed? When it's a pure function that only depends on it's input?
| : 'rgb(0,0,0)'; | ||
| } | ||
|
|
||
| @autobind |
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.
should be computed. autobind decorator is only for methods used as callbacks. autobind ensures that bound context ("this") is the instance of the class.
| return clinicalValueToColor; | ||
| } | ||
|
|
||
| @autobind |
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.
no autobind
|
|
||
| this.wrapperStore = new TimelineWrapperStore(); | ||
|
|
||
| (window as any).store = this.store; |
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.
my fault. lets kill this.
| IVAFChartWrapperProps, | ||
| {} | ||
| > { | ||
| store: TimelineStore; |
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.
lets call this property "timelineStore"
683c2bc to
29b57de
Compare
It seems like we use arrow functions everywhere. e.g. |
|
@alisman I've pushed the changes. Please have another look |
da4a6c5 to
9df356c
Compare
to be able to distinquish tick labels
9b7c236 to
036ff5d
Compare
Add active class to track options button
Add active class to track options button
What? Why?
Improve VAF chat code and add 2 small UI improvements.
Changes proposed in this pull request:
Checks
can be automatically added by git if you run the
git-commitcommand withthe
-soption)Any screenshots or GIFs?
If this is a new visual feature please add a before/after screenshot or gif
here with e.g. GifGrabber.
Notify reviewers
Read our Pull request merging
policy. If you are part of the
cBioPortal organization, notify the approprate team (remove inappropriate):
@cBioPortal/frontend
If you are not part of the cBioPortal organization look at who worked on the
file before you. Please use
git blame <filename>to determine thatand notify them here: