diff --git a/packages/libs/coreui/src/components/containers/DraggablePanel/index.tsx b/packages/libs/coreui/src/components/containers/DraggablePanel/index.tsx index 8cdc54e2c6..25ccead962 100644 --- a/packages/libs/coreui/src/components/containers/DraggablePanel/index.tsx +++ b/packages/libs/coreui/src/components/containers/DraggablePanel/index.tsx @@ -23,6 +23,7 @@ export type DraggablePanelStyleOverrides = { resize?: CSSProperties['resize']; width?: CSSProperties['width']; zIndex?: CSSProperties['zIndex']; + overflow?: CSSProperties['overflow']; }; export type HeightAndWidthInPixels = { @@ -205,7 +206,7 @@ export default function DraggablePanel({ css={css` // Hey, so you need to explicitly set overflow wherever // you plan to use resize. - overflow: auto; + overflow: ${styleOverrides?.overflow ?? 'auto'}; resize: ${styleOverrides?.resize ?? 'none'}; border-radius: 7px; // We want the content to render below the drag handle, so let's put this diff --git a/packages/libs/eda/src/lib/core/components/layouts/FloatingLayout.tsx b/packages/libs/eda/src/lib/core/components/layouts/FloatingLayout.tsx index 0f454c7f0e..c616b7a11e 100644 --- a/packages/libs/eda/src/lib/core/components/layouts/FloatingLayout.tsx +++ b/packages/libs/eda/src/lib/core/components/layouts/FloatingLayout.tsx @@ -1,4 +1,5 @@ -import { CSSProperties } from 'react'; +import { FilledButton } from '@veupathdb/coreui'; +import { CSSProperties, useState } from 'react'; import { FloatingDiv } from '../../../map/analysis/FloatingDiv'; import { RequiredInputsPrompt } from './RequiredInputPrompts'; @@ -7,6 +8,7 @@ import { LayoutProps } from './types'; export interface Props extends LayoutProps { showRequiredInputsPrompt?: boolean; isMosaicPlot?: boolean; + hideControls?: boolean; } const defaultContainerStyles: CSSProperties = { @@ -27,15 +29,18 @@ export function FloatingLayout({ plotStyles, showRequiredInputsPrompt, isMosaicPlot, + hideControls, }: Props) { return (
- {showRequiredInputsPrompt && ( - - )} - {plotNode} - {controlsNode} +
+ {showRequiredInputsPrompt && ( + + )} + {plotNode} + {!hideControls && controlsNode} +
); diff --git a/packages/libs/eda/src/lib/core/components/layouts/types.ts b/packages/libs/eda/src/lib/core/components/layouts/types.ts index 33293dbdd5..30f272aed6 100644 --- a/packages/libs/eda/src/lib/core/components/layouts/types.ts +++ b/packages/libs/eda/src/lib/core/components/layouts/types.ts @@ -9,6 +9,7 @@ export interface LayoutProps { plotStyles?: CSSProperties; tableGroupNode: ReactNode; tableGroupStyles?: CSSProperties; + hideControls?: boolean; } export type StyleProps

= Pick; diff --git a/packages/libs/eda/src/lib/core/components/visualizations/VisualizationTypes.ts b/packages/libs/eda/src/lib/core/components/visualizations/VisualizationTypes.ts index fb6526d1d1..38feaf1f16 100644 --- a/packages/libs/eda/src/lib/core/components/visualizations/VisualizationTypes.ts +++ b/packages/libs/eda/src/lib/core/components/visualizations/VisualizationTypes.ts @@ -12,6 +12,12 @@ import { } from '../../types/visualization'; import { JobStatus } from '../computations/ComputeJobStatusHook'; +export interface PlotContainerStyleOverrides + extends Omit { + width?: number; + height?: number; +} + /** * Props passed to viz components */ @@ -31,6 +37,8 @@ export interface VisualizationProps { geoConfigs: GeoConfig[]; otherVizOverviews: VisualizationOverview[]; computeJobStatus?: JobStatus; + hideInputsAndControls?: boolean; + plotContainerStyleOverrides?: PlotContainerStyleOverrides; } export interface IsEnabledInPickerParams { diff --git a/packages/libs/eda/src/lib/core/components/visualizations/VisualizationsContainer.tsx b/packages/libs/eda/src/lib/core/components/visualizations/VisualizationsContainer.tsx index 9e22d56848..935586a7fa 100644 --- a/packages/libs/eda/src/lib/core/components/visualizations/VisualizationsContainer.tsx +++ b/packages/libs/eda/src/lib/core/components/visualizations/VisualizationsContainer.tsx @@ -44,6 +44,7 @@ import { RunComputeButton, StatusIcon } from '../computations/RunComputeButton'; import { JobStatus } from '../computations/ComputeJobStatusHook'; import { ComputationStepContainer } from '../computations/ComputationStepContainer'; import { ComputationPlugin } from '../computations/Types'; +import { PlotContainerStyleOverrides } from './VisualizationTypes'; const cx = makeClassNameHelper('VisualizationsContainer'); @@ -66,6 +67,8 @@ interface Props { createComputeJob?: () => void; /** optional dynamic plugins */ plugins?: Partial>; + hideInputsAndControls?: boolean; + plotContainerStyleOverrides?: PlotContainerStyleOverrides; } /** @@ -449,7 +452,9 @@ type FullScreenVisualizationPropKeys = | 'disableThumbnailCreation' | 'computeJobStatus' | 'createComputeJob' - | 'plugins'; + | 'plugins' + | 'hideInputsAndControls' + | 'plotContainerStyleOverrides'; interface FullScreenVisualizationProps extends Pick { @@ -479,6 +484,8 @@ export function FullScreenVisualization(props: FullScreenVisualizationProps) { computeJobStatus, createComputeJob, plugins = staticPlugins, + hideInputsAndControls, + plotContainerStyleOverrides, } = props; const themePrimaryColor = useUITheme()?.palette.primary; const history = useHistory(); @@ -643,20 +650,24 @@ export function FullScreenVisualization(props: FullScreenVisualizationProps) { ) : (

-

- { - if (value) - analysisState.updateVisualization({ - ...viz, - displayName: value, - }); - }} - /> -

-
{overview?.displayName}
- {plugin && analysisState.analysis && ( + {!hideInputsAndControls && ( + <> +

+ { + if (value) + analysisState.updateVisualization({ + ...viz, + displayName: value, + }); + }} + /> +

+
{overview?.displayName}
+ + )} + {!hideInputsAndControls && plugin && analysisState.analysis && (
@@ -741,6 +754,8 @@ export function FullScreenVisualization(props: FullScreenVisualizationProps) { geoConfigs={geoConfigs} otherVizOverviews={overviews.others} computeJobStatus={computeJobStatus} + hideInputsAndControls={hideInputsAndControls} + plotContainerStyleOverrides={plotContainerStyleOverrides} /> )}
diff --git a/packages/libs/eda/src/lib/core/components/visualizations/implementations/BarplotVisualization.tsx b/packages/libs/eda/src/lib/core/components/visualizations/implementations/BarplotVisualization.tsx index 95844b283a..0941d30d3e 100755 --- a/packages/libs/eda/src/lib/core/components/visualizations/implementations/BarplotVisualization.tsx +++ b/packages/libs/eda/src/lib/core/components/visualizations/implementations/BarplotVisualization.tsx @@ -191,11 +191,20 @@ function BarplotViz(props: VisualizationProps) { toggleStarredVariable, totalCounts, filteredCounts, + hideInputsAndControls, + plotContainerStyleOverrides, } = props; const studyMetadata = useStudyMetadata(); const { id: studyId } = studyMetadata; const entities = useStudyEntities(filters); const dataClient: DataClient = useDataClient(); + const finalPlotContainerStyles = useMemo( + () => ({ + ...plotContainerStyles, + ...plotContainerStyleOverrides, + }), + [plotContainerStyleOverrides] + ); // use useVizConfig hook const [vizConfig, updateVizConfig] = useVizConfig( @@ -632,7 +641,7 @@ function BarplotViz(props: VisualizationProps) { const plotRef = useUpdateThumbnailEffect( updateThumbnail, - plotContainerStyles, + finalPlotContainerStyles, // The dependencies for needing to generate a new thumbnail [ data, @@ -652,7 +661,9 @@ function BarplotViz(props: VisualizationProps) { // these props are passed to either a single plot // or by FacetedPlot to each individual facet plot (where some will be overridden) const plotProps: BarplotProps = { - containerStyles: !isFaceted(data.value) ? plotContainerStyles : undefined, + containerStyles: !isFaceted(data.value) + ? finalPlotContainerStyles + : undefined, spacingOptions: !isFaceted(data.value) ? plotSpacingOptions : undefined, orientation: 'vertical', barLayout: 'group', @@ -892,33 +903,37 @@ function BarplotViz(props: VisualizationProps) { return (
- + {!hideInputsAndControls && ( + + )}
- + {!hideInputsAndControls && ( + + )} ) { legendNode={showOverlayLegend ? legendNode : null} tableGroupNode={tableGroupNode} showRequiredInputsPrompt={!areRequiredInputsSelected} + hideControls={hideInputsAndControls} />
); diff --git a/packages/libs/eda/src/lib/core/components/visualizations/implementations/BoxplotVisualization.tsx b/packages/libs/eda/src/lib/core/components/visualizations/implementations/BoxplotVisualization.tsx index bcfafdff7a..a2c6da8061 100755 --- a/packages/libs/eda/src/lib/core/components/visualizations/implementations/BoxplotVisualization.tsx +++ b/packages/libs/eda/src/lib/core/components/visualizations/implementations/BoxplotVisualization.tsx @@ -196,11 +196,20 @@ function BoxplotViz(props: VisualizationProps) { totalCounts, filteredCounts, computeJobStatus, + hideInputsAndControls, + plotContainerStyleOverrides, } = props; const studyMetadata = useStudyMetadata(); const { id: studyId } = studyMetadata; const entities = useStudyEntities(filters); const dataClient: DataClient = useDataClient(); + const finalPlotContainerStyles = useMemo( + () => ({ + ...plotContainerStyles, + ...plotContainerStyleOverrides, + }), + [plotContainerStyleOverrides] + ); const [vizConfig, updateVizConfig] = useVizConfig( visualization.descriptor.configuration, @@ -689,7 +698,9 @@ function BoxplotViz(props: VisualizationProps) { // data.value data={data.value} updateThumbnail={updateThumbnail} - containerStyles={!isFaceted(data.value) ? plotContainerStyles : undefined} + containerStyles={ + !isFaceted(data.value) ? finalPlotContainerStyles : undefined + } spacingOptions={!isFaceted(data.value) ? plotSpacingOptions : undefined} orientation={'vertical'} displayLegend={false} @@ -879,38 +890,42 @@ function BoxplotViz(props: VisualizationProps) { return (
- + {!hideInputsAndControls && ( + + )}
- + {!hideInputsAndControls && ( + + )} ) { controlsNode={controlsNode} tableGroupNode={tableGroupNode} showRequiredInputsPrompt={!areRequiredInputsSelected} + hideControls={hideInputsAndControls} />
); diff --git a/packages/libs/eda/src/lib/core/components/visualizations/implementations/HistogramVisualization.tsx b/packages/libs/eda/src/lib/core/components/visualizations/implementations/HistogramVisualization.tsx index 079adf7c18..89e034f1ef 100755 --- a/packages/libs/eda/src/lib/core/components/visualizations/implementations/HistogramVisualization.tsx +++ b/packages/libs/eda/src/lib/core/components/visualizations/implementations/HistogramVisualization.tsx @@ -223,11 +223,20 @@ function HistogramViz(props: VisualizationProps) { toggleStarredVariable, totalCounts, filteredCounts, + hideInputsAndControls, + plotContainerStyleOverrides, } = props; const studyMetadata = useStudyMetadata(); const { id: studyId } = studyMetadata; const entities = useStudyEntities(filters); const dataClient: DataClient = useDataClient(); + const finalPlotContainerStyles = useMemo( + () => ({ + ...plotContainerStyles, + ...plotContainerStyleOverrides, + }), + [plotContainerStyleOverrides] + ); const [vizConfig, updateVizConfig] = useVizConfig( visualization.descriptor.configuration, @@ -981,7 +990,7 @@ function HistogramViz(props: VisualizationProps) { const plotRef = useUpdateThumbnailEffect( updateThumbnail, - plotContainerStyles, + finalPlotContainerStyles, [ data, vizConfig.checkedLegendItems, @@ -999,7 +1008,9 @@ function HistogramViz(props: VisualizationProps) { ); const histogramProps: HistogramProps = { - containerStyles: !isFaceted(data.value) ? plotContainerStyles : undefined, + containerStyles: !isFaceted(data.value) + ? finalPlotContainerStyles + : undefined, dependentAxisLogScale: vizConfig.dependentAxisLogScale, independentAxisLabel: variableDisplayWithUnit(xAxisVariable) ?? 'Main', dependentAxisLabel: @@ -1364,35 +1375,39 @@ function HistogramViz(props: VisualizationProps) { return (
- + {!hideInputsAndControls && ( + + )}
- + {!hideInputsAndControls && ( + + )} ) { legendNode={showOverlayLegend ? legendNode : null} tableGroupNode={tableGroupNode} showRequiredInputsPrompt={!areRequiredInputsSelected} + hideControls={hideInputsAndControls} />
diff --git a/packages/libs/eda/src/lib/core/components/visualizations/implementations/LineplotVisualization.tsx b/packages/libs/eda/src/lib/core/components/visualizations/implementations/LineplotVisualization.tsx index 9e1925e924..a10cc30c52 100755 --- a/packages/libs/eda/src/lib/core/components/visualizations/implementations/LineplotVisualization.tsx +++ b/packages/libs/eda/src/lib/core/components/visualizations/implementations/LineplotVisualization.tsx @@ -275,11 +275,20 @@ function LineplotViz(props: VisualizationProps) { toggleStarredVariable, totalCounts, filteredCounts, + hideInputsAndControls, + plotContainerStyleOverrides, } = props; const studyMetadata = useStudyMetadata(); const { id: studyId } = studyMetadata; const entities = useStudyEntities(filters); const dataClient: DataClient = useDataClient(); + const finalPlotContainerStyles = useMemo( + () => ({ + ...plotContainerStyles, + ...plotContainerStyleOverrides, + }), + [plotContainerStyleOverrides] + ); const [vizConfig, updateVizConfig] = useVizConfig( visualization.descriptor.configuration, @@ -995,7 +1004,7 @@ function LineplotViz(props: VisualizationProps) { const plotRef = useUpdateThumbnailEffect( updateThumbnail, - plotContainerStyles, + finalPlotContainerStyles, [ data, vizConfig.checkedLegendItems, @@ -1027,7 +1036,7 @@ function LineplotViz(props: VisualizationProps) { : 'Y-axis', displayLegend: false, containerStyles: !isFaceted(data.value?.dataSetProcess) - ? plotContainerStyles + ? finalPlotContainerStyles : undefined, spacingOptions: !isFaceted(data.value?.dataSetProcess) ? plotSpacingOptions @@ -1759,58 +1768,62 @@ function LineplotViz(props: VisualizationProps) { return (
- - - Y-axis aggregation{' '} - {vizConfig.yAxisVariable - ? categoricalMode - ? '(categorical Y)' - : '(continuous Y)' - : ''} + {!hideInputsAndControls && ( + + + Y-axis aggregation{' '} + {vizConfig.yAxisVariable + ? categoricalMode + ? '(categorical Y)' + : '(continuous Y)' + : ''} + + + + ), + order: 75, + content: vizConfig.yAxisVariable ? ( + aggregationInputs + ) : ( + + First choose a Y-axis variable. - - - ), - order: 75, - content: vizConfig.yAxisVariable ? ( - aggregationInputs - ) : ( - - First choose a Y-axis variable. - - ), - }, - ]} - entities={entities} - selectedVariables={selectedVariables} - onChange={handleInputVariableChange} - constraints={dataElementConstraints} - dataElementDependencyOrder={dataElementDependencyOrder} - starredVariables={starredVariables} - toggleStarredVariable={toggleStarredVariable} - enableShowMissingnessToggle={ - (overlayVariable != null || facetVariable != null) && - data.value?.completeCasesAllVars !== - data.value?.completeCasesAxesVars - } - showMissingness={vizConfig.showMissingness} - // this can be used to show and hide no data control - onShowMissingnessChange={ - computation.descriptor.type === 'pass' - ? onShowMissingnessChange - : undefined - } - outputEntity={outputEntity} - /> + ), + }, + ]} + entities={entities} + selectedVariables={selectedVariables} + onChange={handleInputVariableChange} + constraints={dataElementConstraints} + dataElementDependencyOrder={dataElementDependencyOrder} + starredVariables={starredVariables} + toggleStarredVariable={toggleStarredVariable} + enableShowMissingnessToggle={ + (overlayVariable != null || facetVariable != null) && + data.value?.completeCasesAllVars !== + data.value?.completeCasesAxesVars + } + showMissingness={vizConfig.showMissingness} + // this can be used to show and hide no data control + onShowMissingnessChange={ + computation.descriptor.type === 'pass' + ? onShowMissingnessChange + : undefined + } + outputEntity={outputEntity} + /> + )}
- + {!hideInputsAndControls && ( + + )} ) { controlsNode={controlsNode} tableGroupNode={tableGroupNode} showRequiredInputsPrompt={!areRequiredInputsSelected} + hideControls={hideInputsAndControls} />
); diff --git a/packages/libs/eda/src/lib/core/components/visualizations/implementations/MapVisualization.tsx b/packages/libs/eda/src/lib/core/components/visualizations/implementations/MapVisualization.tsx index d49f92eb71..a9a30d6f6a 100644 --- a/packages/libs/eda/src/lib/core/components/visualizations/implementations/MapVisualization.tsx +++ b/packages/libs/eda/src/lib/core/components/visualizations/implementations/MapVisualization.tsx @@ -113,6 +113,7 @@ function MapViz(props: VisualizationProps) { otherVizOverviews, starredVariables, toggleStarredVariable, + hideInputsAndControls, } = props; const studyMetadata = useStudyMetadata(); const { id: studyId } = studyMetadata; @@ -399,45 +400,57 @@ function MapViz(props: VisualizationProps) { justifyContent: 'space-between', }} > - {geoConfigs.length > 1 && ( - - Map the locations of - - + {!hideInputsAndControls && ( + <> + {geoConfigs.length > 1 && ( + + Map the locations of + + + )} + + )} - - + {!hideInputsAndControls && ( + + )} ) { * thus, we're directly coercing a boolean as to whether or not the required variable has been chosen */ showRequiredInputsPrompt={!vizConfig.xAxisVariable} + hideControls={hideInputsAndControls} /> ); diff --git a/packages/libs/eda/src/lib/core/components/visualizations/implementations/MosaicVisualization.tsx b/packages/libs/eda/src/lib/core/components/visualizations/implementations/MosaicVisualization.tsx index 2373b0ef95..a3f91c3681 100644 --- a/packages/libs/eda/src/lib/core/components/visualizations/implementations/MosaicVisualization.tsx +++ b/packages/libs/eda/src/lib/core/components/visualizations/implementations/MosaicVisualization.tsx @@ -88,10 +88,6 @@ const plotContainerStyles = { const plotSpacingOptions = {}; -const statsTableStyles = { - width: plotContainerStyles.width, -}; - const facetedStatsTableStyles = {}; const facetedStatsTableContainerStyles = { @@ -200,11 +196,20 @@ function MosaicViz(props: Props) { toggleStarredVariable, totalCounts, filteredCounts, + hideInputsAndControls, + plotContainerStyleOverrides, } = props; const studyMetadata = useStudyMetadata(); const { id: studyId } = studyMetadata; const entities = useStudyEntities(filters); const dataClient: DataClient = useDataClient(); + const finalPlotContainerStyles = useMemo( + () => ({ + ...plotContainerStyles, + ...plotContainerStyleOverrides, + }), + [plotContainerStyleOverrides] + ); // set default tab to Mosaic in TabbedDisplay component const [activeTab, setActiveTab] = useState( @@ -549,12 +554,14 @@ function MosaicViz(props: Props) { const plotRef = useUpdateThumbnailEffect( updateThumbnail, - plotContainerStyles, + finalPlotContainerStyles, [data] ); const mosaicProps: MosaicPlotProps = { - containerStyles: !isFaceted(data.value) ? plotContainerStyles : undefined, + containerStyles: !isFaceted(data.value) + ? finalPlotContainerStyles + : undefined, spacingOptions: !isFaceted(data.value) ? plotSpacingOptions : undefined, independentAxisLabel: xAxisLabel ?? 'X-axis', dependentAxisLabel: yAxisLabel ?? 'Y-axis', @@ -611,7 +618,7 @@ function MosaicViz(props: Props) { tableContainerStyles={ isFaceted(data.value) ? facetedStatsTableStyles - : statsTableStyles + : { width: finalPlotContainerStyles.width } } facetedContainerStyles={facetedStatsTableContainerStyles} independentVariable={xAxisLabel ?? 'X-axis'} @@ -982,36 +989,40 @@ function MosaicViz(props: Props) { )}
- + {!hideInputsAndControls && ( + + )}
- + {!hideInputsAndControls && ( + + )} ) { tableGroupNode={tableGroupNode} showRequiredInputsPrompt={!areRequiredInputsSelected} isMosaicPlot={true} + hideControls={hideInputsAndControls} />
diff --git a/packages/libs/eda/src/lib/core/components/visualizations/implementations/ScatterplotVisualization.tsx b/packages/libs/eda/src/lib/core/components/visualizations/implementations/ScatterplotVisualization.tsx index 2354c4795b..56676e2fae 100755 --- a/packages/libs/eda/src/lib/core/components/visualizations/implementations/ScatterplotVisualization.tsx +++ b/packages/libs/eda/src/lib/core/components/visualizations/implementations/ScatterplotVisualization.tsx @@ -272,12 +272,21 @@ function ScatterplotViz(props: VisualizationProps) { totalCounts, filteredCounts, computeJobStatus, + hideInputsAndControls, + plotContainerStyleOverrides, } = props; const studyMetadata = useStudyMetadata(); const { id: studyId } = studyMetadata; const entities = useStudyEntities(filters); const dataClient: DataClient = useDataClient(); + const finalPlotContainerStyles = useMemo( + () => ({ + ...plotContainerStyles, + ...plotContainerStyleOverrides, + }), + [plotContainerStyleOverrides] + ); const [vizConfig, updateVizConfig] = useVizConfig( visualization.descriptor.configuration, @@ -1198,7 +1207,7 @@ function ScatterplotViz(props: VisualizationProps) { const plotRef = useUpdateThumbnailEffect( updateThumbnail, - plotContainerStyles, + finalPlotContainerStyles, [ data, vizConfig.checkedLegendItems, @@ -1311,7 +1320,7 @@ function ScatterplotViz(props: VisualizationProps) { }, }, containerStyles: !isFaceted(data.value?.dataSetProcess) - ? plotContainerStyles + ? finalPlotContainerStyles : undefined, spacingOptions: !isFaceted(data.value?.dataSetProcess) ? plotSpacingOptions @@ -2044,29 +2053,31 @@ function ScatterplotViz(props: VisualizationProps) { return (
- + {!hideInputsAndControls && ( + + )}
) { ]} /> - + {!hideInputsAndControls && ( + + )} ) { controlsNode={controlsNode} tableGroupNode={tableGroupNode} showRequiredInputsPrompt={!areRequiredInputsSelected} + hideControls={hideInputsAndControls} />
); diff --git a/packages/libs/eda/src/lib/core/components/visualizations/implementations/VolcanoPlotVisualization.tsx b/packages/libs/eda/src/lib/core/components/visualizations/implementations/VolcanoPlotVisualization.tsx index f1e7c46ed9..3200e9d4e8 100755 --- a/packages/libs/eda/src/lib/core/components/visualizations/implementations/VolcanoPlotVisualization.tsx +++ b/packages/libs/eda/src/lib/core/components/visualizations/implementations/VolcanoPlotVisualization.tsx @@ -123,6 +123,8 @@ function VolcanoPlotViz(props: VisualizationProps) { filters, filteredCounts, computeJobStatus, + hideInputsAndControls, + plotContainerStyleOverrides, } = props; const studyMetadata = useStudyMetadata(); @@ -131,6 +133,13 @@ function VolcanoPlotViz(props: VisualizationProps) { const dataClient: DataClient = useDataClient(); const computationConfiguration: DifferentialAbundanceConfig = computation .descriptor.configuration as DifferentialAbundanceConfig; + const finalPlotContainerStyles = useMemo( + () => ({ + ...plotContainerStyles, + ...plotContainerStyleOverrides, + }), + [plotContainerStyleOverrides] + ); const [vizConfig, updateVizConfig] = useVizConfig( visualization.descriptor.configuration, @@ -373,7 +382,7 @@ function VolcanoPlotViz(props: VisualizationProps) { const plotRef = useUpdateThumbnailEffect( updateThumbnail, - plotContainerStyles, + finalPlotContainerStyles, [ finalData, // vizConfig.checkedLegendItems, TODO @@ -422,7 +431,7 @@ function VolcanoPlotViz(props: VisualizationProps) { markerBodyOpacity: data.value ? vizConfig.markerBodyOpacity ?? DEFAULT_MARKER_OPACITY : 0, - containerStyles: plotContainerStyles, + containerStyles: finalPlotContainerStyles, /** * Let's not display comparisonLabels before we have data for the viz. This prevents what may be * confusing behavior where selecting group values displays on the empty viz placeholder. @@ -608,30 +617,32 @@ function VolcanoPlotViz(props: VisualizationProps) { return (
- - - updateVizConfig({ effectSizeThreshold: Number(newValue) }) - } - label={finalData?.effectSizeLabel ?? 'Effect Size'} - minValue={0} - value={vizConfig.effectSizeThreshold ?? DEFAULT_FC_THRESHOLD} - containerStyles={{ marginRight: 10 }} - /> + {!hideInputsAndControls && ( + + + updateVizConfig({ effectSizeThreshold: Number(newValue) }) + } + label={finalData?.effectSizeLabel ?? 'Effect Size'} + minValue={0} + value={vizConfig.effectSizeThreshold ?? DEFAULT_FC_THRESHOLD} + containerStyles={{ marginRight: 10 }} + /> - - updateVizConfig({ significanceThreshold: Number(newValue) }) - } - minValue={0} - value={vizConfig.significanceThreshold ?? DEFAULT_SIG_THRESHOLD} - containerStyles={{ marginLeft: 10 }} - step={0.001} - /> - + + updateVizConfig({ significanceThreshold: Number(newValue) }) + } + minValue={0} + value={vizConfig.significanceThreshold ?? DEFAULT_SIG_THRESHOLD} + containerStyles={{ marginLeft: 10 }} + step={0.001} + /> + + )} - + {!hideInputsAndControls && } ) { controlsNode={controlsNode} tableGroupNode={tableGroupNode} showRequiredInputsPrompt={false} + hideControls={hideInputsAndControls} />
); diff --git a/packages/libs/eda/src/lib/map/analysis/DraggableVisualization.tsx b/packages/libs/eda/src/lib/map/analysis/DraggableVisualization.tsx index 9f3d47492d..edf62a7429 100644 --- a/packages/libs/eda/src/lib/map/analysis/DraggableVisualization.tsx +++ b/packages/libs/eda/src/lib/map/analysis/DraggableVisualization.tsx @@ -10,6 +10,7 @@ import { GeoConfig } from '../../core/types/geoConfig'; import { EntityCounts } from '../../core/hooks/entityCounts'; import { VariableDescriptor } from '../../core/types/variable'; import { Filter } from '../../core/types/filter'; +import { FilledButton } from '@veupathdb/coreui'; import { DraggablePanel } from '@veupathdb/coreui/lib/components/containers'; import { ComputationPlugin } from '../../core/components/computations/Types'; @@ -28,6 +29,8 @@ interface Props { filters: Filter[]; zIndexForStackingContext: number; additionalRenderCondition?: () => void; + hideInputsAndControls: boolean; + setHideInputsAndControls: (value: boolean) => void; } export default function DraggableVisualization({ @@ -43,6 +46,8 @@ export default function DraggableVisualization({ filters, zIndexForStackingContext = 10, additionalRenderCondition, + hideInputsAndControls, + setHideInputsAndControls, }: Props) { const { computation: activeComputation, visualization: activeViz } = analysisState.getVisualizationAndComputation( @@ -71,7 +76,11 @@ export default function DraggableVisualization({ confineToParentContainer showPanelTitle isOpen - styleOverrides={{ zIndex: zIndexForStackingContext, resize: 'both' }} + styleOverrides={{ + zIndex: zIndexForStackingContext, + resize: 'both', + overflow: 'hidden', + }} panelTitle={activeVizOverview?.displayName || ''} defaultPosition={{ x: 535, @@ -81,34 +90,71 @@ export default function DraggableVisualization({ >
- } - plugins={plugins} - /> +
+ setHideInputsAndControls(!hideInputsAndControls)} + size="small" + textTransform="none" + /> +
+
+
+ } + plugins={plugins} + hideInputsAndControls={hideInputsAndControls} + plotContainerStyleOverrides={ + hideInputsAndControls + ? { border: 'none', boxShadow: 'none' } + : undefined + } + /> +
+
) : null; diff --git a/packages/libs/eda/src/lib/map/analysis/MapAnalysis.tsx b/packages/libs/eda/src/lib/map/analysis/MapAnalysis.tsx index b7daf32ceb..8d3c5f3dfd 100755 --- a/packages/libs/eda/src/lib/map/analysis/MapAnalysis.tsx +++ b/packages/libs/eda/src/lib/map/analysis/MapAnalysis.tsx @@ -274,6 +274,8 @@ function MapAnalysisImpl(props: ImplProps) { const subsettingClient = useSubsettingClient(); const geoConfig = geoConfigs[0]; const history = useHistory(); + const [hideVizInputsAndControls, setHideVizInputsAndControls] = + useState(false); // FIXME use the sharingUrl prop to construct this const sharingUrl = new URL(`../${analysisId}/import`, window.location.href) @@ -919,6 +921,7 @@ function MapAnalysisImpl(props: ImplProps) { plugins={plugins} geoConfigs={geoConfigs} mapType={activeMarkerConfigurationType} + setHideVizInputsAndControls={setHideVizInputsAndControls} /> ), }, @@ -1444,6 +1447,8 @@ function MapAnalysisImpl(props: ImplProps) { DraggablePanelIds.VIZ_PANEL )} additionalRenderCondition={areMapTypeAndActiveVizCompatible} + hideInputsAndControls={hideVizInputsAndControls} + setHideInputsAndControls={setHideVizInputsAndControls} /> )} diff --git a/packages/libs/eda/src/lib/map/analysis/MapVizManagement.tsx b/packages/libs/eda/src/lib/map/analysis/MapVizManagement.tsx index 61b82082ef..caae4da354 100644 --- a/packages/libs/eda/src/lib/map/analysis/MapVizManagement.tsx +++ b/packages/libs/eda/src/lib/map/analysis/MapVizManagement.tsx @@ -29,6 +29,7 @@ interface Props { // visualizationPlugins: Partial>; geoConfigs: GeoConfig[]; mapType?: MarkerConfiguration['type']; + setHideVizInputsAndControls: (value: boolean) => void; } const mapVizManagementClassName = makeClassNameHelper('MapVizManagement'); @@ -41,12 +42,14 @@ export default function MapVizManagement({ setActiveVisualizationId, plugins, mapType, + setHideVizInputsAndControls, }: Props) { const [isVizSelectorVisible, setIsVizSelectorVisible] = useState(false); function onVisualizationCreated(visualizationId: string) { setIsVizSelectorVisible(false); setActiveVisualizationId(visualizationId); + setHideVizInputsAndControls(false); } if (!analysisState.analysis) return null;