From bf1a659d78c326f598953b284a077127189f9b74 Mon Sep 17 00:00:00 2001 From: stefanbabukov Date: Wed, 11 Oct 2023 13:11:01 +0100 Subject: [PATCH 1/3] added loading Signed-off-by: stefanbabukov --- src/components/repository/RepositoryTable.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/repository/RepositoryTable.jsx b/src/components/repository/RepositoryTable.jsx index b4d13a3dd7..2dc759c0ac 100644 --- a/src/components/repository/RepositoryTable.jsx +++ b/src/components/repository/RepositoryTable.jsx @@ -13,7 +13,7 @@ import { import { loadExperiments, setActiveExperiment } from 'redux/actions/experiments'; import PropTypes from 'prop-types'; -import React from 'react'; +import React, { useState } from 'react'; import fetchAPI from 'utils/http/fetchAPI'; import { modules } from 'utils/constants'; import { useAppRouter } from 'utils/AppRouteProvider'; @@ -23,7 +23,10 @@ import { techNamesToDisplay } from 'utils/upload/fileUploadSpecifications'; const { Paragraph } = Typography; const RepositoryTable = (props) => { + const [experimentCloning, setExperimentCloning] = useState(false); + const cloneExperiment = async (exampleExperimentId) => { + setExperimentCloning(true); const url = `/v2/experiments/${exampleExperimentId}/clone`; const newExperimentId = await fetchAPI( @@ -36,6 +39,7 @@ const RepositoryTable = (props) => { await dispatch(loadExperiments()); await dispatch(setActiveExperiment(newExperimentId)); + setExperimentCloning(false); navigateTo(modules.DATA_MANAGEMENT, { experimentId: newExperimentId }); }; @@ -44,7 +48,7 @@ const RepositoryTable = (props) => { const formatData = (data) => data.map((row) => ({ key: row.id, name: row.name, - explore: , + explore: , publication: {row.publicationTitle}, dataSource: {row.dataSourceTitle}, species: row.species, From 02e207dd4c63d1bf9b28552152de6585b77cc303 Mon Sep 17 00:00:00 2001 From: stefanbabukov Date: Thu, 12 Oct 2023 12:04:35 +0100 Subject: [PATCH 2/3] dont let max be 0 Signed-off-by: stefanbabukov --- src/utils/plotUtils.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils/plotUtils.js b/src/utils/plotUtils.js index adfe308890..b4117f4893 100644 --- a/src/utils/plotUtils.js +++ b/src/utils/plotUtils.js @@ -53,13 +53,15 @@ const renderCellSetColors = (rootKey, cellSetHierarchy, cellSetProperties) => { return colors; }; -const colorByGeneExpression = (truncatedExpression, min, max) => { +const colorByGeneExpression = (truncatedExpression, min, max = 4) => { + if (max === 0) max = 4; + const scaleFunction = vega.scale('sequential')() .domain([min, max]) .interpolator(colorInterpolator); - return Object.fromEntries(truncatedExpression.map( - (expressionValue, cellId) => [cellId, cssRgbToRgb(scaleFunction(expressionValue))], + (expressionValue, cellId) => [cellId, cssRgbToRgb(scaleFunction(expressionValue))] + , )); }; From 00e2f24ad8402ea6099181edbbb8c3df8ab4f9b1 Mon Sep 17 00:00:00 2001 From: stefanbabukov Date: Fri, 13 Oct 2023 12:13:25 +0100 Subject: [PATCH 3/3] using disabled instead of loading Signed-off-by: stefanbabukov --- src/components/repository/RepositoryTable.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/repository/RepositoryTable.jsx b/src/components/repository/RepositoryTable.jsx index 2dc759c0ac..4ccfc5c2f6 100644 --- a/src/components/repository/RepositoryTable.jsx +++ b/src/components/repository/RepositoryTable.jsx @@ -48,7 +48,7 @@ const RepositoryTable = (props) => { const formatData = (data) => data.map((row) => ({ key: row.id, name: row.name, - explore: , + explore: , publication: {row.publicationTitle}, dataSource: {row.dataSourceTitle}, species: row.species,