Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 13, 2023
1 parent 5037050 commit 76c9246
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
7 changes: 2 additions & 5 deletions taxonium_component/src/Deck.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ function Deck({
jbrowseRef,
setAdditionalColorMapping,
mouseDownIsMinimap,
setMouseDownIsMinimap

setMouseDownIsMinimap,
}) {
const zoomReset = view.zoomReset;
const snapshot = useSnapshot(deckRef);
Expand Down Expand Up @@ -78,7 +77,6 @@ function Deck({
);
const [treenomeReferenceInfo, setTreenomeReferenceInfo] = useState(null);


const mouseDownPos = useRef();

const onClickOrMouseMove = useCallback(
Expand Down Expand Up @@ -139,10 +137,9 @@ function Deck({
pickInfo.viewport.id === "minimap" &&
mouseDownIsMinimap
) {

onViewStateChange({
oldViewState: viewState,
specialMinimap:true,
specialMinimap: true,
viewState: {
...viewState,
target: [
Expand Down
8 changes: 7 additions & 1 deletion taxonium_component/src/Taxonium.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ function Taxonium({

const [deckSize, setDeckSize] = useState(null);
const settings = useSettings({ query, updateQuery });
const view = useView({ settings, deckSize, deckRef, jbrowseRef, mouseDownIsMinimap });
const view = useView({
settings,
deckSize,
deckRef,
jbrowseRef,
mouseDownIsMinimap,
});

const url_on_fail = URL_ON_FAIL ? URL_ON_FAIL : null;

Expand Down
15 changes: 9 additions & 6 deletions taxonium_component/src/hooks/useView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ class MyOrthographicController extends OrthographicController {
}
}

const useView = ({ settings, deckSize, deckRef, jbrowseRef, mouseDownIsMinimap }) => {
const useView = ({
settings,
deckSize,
deckRef,
jbrowseRef,
mouseDownIsMinimap,
}) => {
const [zoomAxis, setZoomAxis] = useState("Y");
const [xzoom, setXzoom] = useState(window.screen.width < 600 ? -1 : 0);
globalSetZoomAxis = setZoomAxis;
Expand Down Expand Up @@ -232,10 +238,8 @@ const useView = ({ settings, deckSize, deckRef, jbrowseRef, mouseDownIsMinimap }
oldViewState,
basicTarget,
overrideZoomAxis,
specialMinimap

specialMinimap,
}) => {

if (!deckSize) {
return;
}
Expand All @@ -251,8 +255,7 @@ const useView = ({ settings, deckSize, deckRef, jbrowseRef, mouseDownIsMinimap }
const newScaleY = 2 ** newViewState.zoom;
// eslint-disable-line no-unused-vars

if(mouseDownIsMinimap && !specialMinimap &&oldScaleY === newScaleY){

if (mouseDownIsMinimap && !specialMinimap && oldScaleY === newScaleY) {
return;
}

Expand Down

0 comments on commit 76c9246

Please sign in to comment.