Skip to content

Commit

Permalink
Merge branch 'main' into bug/membership-table-search-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
jernestmyers committed Aug 23, 2023
2 parents 889ae77 + c90abd2 commit 920d6fd
Show file tree
Hide file tree
Showing 14 changed files with 3,777 additions and 2,668 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ jobs:
- uses: nrwl/nx-set-shas@v3
- run: yarn
- run: yarn nx affected --target=build-npm-modules --parallel=3
- run: yarn nx affected --target=compile:check
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export async function getDefaultOverlayConfig(
overlayVariable: overlayVariableDescriptor,
aggregationConfig: {
overlayType: 'categorical',
numeratorValues: numeratorValues ?? [],
numeratorValues:
numeratorValues ?? overlayVariable.vocabulary ?? [],
denominatorValues:
denominatorValues ?? overlayVariable.vocabulary ?? [],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,11 @@ class UserDatasetDetail extends React.Component {
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */

// This is needed to resolve downstream typescript errors.
// TypeScript infers that this method returns JSX.Element[].
// Some classes extending this will return (JSX.Element | null)[].
// The ReactNode type is better suited, here, since it allows for null values.
/** @return {import("react").ReactNode[]} */
getPageSections() {
return [
this.renderHeaderSection,
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
1 change: 1 addition & 0 deletions packages/sites/clinepi-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"clean": "rm -rf dist && mkdir dist",
"copy:webapp": "cp -r webapp/* dist",
"copy:images": "cp -r ../../../node_modules/@veupathdb/web-common/images dist",
"compile:check": "tsc --noEmit",
"bundle:dev": "npm-run-all clean copy:webapp copy:images && BROWSERSLIST_ENV=modern webpack --mode=development",
"bundle:npm": "npm-run-all clean copy:webapp copy:images && BROWSERSLIST_ENV=modern webpack --mode=production && BROWSERSLIST_ENV=legacy webpack --mode=production"
},
Expand Down
1 change: 1 addition & 0 deletions packages/sites/genomics-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"clean": "rm -rf dist && mkdir dist",
"copy:webapp": "cp -r webapp/* dist",
"copy:images": "cp -r ../../../node_modules/@veupathdb/web-common/images dist",
"compile:check": "tsc --noEmit",
"bundle:dev": "npm-run-all clean copy:webapp copy:images && BROWSERSLIST_ENV=modern webpack --mode=development",
"bundle:npm": "npm-run-all clean copy:webapp copy:images && BROWSERSLIST_ENV=modern webpack --mode=production && BROWSERSLIST_ENV=legacy webpack --mode=production"
},
Expand Down
1 change: 1 addition & 0 deletions packages/sites/mbio-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"clean": "rm -rf dist && mkdir dist",
"copy:webapp": "cp -r webapp/* dist",
"copy:images": "cp -r ../../../node_modules/@veupathdb/web-common/images dist",
"compile:check": "tsc --noEmit",
"bundle:dev": "npm-run-all clean copy:webapp copy:images && BROWSERSLIST_ENV=modern webpack --mode=development",
"bundle:npm": "npm-run-all clean copy:webapp copy:images && BROWSERSLIST_ENV=modern webpack --mode=production && BROWSERSLIST_ENV=legacy webpack --mode=production"
},
Expand Down
1 change: 1 addition & 0 deletions packages/sites/ortho-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"clean": "rm -rf dist && mkdir dist",
"copy:webapp": "cp -r webapp/* dist",
"copy:images": "cp -r ../../../node_modules/@veupathdb/web-common/images dist",
"compile:check": "tsc --noEmit",
"bundle:dev": "npm-run-all clean copy:webapp copy:images && BROWSERSLIST_ENV=modern webpack --mode=development",
"bundle:npm": "npm-run-all clean copy:webapp copy:images && BROWSERSLIST_ENV=modern webpack --mode=production && BROWSERSLIST_ENV=legacy webpack --mode=production"
},
Expand Down
Loading

0 comments on commit 920d6fd

Please sign in to comment.