Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into map-collection-variab…
Browse files Browse the repository at this point in the history
…le-map-type
  • Loading branch information
dmfalke committed Aug 23, 2023
2 parents 8d9f506 + c90abd2 commit 7f7167b
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 9 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ COPY package.json package.json
COPY yarn.lock yarn.lock
COPY packages packages

ARG NODE_OPTIONS=--max-old-space-size=4096

# Build the client bundles
RUN echo "Building with NODE_OPTIONS=$NODE_OPTIONS"
RUN yarn \
&& yarn nx bundle:npm @veupathdb/clinepi-site \
&& yarn nx bundle:npm @veupathdb/genomics-site \
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
version: "3.5"

name: "web-client"

networks:
traefik:
external: true
Expand Down
16 changes: 11 additions & 5 deletions packages/libs/components/src/plots/VolcanoPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,17 @@ function VolcanoPlot(props: VolcanoPlotProps, ref: Ref<HTMLDivElement>) {
}}
>
<ul>
{data?.pointIDs?.map((id) => (
<li key={id}>
<span>{id}</span>
</li>
))}
{data?.displayLabels
? data.displayLabels.map((label) => (
<li key={label}>
<span>{label}</span>
</li>
))
: data?.pointIDs?.map((id) => (
<li key={id}>
<span>{id}</span>
</li>
))}
</ul>
<div
className="pseudo-hr"
Expand Down
2 changes: 2 additions & 0 deletions packages/libs/components/src/types/plots/volcanoplot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export type VolcanoPlotDataPoint = {
pointIDs?: string[];
// Used to determine color of data point in the plot
significanceColor?: string;
// Optional user-friendly label. One for each pointID
displayLabels?: string[];
};

export type VolcanoPlotData = Array<VolcanoPlotDataPoint>;
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import SliderWidget, {
} from '@veupathdb/components/lib/components/widgets/Slider';
import { ResetButtonCoreUI } from '../../ResetButton';
import AxisRangeControl from '@veupathdb/components/lib/components/plotControls/AxisRangeControl';
import { fixVarIdLabel } from '../../../utils/visualization';
// end imports

const DEFAULT_SIG_THRESHOLD = 0.05;
Expand Down Expand Up @@ -270,9 +271,18 @@ function VolcanoPlotViz(props: VisualizationProps<Options>) {
*/
.map((d) => {
const { pointID, ...remainingProperties } = d;
// Try to find a user-friendly label for the point. Note that pointIDs are in entityID.variableID format.
const displayLabel =
pointID &&
fixVarIdLabel(
pointID.split('.')[1],
pointID.split('.')[0],
entities
);
return {
...remainingProperties,
pointIDs: pointID ? [pointID] : undefined,
displayLabels: displayLabel ? [displayLabel] : undefined,
significanceColor: assignSignificanceColor(
Number(d.log2foldChange),
Number(d.pValue),
Expand All @@ -299,19 +309,24 @@ function VolcanoPlotViz(props: VisualizationProps<Options>) {
if (foundIndex === -1) {
aggregatedData.push(entry);
} else {
const { pointIDs } = aggregatedData[foundIndex];
const { pointIDs, displayLabels } = aggregatedData[foundIndex];
if (pointIDs) {
aggregatedData[foundIndex] = {
...aggregatedData[foundIndex],
pointIDs: [
...pointIDs,
...(entry.pointIDs ? entry.pointIDs : []),
],
displayLabels: displayLabels && [
...displayLabels,
...(entry.displayLabels ? entry.displayLabels : []),
],
};
} else {
aggregatedData[foundIndex] = {
...aggregatedData[foundIndex],
pointIDs: entry.pointIDs,
displayLabels: entry.displayLabels,
};
}
}
Expand Down
4 changes: 3 additions & 1 deletion packages/libs/wdk-client/src/Utils/UserPreferencesUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export async function getResultTableColumnsPref(

const [knownColumns, unknownColumns] = partition(
columns,
(columnName) => columnName in recordClass.attributesMap
(columnName) =>
recordClass.attributes.some((a) => a.name === columnName) ||
question.dynamicAttributes.some((a) => a.name === columnName)
);

if (unknownColumns.length > 0) {
Expand Down

0 comments on commit 7f7167b

Please sign in to comment.