Skip to content

Commit

Permalink
Merge pull request Sage-Bionetworks#663 from jinjunoh/PORTALS-2885
Browse files Browse the repository at this point in the history
PORTALS-2885: render SynapsePlot only when showFacetVisualization is true
  • Loading branch information
jay-hodgson authored Jan 23, 2024
2 parents 18b1846 + d9d88b8 commit ce7d37b
Showing 1 changed file with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
Row,
} from '@sage-bionetworks/synapse-types'
import { FacetFilterHeader } from '../widgets/query-filter/FacetFilterHeader'
import { useQueryVisualizationContext } from '../QueryVisualizationWrapper'

export type QueryWrapperSynapsePlotProps = Pick<
QueryWrapperPlotNavCustomPlotParams,
Expand All @@ -35,6 +36,7 @@ export default function QueryWrapperSynapsePlot(
const queryContext = useQueryContext()
const { currentQueryRequest } = queryContext
const { title, onCustomPlotClick } = props
const { showFacetVisualization } = useQueryVisualizationContext()

const widgetParamsMapped: SynapsePlotWidgetParams = useMemo(() => {
return {
Expand All @@ -56,18 +58,22 @@ export default function QueryWrapperSynapsePlot(
}, [currentQueryRequest.query, onCustomPlotClick, queryContext])
return (
<div className="SynapsePlot">
{title && (
<FacetFilterHeader
hideCollapsible={true}
label={title}
isCollapsed={false}
onClick={() => {}}
/>
{showFacetVisualization && (
<>
{title && (
<FacetFilterHeader
hideCollapsible={true}
label={title}
isCollapsed={false}
onClick={() => {}}
/>
)}
<SynapsePlot
synapsePlotWidgetParams={widgetParamsMapped}
customPlotParams={customPlotParams}
/>
</>
)}
<SynapsePlot
synapsePlotWidgetParams={widgetParamsMapped}
customPlotParams={customPlotParams}
/>
</div>
)
}

0 comments on commit ce7d37b

Please sign in to comment.