From 39d6f17a2c73cb9974ee0a90840ebd5d345671be Mon Sep 17 00:00:00 2001 From: Trevor Bedford Date: Tue, 11 Jun 2024 20:47:32 -0700 Subject: [PATCH] Streamline display with onlyPanels When controls.showOnlyPanels is active via the URL param "&onlyPanels" switch each primary panel to be an "infoPanel". This removes the title and the line above the title in the display card giving the panel a more streamlined appearance. This results in a more pleasant embedding into slide decks. --- src/components/entropy/index.js | 5 +++-- src/components/frequencies/index.js | 5 +++-- src/components/map/map.js | 5 +++-- src/components/tree/index.js | 3 ++- src/components/tree/tree.js | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/entropy/index.js b/src/components/entropy/index.js index f0ed6a0b6..ee1067da1 100644 --- a/src/components/entropy/index.js +++ b/src/components/entropy/index.js @@ -79,7 +79,8 @@ const getStyles = (width) => { zoomMax: state.controls.zoomMax, defaultColorBy: state.controls.defaults.colorBy, panelLayout: state.controls.panelLayout, - narrativeMode: state.narrative.display + narrativeMode: state.narrative.display, + showOnlyPanels: state.controls.showOnlyPanels }; }) class Entropy extends React.Component { @@ -258,7 +259,7 @@ class Entropy extends React.Component { render() { const styles = getStyles(this.props.width); return ( - + {this.state.hovered ? this.state.hovered.tooltip(this.props.t) : null} diff --git a/src/components/frequencies/index.js b/src/components/frequencies/index.js index 276712e1e..7db4824d6 100644 --- a/src/components/frequencies/index.js +++ b/src/components/frequencies/index.js @@ -20,7 +20,8 @@ import "../../css/entropy.css"; colorBy: state.controls.colorBy, colorScale: state.controls.colorScale, colorOptions: state.metadata.colorings, - normalizeFrequencies: state.controls.normalizeFrequencies + normalizeFrequencies: state.controls.normalizeFrequencies, + showOnlyPanels: state.controls.showOnlyPanels }; }) @@ -102,7 +103,7 @@ class Frequencies extends React.Component { const { t } = this.props; const {tipCount, fullTipCount} = this.props.nodes[0]; return ( - +
+ {this.props.legend && } diff --git a/src/components/tree/index.js b/src/components/tree/index.js index c9bc68c38..ded81bef0 100644 --- a/src/components/tree/index.js +++ b/src/components/tree/index.js @@ -26,7 +26,8 @@ const Tree = connect((state) => ({ showAllBranchLabels: state.controls.showAllBranchLabels, tipLabelKey: state.controls.tipLabelKey, narrativeMode: state.narrative.display, - animationPlayPauseButton: state.controls.animationPlayPauseButton + animationPlayPauseButton: state.controls.animationPlayPauseButton, + showOnlyPanels: state.controls.showOnlyPanels }))(UnconnectedTree); export default Tree; diff --git a/src/components/tree/tree.js b/src/components/tree/tree.js index 5c358d94f..c9a9ee2ca 100644 --- a/src/components/tree/tree.js +++ b/src/components/tree/tree.js @@ -193,7 +193,7 @@ class Tree extends React.Component { const styles = this.getStyles(); const widthPerTree = this.props.showTreeToo ? (this.props.width - spaceBetweenTrees) / 2 : this.props.width; return ( - +