Skip to content

Commit

Permalink
Remove unused @autoBind and add missing @computed
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruslan Forostianov committed Oct 21, 2020
1 parent 29b57de commit 9b7c236
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions src/pages/patientView/timeline2/VAFChartWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import {
yValueScaleFunction,
} from './VAFChartUtils';
import { VAFChartHeader } from './VAFChartHeader';
import autobind from 'autobind-decorator';
import {
EllipsisTextTooltip,
stringListToIndexSet,
Expand Down Expand Up @@ -94,8 +93,6 @@ export default class VAFChartWrapper extends React.Component<
const wrapperStore = new TimelineWrapperStore();

this.wrapperStore = new TimelineWrapperStore();

(window as any).store = this.store;
}

/** ticks dependencies **/
Expand Down Expand Up @@ -282,18 +279,15 @@ export default class VAFChartWrapper extends React.Component<
);
}

groupColor(sampleId: string) {
return this.wrapperStore.groupingByIsSelected &&
this.numGroupByGroups > 1
? this.groupColorBySampleId(sampleId)
: 'rgb(0,0,0)';
}

@autobind
groupColorBySampleId(sampleId: string) {
return this.clinicalValueToColor[
this.sampleIdToClinicalValue[sampleId]
];
@computed get groupColor() {
return (sampleId: string) => {
return this.wrapperStore.groupingByIsSelected &&
this.numGroupByGroups > 1
? this.clinicalValueToColor[
this.sampleIdToClinicalValue[sampleId]
]
: 'rgb(0,0,0)';
};
}

@computed get clinicalValueToColor() {
Expand All @@ -309,7 +303,6 @@ export default class VAFChartWrapper extends React.Component<
return clinicalValueToColor;
}

@autobind
sampleIcons(sampleIds: string[]) {
const sampleidsByXCoordinate = _.groupBy(
sampleIds,
Expand Down Expand Up @@ -341,7 +334,6 @@ export default class VAFChartWrapper extends React.Component<
return <g>{sampleIcons}</g>;
}

@autobind
groupByTrackLabel(groupIndex: number) {
return (
<EllipsisTextTooltip
Expand All @@ -356,7 +348,6 @@ export default class VAFChartWrapper extends React.Component<
);
}

@autobind
groupColorByGroupIndex(groupIndex: number) {
return this.wrapperStore.groupingByIsSelected &&
this.numGroupByGroups > 1
Expand Down

0 comments on commit 9b7c236

Please sign in to comment.