Skip to content

Commit c0fa402

Browse files
Remove date under home page search bar (#1549)
1 parent acf7a49 commit c0fa402

File tree

7 files changed

+77
-16
lines changed

7 files changed

+77
-16
lines changed

public-ui/src/app/data-browser/cdr-version/cdr-version-info.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ export class CdrVersionReactComponent extends React.Component<{}, State> {
5252
<style>{style}</style>
5353
<span className="result-body-item cdr-info">
5454
Data includes {Number(numParticipants).toLocaleString()}{" "}
55-
participants as of {creationTime.getMonth() + 1}/
56-
{creationTime.getDate()}/{creationTime.getFullYear()}.
55+
participants
5756
</span>
5857
</React.Fragment>
5958
)

public-ui/src/app/data-browser/components/heat-map/heat-map.component.tsx

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,15 @@ export const HeatMapReactComponent =
9797
formatter: function () {
9898
const value = this.point.value <= 20 ? '≤ 20' : this.point.value.toLocaleString();
9999
const total = this.series.chart.userOptions.totalValue || 1;
100-
const percentage = ((this.point.value / total) * 100).toFixed(1);
100+
const percentage = (this.point.value / total) * 100;
101+
102+
// In the map tooltip, let’s display < 0.1% instead of 0.0 when a value is less than 0.05 (looks like standard rounding)
103+
const percentageDisplay = percentage < 0.05 ? '< 0.1%' : `${percentage.toFixed(1)}%`;
101104

102105
const tooltipText = `
103106
<div style="text-align: center;">
104107
<div style="font-weight: bold; margin-bottom: 4px;">${this.point.name}</div>
105-
<div>${value} participants | ${percentage}%</div>
108+
<div>${value} participants | ${percentageDisplay}</div>
106109
</div>
107110
`;
108111
return tooltipText;
@@ -220,9 +223,13 @@ export const HeatMapReactComponent =
220223
const total = this.calculateTotal(chartObj.series[0].data);
221224
(chartObj.userOptions as any).totalValue = total;
222225

223-
// Reapply territory colors
226+
// Clear old event listeners by resetting the domPathsByGroup
227+
this.clearEventListeners();
228+
229+
// Reapply territory colors and setup event listeners
224230
setTimeout(() => {
225231
this.applyTerritoryColors();
232+
this.setupEventListeners();
226233
}, 100);
227234
}
228235
}
@@ -292,6 +299,7 @@ export const HeatMapReactComponent =
292299
pathEl.replaceWith(pathEl.cloneNode(true));
293300
});
294301
});
302+
this.clearEventListeners();
295303
}
296304

297305
handleMouseEnterGroup(groupName) {
@@ -401,6 +409,20 @@ export const HeatMapReactComponent =
401409
series.chart.redraw();
402410
}
403411

412+
clearEventListeners() {
413+
// Remove old event listeners and clear the domPathsByGroup
414+
Object.keys(this.domPathsByGroup).forEach(groupName => {
415+
const paths = this.domPathsByGroup[groupName];
416+
paths.forEach(pathEl => {
417+
// Clone node to remove all event listeners
418+
const newPath = pathEl.cloneNode(true);
419+
pathEl.parentNode?.replaceChild(newPath, pathEl);
420+
});
421+
// Clear the array
422+
this.domPathsByGroup[groupName] = [];
423+
});
424+
}
425+
404426
render() {
405427
return (<>
406428
<style>{style}</style>

public-ui/src/app/data-browser/views/sv-genomic-view/components/consequence-gene-display-component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ render() {
9191
<div style={{ whiteSpace: "pre-line", marginTop: "4px" }}>
9292
{firstEntry && (
9393
<div className="consequence-item">
94-
<i>{firstEntry[0]}:</i>{" "}
94+
<i>{firstEntry[0].toLowerCase()}:</i>{" "}
9595
<span style={{ display: "inline" }}>
9696
{showAll ? firstEntry[1].join(", ") : truncatedGeneStr}
9797
{!showAll && (shouldTruncate || consequenceEntries.length > 1) && (
@@ -110,7 +110,7 @@ render() {
110110
{showAll &&
111111
restEntries.map(([label, genes], idx) => (
112112
<div key={idx} className="consequence-item">
113-
<i>{label}:</i> {genes.join(", ")}
113+
<i>{label.toLowerCase()}:</i> {genes.join(", ")}
114114
</div>
115115
))}
116116

public-ui/src/app/data-browser/views/sv-genomic-view/components/sv-variant-expanded.component.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ export class SVVariantExpandedComponent extends React.Component<Props, State> {
263263
<span style={styles.catHeading}>Size:</span>
264264
<br />
265265
<span style={styles.catInfo}>
266-
{variantDetails.size ? variantDetails.size : "-"}
266+
{(variantDetails.variantType?.includes('CTX') || variantDetails.variantType?.includes('BND'))
267+
? 'N/A'
268+
: (variantDetails.size != null && variantDetails.size >= 0 ? variantDetails.size : '-')}
267269
</span>
268270
</div>
269271
<div>

public-ui/src/app/data-browser/views/sv-genomic-view/components/sv-variant-filter-chips.component.tsx

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export class SVVariantFilterChips extends React.Component<Props, State> {
6060
}
6161

6262
formatChips(filteredMetadata): Array<any> {
63+
console.log('formatChips - filteredMetadata:', filteredMetadata);
6364
const displayArr = [];
6465
for (const key in filteredMetadata) {
6566
if (
@@ -79,10 +80,12 @@ export class SVVariantFilterChips extends React.Component<Props, State> {
7980
el.max = +el.max.toFixed(2);
8081
}
8182
}
83+
console.log(`formatChips - Adding chip for ${key}:`, el);
8284
displayArr.push({ cat: key, data: el });
8385
}
8486
}
8587
}
88+
console.log('formatChips - displayArr:', displayArr);
8689
return displayArr;
8790
}
8891

@@ -92,12 +95,20 @@ export class SVVariantFilterChips extends React.Component<Props, State> {
9295
snapshot?: any
9396
): void {
9497
if (prevProps !== this.props) {
95-
this.setState({ chips: this.formatChips(this.props.filteredMetadata) });
98+
console.log('componentDidUpdate - prevProps.filteredMetadata:', prevProps.filteredMetadata);
99+
console.log('componentDidUpdate - this.props.filteredMetadata:', this.props.filteredMetadata);
100+
const formattedChips = this.formatChips(this.props.filteredMetadata);
101+
console.log('componentDidUpdate - formattedChips:', formattedChips);
102+
this.setState({ chips: formattedChips });
96103
}
97104
}
98105

99106
removeChip(item, cat) {
107+
console.log('removeChip - item:', item);
108+
console.log('removeChip - cat:', cat);
100109
const { filteredMetadata } = this.props;
110+
console.log('removeChip - filteredMetadata before:', JSON.parse(JSON.stringify(filteredMetadata)));
111+
101112
if (filteredMetadata[cat.toString()].hasOwnProperty("filterActive")) {
102113
filteredMetadata[cat.toString()].items = filteredMetadata[
103114
cat.toString()
@@ -113,12 +124,13 @@ export class SVVariantFilterChips extends React.Component<Props, State> {
113124
const originalFilterMetadata = JSON.parse(
114125
localStorage.getItem("svOriginalFilterMetadata") || "{}"
115126
);
127+
console.log('removeChip - originalFilterMetadata:', originalFilterMetadata);
116128
filteredMetadata[cat.toString()].min =
117129
originalFilterMetadata[cat.toString()].min;
118130
filteredMetadata[cat.toString()].max =
119131
originalFilterMetadata[cat.toString()].max;
120132
} catch (e) {
121-
console.log("Error");
133+
console.log("Error loading original filter metadata:", e);
122134
}
123135
}
124136
const allFalse =
@@ -131,15 +143,18 @@ export class SVVariantFilterChips extends React.Component<Props, State> {
131143
) {
132144
filteredMetadata[cat.toString()].filterActive = false;
133145
}
146+
console.log('removeChip - filteredMetadata after:', JSON.parse(JSON.stringify(filteredMetadata)));
134147
this.props.onChipChange(filteredMetadata);
135148
}
136149

137150
render() {
138151
const { chips } = this.state;
152+
console.log('render - chips:', chips);
139153
return (
140154
<div style={styles.chipFormat}>
141155
{chips.length > 0 &&
142156
chips.map((el, count) => {
157+
console.log(`render - chip ${count}:`, el);
143158
if (el.data.hasOwnProperty("filterActive")) {
144159
return (
145160
<div key={count}>
@@ -148,9 +163,19 @@ export class SVVariantFilterChips extends React.Component<Props, State> {
148163
<div style={styles.chipCat}>
149164
{lables[el.cat.toString()]}
150165
{el.data.items.map((item, i) => {
151-
const chipLabel = item.option
166+
let chipLabel = item.option
152167
? item.option
153168
: "(undefined)";
169+
170+
// Remove < and > brackets for variant type display only
171+
if (el.cat === 'variantType') {
172+
chipLabel = chipLabel.replace(/[<>]/g, '');
173+
}
174+
if (el.cat === 'consequence') {
175+
chipLabel = chipLabel.trim().toLowerCase();
176+
}
177+
178+
console.log(`render - chip item ${count}-${i}:`, item, 'label:', chipLabel);
154179
return (
155180
<div style={styles.chipLayout} key={i}>
156181
{item.checked && (
@@ -214,4 +239,4 @@ export class SVVariantFilterChips extends React.Component<Props, State> {
214239
</div>
215240
);
216241
}
217-
}
242+
}

public-ui/src/app/data-browser/views/sv-genomic-view/components/sv-variant-filter-item.component.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,17 @@ export class SVVariantFilterItemComponent extends React.Component<
198198
</div> */}
199199
{filterItemState.items.map((item: any, index: number) => {
200200
const key = "option" + index;
201-
const itemLabel = item.option ? item.option : "(undefined)";
201+
let itemLabel = item.option ? item.option : "(undefined)";
202+
203+
// Remove < and > brackets for variant type display only
204+
if (category.field === 'variantType') {
205+
itemLabel = itemLabel.replace(/[<>]/g, '');
206+
}
207+
208+
if (category.field === 'consequence') {
209+
itemLabel = itemLabel.trim().toLowerCase();
210+
}
211+
202212
return (
203213
<span
204214
title={item.option}
@@ -237,4 +247,4 @@ export class SVVariantFilterItemComponent extends React.Component<
237247
</React.Fragment>
238248
);
239249
}
240-
}
250+
}

public-ui/src/app/data-browser/views/sv-genomic-view/components/sv-variant-row.component.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,15 @@ export class SVVariantRowComponent extends React.Component<Props, State> {
179179
</div>
180180
</div>
181181
<div style={styles.rowItem}>{this.replaceTag(variant.variantType)}</div>
182-
<div style={styles.rowItem}>{variant.consequence}</div>
182+
<div style={styles.rowItem}>
183+
{variant.consequence ? variant.consequence.toLowerCase() : variant.consequence}
184+
</div>
183185
<div style={styles.rowItem}>
184186
{variant.position ? `chr${variant.position.replace(/-chr/, ', chr')}` : "-"}
185187
</div>
186188
<div style={styles.rowItem}>
187-
{variant.size && variant.size >= 0 ? variant.size : ""}
189+
{(variant.variantType?.includes('CTX') || variant.variantType?.includes('BND'))
190+
? 'N/A' : (variant.size != null && variant.size >= 0 ? variant.size : '-')}
188191
</div>
189192
<div style={styles.rowItem}>{variant.alleleCount}</div>
190193
<div style={styles.rowItem}>{variant.alleleNumber}</div>

0 commit comments

Comments
 (0)