Skip to content

Commit

Permalink
Update api.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaudis committed Jan 10, 2024
1 parent c4035a5 commit 87f69e4
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions src/hooks/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,33 @@ export function useCytomapper(querytext) {
return useProgenetixApi(url)
}

export function useSubsethistogram({ datasetIds, id, plotRegionLabels, plotGeneSymbols, plotCytoregionLabels, size, plotChros }) {
export function useSubsethistogram({
datasetIds,
id,
fileId,
plotRegionLabels,
plotGeneSymbols,
plotCytoregionLabels,
size,
plotChros
}) {
const svgbaseurl = subsetHistoBaseLink(id, datasetIds)
const params = []
plotRegionLabels && params.push(["plotRegionLabels", plotRegionLabels])
plotGeneSymbols && params.push(["plotGeneSymbols", plotGeneSymbols])
plotCytoregionLabels && params.push(["plotCytoregionLabels", plotCytoregionLabels])
size && params.push(["plotWidth", size])
plotChros && params.push(["plotChros", plotChros])
var plotPars = "plot_width=" + size
fileId && params.push(["fileId", fileId])
if (plotRegionLabels) {
plotPars += "::plot_region_labels=" + plotRegionLabels
}
if (plotGeneSymbols) {
plotPars += "::plot_gene_symbols=" + plotGeneSymbols
}
if (plotCytoregionLabels) {
plotPars += "::plot_cytoregion_labels=" + plotCytoregionLabels
}
if (plotChros) {
plotPars += "::plot_chros=" + plotChros
}
params.push(["plotPars", plotPars])
const searchQuery = new URLSearchParams(params).toString()
return useExtendedSWR(size > 0 && `${svgbaseurl}&${searchQuery}`, svgFetcher)
}
Expand Down

0 comments on commit 87f69e4

Please sign in to comment.