Skip to content

Commit

Permalink
Merge pull request #1460 from VEuPathDB/lineplot-control-categorical
Browse files Browse the repository at this point in the history
lineplot y-axis range for categorical and non-categorical variable
  • Loading branch information
moontrip authored Nov 9, 2022
2 parents 64b1d05 + 15ccd6e commit ca0c760
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,12 @@ function LineplotViz(props: VisualizationProps<Options>) {
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('');
Expand Down Expand Up @@ -888,11 +893,13 @@ function LineplotViz(props: VisualizationProps<Options>) {
? 'Proportion'
: variableDisplayWithUnit(yAxisVariable)
? vizConfig.valueSpecConfig === 'Arithmetic mean'
? 'Arithmetic mean: ' + variableDisplayWithUnit(yAxisVariable)
? '<b>Arithmetic mean:</b><br> ' +
variableDisplayWithUnit(yAxisVariable)
: vizConfig.valueSpecConfig === 'Median'
? 'Median: ' + variableDisplayWithUnit(yAxisVariable)
? '<b>Median:</b><br> ' + variableDisplayWithUnit(yAxisVariable)
: vizConfig.valueSpecConfig === 'Geometric mean'
? 'Geometric mean: ' + variableDisplayWithUnit(yAxisVariable)
? '<b>Geometric mean:</b><br> ' +
variableDisplayWithUnit(yAxisVariable)
: 'Y-axis'
: 'Y-axis',
displayLegend: false,
Expand Down Expand Up @@ -1050,7 +1057,7 @@ function LineplotViz(props: VisualizationProps<Options>) {
updateVizConfig({
dependentAxisRange: undefined,
dependentAxisLogScale: false,
dependentAxisValueSpec: 'Full',
dependentAxisValueSpec: categoricalMode ? 'Full' : 'Auto-zoom',
showErrorBars: false,
});
// add reset for truncation message as well
Expand Down Expand Up @@ -1414,6 +1421,11 @@ function LineplotViz(props: VisualizationProps<Options>) {
buttonColor={'primary'}
margins={['0em', '0', '0', '0em']}
itemMarginRight={25}
disabledList={
!categoricalMode && vizConfig.yAxisVariable != null
? ['Full']
: []
}
/>
<AxisRangeControl
label="Range"
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ca0c760

Please sign in to comment.