diff --git a/src/AnalysisPage/GraphicalClustering/components/dataVizLink.jsx b/src/AnalysisPage/GraphicalClustering/components/dataVizLink.jsx index 539fcc63..0202c5fd 100644 --- a/src/AnalysisPage/GraphicalClustering/components/dataVizLink.jsx +++ b/src/AnalysisPage/GraphicalClustering/components/dataVizLink.jsx @@ -1,8 +1,21 @@ import React from 'react'; import PropTypes from 'prop-types'; -function DataVizLink({ title, tissue, plotType }) { - const url = `https://data-viz.motrpac-data.org/?tissues[${tissue}]=1&plot_type=${plotType}&topk=10`; +function DataVizLink({ title, tissue, plotType, minClusterSize }) { + let topkStr = ''; + let minClusterSizeStr = ''; + + // include 'topk' param for non-trajectory plots + if (plotType !== 'Trajectories') { + topkStr = '&topk=10'; + } + + // include 'min_cluster_size' param if minClusterSize is provided + if (minClusterSize && typeof (minClusterSize) === 'number') { + minClusterSizeStr = `&min_cluster_size=${minClusterSize}`; + } + + const url = `https://data-viz.motrpac-data.org/?tissues[${tissue}]=1&plot_type=${plotType}${topkStr}${minClusterSizeStr}`; return (

@@ -23,6 +36,11 @@ DataVizLink.propTypes = { title: PropTypes.string.isRequired, tissue: PropTypes.string.isRequired, plotType: PropTypes.string.isRequired, + minClusterSize: PropTypes.number, +}; + +DataVizLink.defaultProps = { + minClusterSize: null, }; export default DataVizLink;