Skip to content

Commit

Permalink
fix non working gene data
Browse files Browse the repository at this point in the history
  • Loading branch information
keckelt committed Sep 25, 2023
1 parent 5e1788e commit 385e66f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Taskview/SearchBar.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { select } from 'd3v7';
import { IServerColumn } from 'visyn_core/base';
import { IdTextPair, RestBaseUtils } from 'tdp_core';
import { dataTypes, depletion, IDataSubtypeConfig, IDataTypeConfig } from 'tdp_publicdb';
import { dataTypes, depletion, IDataSubtypeConfig, IDataTypeConfig, mutation } from 'tdp_publicdb';
import { colors } from '../config/colors';
import { deepCopy, getAnimatedLoadingText, log } from '../util';
import { niceName } from '../utils/labels';
Expand Down Expand Up @@ -297,17 +297,19 @@ export class SearchBar {
}
})
.on('mouseover', (event, d) => {
// store in separate variable to keep the reference around for the mouseOverHandlers
const hoveredElement = event.currentTarget as HTMLElement;
if (d.optionType === 'gene') {
// set global optionId
this._geneHoverOptionId = d.optionId;
setTimeout(() => {
// update detail after timeout time global and current optionId is equal
if (d.optionId === this._geneHoverOptionId) {
this._mouseOverHandler(d, event.currentTarget);
this._mouseOverHandler(d, hoveredElement);
}
}, 200);
} else {
this._mouseOverHandler(d, event.currentTarget);
this._mouseOverHandler(d, hoveredElement);
}
})
.on('mouseout', (event, d) => {
Expand Down Expand Up @@ -934,7 +936,7 @@ export class SearchBar {
.html((v: IDataSubtypeConfig) => v.name)
.on('click', (event, v: IDataSubtypeConfig) => {
// merge subtype with the with d as the d.name is only available in the d variable
const dataSubType = { ...d, v };
const dataSubType = { ...d, ...v };
const badgeName = this._composeGeneDataTypeName(data.optionText, dataSubType.name);
const badgeData = deepCopy(data);
badgeData.optionData = { subType: dataSubType, type: (dataSubType as any).dataTypeId };
Expand Down

0 comments on commit 385e66f

Please sign in to comment.