Skip to content

Commit 9b7c236

Browse files
author
Ruslan Forostianov
committed
Remove unused @autoBind and add missing @computed
1 parent 29b57de commit 9b7c236

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

src/pages/patientView/timeline2/VAFChartWrapper.tsx

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import {
3535
yValueScaleFunction,
3636
} from './VAFChartUtils';
3737
import { VAFChartHeader } from './VAFChartHeader';
38-
import autobind from 'autobind-decorator';
3938
import {
4039
EllipsisTextTooltip,
4140
stringListToIndexSet,
@@ -94,8 +93,6 @@ export default class VAFChartWrapper extends React.Component<
9493
const wrapperStore = new TimelineWrapperStore();
9594

9695
this.wrapperStore = new TimelineWrapperStore();
97-
98-
(window as any).store = this.store;
9996
}
10097

10198
/** ticks dependencies **/
@@ -282,18 +279,15 @@ export default class VAFChartWrapper extends React.Component<
282279
);
283280
}
284281

285-
groupColor(sampleId: string) {
286-
return this.wrapperStore.groupingByIsSelected &&
287-
this.numGroupByGroups > 1
288-
? this.groupColorBySampleId(sampleId)
289-
: 'rgb(0,0,0)';
290-
}
291-
292-
@autobind
293-
groupColorBySampleId(sampleId: string) {
294-
return this.clinicalValueToColor[
295-
this.sampleIdToClinicalValue[sampleId]
296-
];
282+
@computed get groupColor() {
283+
return (sampleId: string) => {
284+
return this.wrapperStore.groupingByIsSelected &&
285+
this.numGroupByGroups > 1
286+
? this.clinicalValueToColor[
287+
this.sampleIdToClinicalValue[sampleId]
288+
]
289+
: 'rgb(0,0,0)';
290+
};
297291
}
298292

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

312-
@autobind
313306
sampleIcons(sampleIds: string[]) {
314307
const sampleidsByXCoordinate = _.groupBy(
315308
sampleIds,
@@ -341,7 +334,6 @@ export default class VAFChartWrapper extends React.Component<
341334
return <g>{sampleIcons}</g>;
342335
}
343336

344-
@autobind
345337
groupByTrackLabel(groupIndex: number) {
346338
return (
347339
<EllipsisTextTooltip
@@ -356,7 +348,6 @@ export default class VAFChartWrapper extends React.Component<
356348
);
357349
}
358350

359-
@autobind
360351
groupColorByGroupIndex(groupIndex: number) {
361352
return this.wrapperStore.groupingByIsSelected &&
362353
this.numGroupByGroups > 1

0 commit comments

Comments
 (0)