Skip to content

Commit

Permalink
Configure timeline changes for cdsi data release (#5060)
Browse files Browse the repository at this point in the history
* Disable datadog tracking

* add line chart track for mskcc measurements track
  • Loading branch information
alisman authored Dec 5, 2024
1 parent 209c834 commit 00337ba
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 14 deletions.
16 changes: 8 additions & 8 deletions src/appBootstrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,14 @@ $(document).ready(async () => {

initializeAppStore(stores.appStore);

if (
['genie-public-portal', 'public-portal'].includes(
stores.appStore.serverConfig.app_name!
) &&
!isWebdriver()
) {
enableDataDogTracking(stores.appStore);
}
// if (
// ['genie-public-portal', 'public-portal'].includes(
// stores.appStore.serverConfig.app_name!
// ) &&
// !isWebdriver()
// ) {
// enableDataDogTracking(stores.appStore);
// }

await loadCustomJs();

Expand Down
34 changes: 28 additions & 6 deletions src/pages/patientView/timeline/timeline_helpers.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import {
formatDate,
getAttributeValue,
renderStack,
renderSuperscript,
TIMELINE_TRACK_HEIGHT,
ITimelineConfig,
POINT_COLOR,
TimelineEvent,
TimelineLegendItem,
TimelineTrackSpecification,
TimelineTrackType,
ITimelineConfig,
POINT_COLOR,
} from 'cbioportal-clinical-timeline';
import {
getEventColor,
Expand All @@ -24,7 +22,6 @@ import { ISampleMetaDeta } from 'pages/patientView/timeline/TimelineWrapper';
import { ClinicalEvent } from 'cbioportal-ts-api-client';
import { getColor } from 'cbioportal-frontend-commons';
import ReactMarkdown from 'react-markdown';
import { TimelineLegendItem } from 'cbioportal-clinical-timeline';

const OTHER = 'Other';

Expand Down Expand Up @@ -110,6 +107,31 @@ export function configureTimelineToxicityColors(baseConfig: ITimelineConfig) {
'TOX_OTHER_SPECIFY',
]);

baseConfig.trackStructures!.push(['MEASUREMENTS', 'TEST']);

baseConfig.trackEventRenderers?.push({
trackTypeMatch: /BMI/i,
configureTrack: (cat: TimelineTrackSpecification) => {
// psaTrack.trackType = TimelineTrackType.LINE_CHART;
// psaTrack.getLineChartValue = (e: TimelineEvent) => {}
cat.trackType = TimelineTrackType.LINE_CHART;
cat.getLineChartValue = (e: TimelineEvent) => {
try {
const val = e?.event?.attributes?.find(
e => e.key === 'RESULT'
)?.value;
if (val !== undefined) {
return parseFloat(val);
} else {
return null;
}
} catch (ex) {
return null;
}
};
},
});

baseConfig.eventColorGetter = function(e: TimelineEvent) {
const grade = e.event.attributes.find(
(att: any) => att.key === 'GRADE'
Expand Down

0 comments on commit 00337ba

Please sign in to comment.