Skip to content

Commit

Permalink
show method in volcano subtitle
Browse files Browse the repository at this point in the history
  • Loading branch information
asizemore committed Oct 9, 2023
1 parent c32876f commit 6f86d50
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import {
GetBinRangesProps,
getBinRanges,
} from '../../../../map/analysis/utils/defaultOverlayConfig';
import { config } from 'process';

const cx = makeClassNameHelper('AppStepConfigurationContainer');

Expand Down Expand Up @@ -91,7 +90,13 @@ export const plugin: ComputationPlugin = {
createDefaultConfiguration: () => undefined,
isConfigurationValid: isCompleteDifferentialAbundanceConfig,
visualizationPlugins: {
volcanoplot: volcanoPlotVisualization, // Must match name in data service and in visualization.tsx
volcanoplot: volcanoPlotVisualization.withOptions({
getPlotSubtitle(config) {
if (DifferentialAbundanceConfig.is(config)) {
return `Differential abundance computed using ${config.differentialAbundanceMethod} with default parameters.`;
}
},
}), // Must match name in data service and in visualization.tsx
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { createVisualizationPlugin } from '../VisualizationPlugin';
import LabelledGroup from '@veupathdb/components/lib/components/widgets/LabelledGroup';
import { NumberInput } from '@veupathdb/components/lib/components/widgets/NumberAndDateInputs';

import { LayoutOptions } from '../../layouts/types';
import { LayoutOptions, TitleOptions } from '../../layouts/types';
import { RequestOptions } from '../options/types';

// Volcano plot imports
Expand Down Expand Up @@ -54,6 +54,7 @@ import SliderWidget, {
import { ResetButtonCoreUI } from '../../ResetButton';
import AxisRangeControl from '@veupathdb/components/lib/components/plotControls/AxisRangeControl';
import { fixVarIdLabel } from '../../../utils/visualization';
import { OutputEntityTitle } from '../OutputEntityTitle';
// end imports

const DEFAULT_SIG_THRESHOLD = 0.05;
Expand Down Expand Up @@ -106,6 +107,7 @@ export const VolcanoPlotConfig = t.partial({

interface Options
extends LayoutOptions,
TitleOptions,
RequestOptions<VolcanoPlotConfig, {}, VolcanoPlotRequestParams> {}

// Volcano Plot Visualization
Expand Down Expand Up @@ -384,6 +386,11 @@ function VolcanoPlotViz(props: VisualizationProps<Options>) {
]
);

// plot subtitle
const plotSubtitle = options?.getPlotSubtitle?.(
computation.descriptor.configuration
);

// Add labels to the extremes of the x axis. These may change in the future based on the type
// of data. For example, for genes we may want to say Up regulated in...
const comparisonLabels =
Expand Down Expand Up @@ -627,12 +634,7 @@ function VolcanoPlotViz(props: VisualizationProps<Options>) {
/>
</LabelledGroup>

{/* This should be populated with info from the colections var. So like "Showing 1000 taxa blah". Waiting on collections annotations. */}
{/* <OutputEntityTitle
entity={outputEntity}
outputSize={outputSize}
subtitle={plotSubtitle}
/> */}
<OutputEntityTitle subtitle={plotSubtitle} />
<LayoutComponent
isFaceted={false}
legendNode={legendNode}
Expand Down

0 comments on commit 6f86d50

Please sign in to comment.