From c2b12abe2b37510a64cb8fbe5ac2e4f6a7e7c485 Mon Sep 17 00:00:00 2001 From: Colin Megill Date: Mon, 26 Jul 2021 13:23:21 -0700 Subject: [PATCH] toggle and scale dotplot --- client/src/components/app.js | 11 ++++++----- client/src/components/dotplot/index.js | 9 +++++++-- client/src/components/embedding/index.js | 5 +++-- .../geneExpression/menus/genesetMenus.js | 7 +++++-- client/src/components/graph/graph.js | 2 ++ client/src/reducers/colors.js | 14 ++++++++++++-- client/src/reducers/dotplot.js | 6 ++++++ client/src/reducers/layoutChoice.js | 3 +-- 8 files changed, 42 insertions(+), 15 deletions(-) diff --git a/client/src/components/app.js b/client/src/components/app.js index e1ec6ea4..f2dfa489 100644 --- a/client/src/components/app.js +++ b/client/src/components/app.js @@ -79,11 +79,12 @@ class App extends React.Component { - {layoutChoice.dotplot ? ( - - ) : ( - - )} + {layoutChoice.dotplot && } + )} diff --git a/client/src/components/dotplot/index.js b/client/src/components/dotplot/index.js index a24b75eb..414ba2e3 100644 --- a/client/src/components/dotplot/index.js +++ b/client/src/components/dotplot/index.js @@ -15,6 +15,7 @@ class Dotplot extends React.Component { this.dotplotTopPadding = 120; this.dotplotLeftPadding = 170; this.rowColumnSize = 15; + this.dotplotBrowserScalingFactor = 0.65; this.state = { viewport, @@ -23,10 +24,13 @@ class Dotplot extends React.Component { componentDidMount() { window.addEventListener("resize", this.handleResize); + /* chrome only, which is support matrix as of 2021 */ + document.body.style.zoom = `${this.dotplotBrowserScalingFactor * 100}%`; } componentWillUnmount() { window.removeEventListener("resize", this.handleResize); + document.body.style.zoom = "100%"; } getViewportDimensions = () => { @@ -56,6 +60,7 @@ class Dotplot extends React.Component { position: "relative", top: 0, left: 0, + zIndex: -9999, }} > @@ -138,8 +141,8 @@ class GenesetMenus extends React.PureComponent { hoverOpenDelay={globals.tooltipHoverOpenDelay} >