Skip to content

Commit d6ed36b

Browse files
author
Harald Detering
committed
Fixed: linting issues.
1 parent fad644e commit d6ed36b

File tree

4 files changed

+8
-196
lines changed

4 files changed

+8
-196
lines changed

src/components/Gene/GeneExpressionGraph.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ const GeneExpressionGraph = ({ geneId, speciesId }) => {
276276
};
277277

278278
useEffect(() => {
279-
const params = getSearchParams();
280279
triggerInitialSearch();
281280
}, [geneId, speciesId, dataTypeExpr]);
282281

src/components/Heatmap/Renderer.jsx

Lines changed: 0 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export const Renderer = forwardRef(
2525
backgroundColor,
2626
marginLeft,
2727
xLabelRotation,
28-
yLabelJustify,
2928
showLegend,
3029
showMissingData,
3130
showDescMax,
@@ -187,42 +186,6 @@ export const Renderer = forwardRef(
187186
const w2 = cellWidth - w1;
188187
const x1 = x + w1;
189188

190-
// return (
191-
// <g id={`heatmapCell-${idx}`}>
192-
// <rect
193-
// key={`valueSelf-${idx}`}
194-
// x={x}
195-
// y={y}
196-
// width={w1}
197-
// height={cellHeight}
198-
// opacity={1}
199-
// fill={fillColour}
200-
// strokeWidth={4}
201-
// onMouseEnter={(e) => {
202-
// setHoveredCell(cellData);
203-
// }}
204-
// onMouseLeave={() => setHoveredCell(null)}
205-
// cursor="pointer"
206-
// />
207-
208-
// <rect
209-
// key={`valueDesc-${idx}`}
210-
// x={x1}
211-
// y={y}
212-
// width={w2}
213-
// height={cellHeight}
214-
// opacity={1}
215-
// fill={strokeColour}
216-
// strokeWidth={4}
217-
// onMouseEnter={(e) => {
218-
// setHoveredCell(cellData);
219-
// }}
220-
// onMouseLeave={() => setHoveredCell(null)}
221-
// cursor="pointer"
222-
// />
223-
// </g>
224-
// );
225-
226189
switch (showDescMax) {
227190
case 'border':
228191
return (
@@ -417,78 +380,6 @@ export const Renderer = forwardRef(
417380
);
418381
});
419382

420-
const yLabels = yLblOrdered.map((term, i) => {
421-
const y = yScale(term.label);
422-
423-
if (!y) {
424-
return null;
425-
}
426-
427-
const idx = i;
428-
// Calculate x position based on yLabelJustify
429-
const xPos = yLabelJustify === 'left' ? -1 * marginLeft : -5;
430-
const anchor = yLabelJustify === 'left' ? 'start' : 'end';
431-
// Calculate y position
432-
const yPos = y + yScale.bandwidth() / 2;
433-
// Change display depending on hierarchical level
434-
let lblTree = '';
435-
let lblIndicator = '';
436-
const lblTerm = term.label;
437-
if (term.depth > 0) {
438-
if (term.isTopLevelTerm) {
439-
lblIndicator = '?'; // '(?)';
440-
if (term.isExpanded)
441-
lblIndicator = '\u{025B3}'; // '^'
442-
// else if(term.hasBeenQueried) lblIndicator = '\u{025BD}'; // 'v';
443-
else lblIndicator = '<'; // 'v';
444-
}
445-
446-
if (yLabelJustify === 'left') {
447-
lblTree = `${'-'.repeat(2 * term.depth)}${lblIndicator} ${term.label}`;
448-
} else {
449-
let suffix = '';
450-
for (let lvl = 1; lvl <= term.depth; lvl += 1) {
451-
if (lvl === term.depth) {
452-
if (term.isLastChild) {
453-
suffix = `\u{02500}\u{02518}${suffix}`; // lower-right corner
454-
} else {
455-
// postfix = `\u{02500}\u{02525}${postfix}`;
456-
suffix = `\u{02500}\u{02524}${suffix}`; // t-crossing left
457-
}
458-
} else if (term.embeddedInLvls.includes(lvl)) {
459-
// postfix = `\u{02500}\u{02502}${postfix}`;
460-
suffix = `\u{000A0}\u{02502}${suffix}`; // vertical line
461-
} else {
462-
suffix = `\u{000A0}\u{000A0}${suffix}`; // blank space
463-
}
464-
}
465-
// displayText = `${term.label} ${indicator}${'-'.repeat(2*term.depth)}`;
466-
lblTree = `${suffix}`;
467-
}
468-
}
469-
// console.log(`[Renderer] yLabel: ${JSON.stringify(term)}`);
470-
471-
// term.label + '\u{02518}' // '.'.repeat(2*term.depth);
472-
// term.label + ' '.repeat(2*term.depth);
473-
474-
return (
475-
<text
476-
key={`heatMapYLabel-${idx}`}
477-
x={xPos}
478-
y={yPos}
479-
textAnchor={anchor}
480-
dominantBaseline="middle"
481-
fontSize={15}
482-
fontFamily="monospace"
483-
onClick={() => onToggleExpandCollapse(term)}
484-
>
485-
<tspan fontFamily="sans-serif">{lblTerm} </tspan>
486-
<tspan fill="red">{lblIndicator}</tspan>
487-
{lblTree}
488-
</text>
489-
);
490-
});
491-
492383
// const [min = 0, max = 0] = d3.extent(data.map((d) => d.value)); // extent can return [undefined, undefined], default to [0,0] to fix types
493384
const domain = colorScale.domain();
494385
const max = domain[domain.length - 1];

src/pages/search/expressionmatrix/components/Heatmap/Renderer.jsx

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export const Renderer = forwardRef(
2828
backgroundColor,
2929
marginLeft,
3030
xLabelRotation,
31-
yLabelJustify,
3231
showLegend,
3332
showMissingData,
3433
showDescMax,
@@ -388,78 +387,6 @@ export const Renderer = forwardRef(
388387
);
389388
});
390389

391-
const yLabels = yLblOrdered.map((term, i) => {
392-
const y = yScale(term.label);
393-
394-
if (!y) {
395-
return null;
396-
}
397-
398-
const idx = i;
399-
// Calculate x position based on yLabelJustify
400-
const xPos = yLabelJustify === 'left' ? -1 * marginLeft : -5;
401-
const anchor = yLabelJustify === 'left' ? 'start' : 'end';
402-
// Calculate y position
403-
const yPos = y + yScale.bandwidth() / 2;
404-
// Change display depending on hierarchical level
405-
let lblTree = '';
406-
let lblIndicator = '';
407-
const lblTerm = term.label;
408-
if (term.depth > 0) {
409-
if (term.isTopLevelTerm) {
410-
lblIndicator = '?'; // '(?)';
411-
if (term.isExpanded)
412-
lblIndicator = '\u{025B3}'; // '^'
413-
// else if(term.hasBeenQueried) lblIndicator = '\u{025BD}'; // 'v';
414-
else lblIndicator = '<'; // 'v';
415-
}
416-
417-
if (yLabelJustify === 'left') {
418-
lblTree = `${'-'.repeat(2 * term.depth)}${lblIndicator} ${term.label}`;
419-
} else {
420-
let suffix = '';
421-
for (let lvl = 1; lvl <= term.depth; lvl += 1) {
422-
if (lvl === term.depth) {
423-
if (term.isLastChild) {
424-
suffix = `\u{02500}\u{02518}${suffix}`; // lower-right corner
425-
} else {
426-
// postfix = `\u{02500}\u{02525}${postfix}`;
427-
suffix = `\u{02500}\u{02524}${suffix}`; // t-crossing left
428-
}
429-
} else if (term.embeddedInLvls.includes(lvl)) {
430-
// postfix = `\u{02500}\u{02502}${postfix}`;
431-
suffix = `\u{000A0}\u{02502}${suffix}`; // vertical line
432-
} else {
433-
suffix = `\u{000A0}\u{000A0}${suffix}`; // blank space
434-
}
435-
}
436-
// displayText = `${term.label} ${indicator}${'-'.repeat(2*term.depth)}`;
437-
lblTree = `${suffix}`;
438-
}
439-
}
440-
// console.log(`[Renderer] yLabel: ${JSON.stringify(term)}`);
441-
442-
// term.label + '\u{02518}' // '.'.repeat(2*term.depth);
443-
// term.label + ' '.repeat(2*term.depth);
444-
445-
return (
446-
<text
447-
key={`heatMapYLabel-${idx}`}
448-
x={xPos}
449-
y={yPos}
450-
textAnchor={anchor}
451-
dominantBaseline="middle"
452-
fontSize={15}
453-
fontFamily="monospace"
454-
onClick={() => onToggleExpandCollapse(term)}
455-
>
456-
<tspan fontFamily="sans-serif">{lblTerm} </tspan>
457-
<tspan fill="red">{lblIndicator}</tspan>
458-
{lblTree}
459-
</text>
460-
);
461-
});
462-
463390
const domain = colorScale.domain();
464391
const max = domain[domain.length - 1];
465392

src/pages/search/expressionmatrix/useLogic.jsx

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,14 +1208,15 @@ const useLogic = (isExprCalls) => {
12081208
if (resp2.resp.code === 200) {
12091209
// console.log(`[useLogic.initFromUrlParams] detailed RP resp:\n${JSON.stringify(resp2, null, 2)}`);
12101210
const { requestDetails } = resp2.resp.data;
1211-
const { requestedSpecies, requestedGenes, requestedAnatEntitesAndCellTypes } = requestDetails;
1212-
const { anat_entity_id: anatEntityId, cell_type_id: cellTypeId } = resp2.resp.requestParameters;
1211+
//const { requestedSpecies, requestedGenes, requestedAnatEntitesAndCellTypes } = requestDetails;
1212+
const { requestedSpecies, requestedGenes } = requestDetails;
1213+
// const { anat_entity_id: anatEntityId, cell_type_id: cellTypeId } = resp2.resp.requestParameters;
12131214
// Find the requestedAnatEntitesAndCellTypes that matches the anatEntityId
1214-
const requestedAnatEntities =
1215-
requestedAnatEntitesAndCellTypes?.filter((term) => anatEntityId?.includes(term.id)) || [];
1215+
// const requestedAnatEntities =
1216+
// requestedAnatEntitesAndCellTypes?.filter((term) => anatEntityId?.includes(term.id)) || [];
12161217

1217-
const requestedCellTypes =
1218-
requestedAnatEntitesAndCellTypes?.filter((term) => cellTypeId?.includes(term.id)) || [];
1218+
// const requestedCellTypes =
1219+
// requestedAnatEntitesAndCellTypes?.filter((term) => cellTypeId?.includes(term.id)) || [];
12191220

12201221
// Use wrapper for species initialization
12211222
if (requestedSpecies) {
@@ -1271,7 +1272,6 @@ const useLogic = (isExprCalls) => {
12711272

12721273
const searchParams = new URLSearchParams(loc.search);
12731274
const geneList = searchParams.get('gene_list');
1274-
const speciesId = searchParams.get('species_id');
12751275
if (geneList) {
12761276
processGeneList(geneList);
12771277
} else if (!loc.search && !isFirstSearch && !isLoading) {
@@ -1356,7 +1356,7 @@ const useLogic = (isExprCalls) => {
13561356
};
13571357

13581358
// Add function to process gene list
1359-
const processGeneList = async (geneListParam, speciesId) => {
1359+
const processGeneList = async (geneListParam) => {
13601360
if (!geneListParam) return;
13611361

13621362
setIsProcessingGeneList(true);
@@ -1371,11 +1371,6 @@ const useLogic = (isExprCalls) => {
13711371
(result) => result.code === 200 && result.data.result.totalMatchCount === 1
13721372
);
13731373

1374-
// Verify all genes are from same species
1375-
const allSameSpecies = validResults.every(
1376-
(result) => result.data.result.geneMatches[0].gene.species.id === firstSpecies.id
1377-
);
1378-
13791374
// Set species
13801375
const speciesValue = {
13811376
label: getSpeciesLabel(firstSpecies),

0 commit comments

Comments
 (0)