From 3d9674fa50df600c7e174803ceb2c11fc75a0f42 Mon Sep 17 00:00:00 2001 From: "Dae Kun (DK) Kwon" Date: Thu, 3 Nov 2022 13:13:45 -0400 Subject: [PATCH 1/4] lineplot axis range control behavior for categorical and non-categorical variable --- .../implementations/LineplotVisualization.tsx | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/lib/core/components/visualizations/implementations/LineplotVisualization.tsx b/src/lib/core/components/visualizations/implementations/LineplotVisualization.tsx index 185909d67..23083f95f 100755 --- a/src/lib/core/components/visualizations/implementations/LineplotVisualization.tsx +++ b/src/lib/core/components/visualizations/implementations/LineplotVisualization.tsx @@ -386,7 +386,12 @@ function LineplotViz(props: VisualizationProps) { independentAxisLogScale: false, dependentAxisLogScale: false, independentAxisValueSpec: 'Full', - dependentAxisValueSpec: 'Full', + dependentAxisValueSpec: + yAxisVar != null + ? isSuitableCategoricalVariable(yAxisVar) + ? 'Full' + : 'Auto-zoom' + : 'Full', }); // axis range control: close truncation warnings here setTruncatedIndependentAxisWarning(''); @@ -400,6 +405,7 @@ function LineplotViz(props: VisualizationProps) { vizConfig.binWidth, vizConfig.binWidthTimeUnit, findEntityAndVariable, + categoricalMode, ] ); @@ -888,11 +894,13 @@ function LineplotViz(props: VisualizationProps) { ? 'Proportion' : variableDisplayWithUnit(yAxisVariable) ? vizConfig.valueSpecConfig === 'Arithmetic mean' - ? 'Arithmetic mean: ' + variableDisplayWithUnit(yAxisVariable) + ? 'Arithmetic mean:
' + + variableDisplayWithUnit(yAxisVariable) : vizConfig.valueSpecConfig === 'Median' - ? 'Median: ' + variableDisplayWithUnit(yAxisVariable) + ? 'Median:
' + variableDisplayWithUnit(yAxisVariable) : vizConfig.valueSpecConfig === 'Geometric mean' - ? 'Geometric mean: ' + variableDisplayWithUnit(yAxisVariable) + ? 'Geometric mean:
' + + variableDisplayWithUnit(yAxisVariable) : 'Y-axis' : 'Y-axis', displayLegend: false, @@ -1050,7 +1058,7 @@ function LineplotViz(props: VisualizationProps) { updateVizConfig({ dependentAxisRange: undefined, dependentAxisLogScale: false, - dependentAxisValueSpec: 'Full', + dependentAxisValueSpec: categoricalMode ? 'Full' : 'Auto-zoom', showErrorBars: false, }); // add reset for truncation message as well @@ -1414,6 +1422,11 @@ function LineplotViz(props: VisualizationProps) { buttonColor={'primary'} margins={['0em', '0', '0', '0em']} itemMarginRight={25} + disabledList={ + !categoricalMode && vizConfig.yAxisVariable != null + ? ['Full'] + : [] + } /> Date: Tue, 8 Nov 2022 11:57:38 -0500 Subject: [PATCH 2/4] remove dependency of categoricalMode --- .../visualizations/implementations/LineplotVisualization.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/core/components/visualizations/implementations/LineplotVisualization.tsx b/src/lib/core/components/visualizations/implementations/LineplotVisualization.tsx index 23083f95f..b5a64458e 100755 --- a/src/lib/core/components/visualizations/implementations/LineplotVisualization.tsx +++ b/src/lib/core/components/visualizations/implementations/LineplotVisualization.tsx @@ -405,7 +405,6 @@ function LineplotViz(props: VisualizationProps) { vizConfig.binWidth, vizConfig.binWidthTimeUnit, findEntityAndVariable, - categoricalMode, ] ); From 6f089e0080d8a65fef6a3d81c616435fb90b005f Mon Sep 17 00:00:00 2001 From: "Dae Kun (DK) Kwon" Date: Tue, 8 Nov 2022 19:57:43 -0500 Subject: [PATCH 3/4] Bump web-components version --- package.json | 4 ++-- yarn.lock | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 4e6727cab..303552202 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@material-ui/core": "^4.12.3", "@material-ui/icons": "^4.11.2", "@material-ui/lab": "^4.0.0-alpha.58", - "@veupathdb/components": "^0.19.3", + "@veupathdb/components": "^0.19.4", "@veupathdb/coreui": "^0.18.13", "@veupathdb/http-utils": "^1.1.0", "@veupathdb/study-data-access": "^0.3.5", @@ -78,7 +78,7 @@ "@types/react-table": "^7.7.12", "@types/uuid": "^8.3.4", "@veupathdb/browserslist-config": "^1.1.0", - "@veupathdb/components": "^0.19.3", + "@veupathdb/components": "^0.19.4", "@veupathdb/coreui": "^0.18.13", "@veupathdb/eslint-config": "^2.0.0", "@veupathdb/http-utils": "^1.1.0", diff --git a/yarn.lock b/yarn.lock index c825a12c7..e05a9fdc6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3466,10 +3466,10 @@ resolved "https://registry.yarnpkg.com/@veupathdb/browserslist-config/-/browserslist-config-1.1.0.tgz#5c7eecc048a91195404411d8729393197af0128c" integrity sha512-TQ58MbCy7UZN/h11HZ31CSJfywG17oDNHQzQJysj65Fvv2gAM1w7CjwCvV0bG3sRESKUDORSA7sJrVVv27GHBw== -"@veupathdb/components@^0.19.3": - version "0.19.3" - resolved "https://registry.yarnpkg.com/@veupathdb/components/-/components-0.19.3.tgz#a2587bf5d0d3edf99a27e86154f527c7019643b9" - integrity sha512-/8YIUYhRz0lNPObnvqWSScT1Ys9v6R+KtXwTzuKjAgdK9uWfgXntA7jSDzWajPLGRA+wPCuzH33mV1oG6chfWQ== +"@veupathdb/components@^0.19.4": + version "0.19.4" + resolved "https://registry.yarnpkg.com/@veupathdb/components/-/components-0.19.4.tgz#4ade231e53c42ad54f8dd3d7ccfa2f052f0e7e0d" + integrity sha512-P2AfAhARJgh9MoX9KlY9A3XkDqaLgQdryfOlur25qy5pISE81eUv5tfSi7G8M1IIM2azFTqAxvdXIO8AmGeD3Q== dependencies: "@visx/gradient" "^1.0.0" "@visx/group" "^1.0.0" From 15ccd6e9f0927aa46881672a37a6e71c0db9d1b2 Mon Sep 17 00:00:00 2001 From: "Dae Kun (DK) Kwon" Date: Tue, 8 Nov 2022 19:59:07 -0500 Subject: [PATCH 4/4] v3.11.15 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 303552202..bda688812 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@veupathdb/eda", - "version": "3.11.14", + "version": "3.11.15", "dependencies": { "debounce-promise": "^3.1.2", "fp-ts": "^2.9.3",