-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add WIP map view #536
base: add-map-view
Are you sure you want to change the base?
Add WIP map view #536
Changes from 11 commits
d7df0f1
923c9a1
5a3f528
9f74398
fe349d6
5537976
14e3abe
bdd87cb
cf33a82
8174d24
0066aae
b835f72
99d7cb1
f75cf00
f0c735c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ taxonium_component/storybook-static/** | |
**/*.egg-info/** | ||
**/*.pyc | ||
**/_version.py | ||
node_modules |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We seem to have ended up with the zoom controls repeated 2x, once on the map and once on the tree. (I'd say they are better just on the tree). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a usecase where zooming into the map would be helpful? I was assuming that users may want to zoom into part of the map to view pie charts in only certain regions (eventually), but maybe you had a different idea here. Would the map view be fully zoomed out by default if we remove the zoom functionality? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, there might be use cases where zooming would be useful - but atm the buttons on the map affect the tree so this is not achieved. I don't see a strong need for zoom buttons for the map -- as opposed to panning and scrolling -- we need them for the tree due to separate X and Y zooms. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ import React, { useState, useCallback, useRef } from "react"; | |
import DeckGL from "@deck.gl/react"; | ||
import { View } from "@deck.gl/core"; | ||
import useLayers from "./hooks/useLayers"; | ||
import JBrowsePanel from "./components/JBrowsePanel"; | ||
import { ClipLoader } from "react-spinners"; | ||
import { | ||
CircularProgressbarWithChildren, | ||
|
@@ -19,9 +18,9 @@ import DeckSettingsModal from "./components/DeckSettingsModal"; | |
import { TreenomeButtons } from "./components/TreenomeButtons"; | ||
import TreenomeModal from "./components/TreenomeModal"; | ||
import FirefoxWarning from "./components/FirefoxWarning"; | ||
import { JBrowseErrorBoundary } from "./components/JBrowseErrorBoundary"; | ||
import ColorSettingModal from "./components/ColorSettingModal"; | ||
import Key from "./components/Key"; | ||
import ColorSettingModal from "./components/ColorSettingModal"; | ||
import TreenomeBrowser from "./components/TreenomeBrowser"; | ||
|
||
const MemoizedKey = React.memo(Key); | ||
|
||
|
@@ -359,12 +358,7 @@ function Deck({ | |
}} | ||
> | ||
<span ref={jbrowseRef}> | ||
<JBrowseErrorBoundary> | ||
<JBrowsePanel | ||
treenomeState={treenomeState} | ||
settings={settings} | ||
/> | ||
</JBrowseErrorBoundary> | ||
<TreenomeBrowser state={treenomeState} settings={settings} /> | ||
<TreenomeModal | ||
treenomeSettingsOpen={treenomeSettingsOpen} | ||
setTreenomeSettingsOpen={setTreenomeSettingsOpen} | ||
|
@@ -384,7 +378,59 @@ function Deck({ | |
settings={settings} | ||
/> | ||
</View> | ||
<View id="main"></View> | ||
|
||
<View id="map"> | ||
<div | ||
id="map-div" | ||
key={crypto.randomUUID()} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this unique key each time important? (I assume so but just checking) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Usually I err on the side of including an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, the re-render thing was my concern here. My model for what will happen for the code here is that every render the key will be different and so React will not be able to see that there is a (potentially) unchanging element here. I would be happy with key= There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you're totally right here, so I just swapped out the |
||
style={{ | ||
width: "100%", | ||
height: "100%", | ||
borderLeftWidth: "1px", | ||
borderColor: "black", | ||
borderStyle: "solid", | ||
position: "relative", | ||
zIndex: 2, | ||
}} | ||
></div> | ||
</View> | ||
|
||
<View id="main"> | ||
<NodeHoverTip | ||
hoverInfo={hoverInfo} | ||
hoverDetails={hoverDetails} | ||
colorHook={colorHook} | ||
colorBy={colorBy} | ||
config={config} | ||
filterMutations={settings.filterMutations} | ||
deckSize={deckSize} | ||
/> | ||
<TreenomeMutationHoverTip | ||
hoverInfo={hoverInfo} | ||
hoverDetails={hoverDetails} | ||
colorHook={colorHook} | ||
colorBy={colorBy} | ||
config={config} | ||
treenomeReferenceInfo={treenomeReferenceInfo} | ||
/> | ||
<MemoizedKey | ||
keyStuff={keyStuff} | ||
colorByField={colorBy.colorByField} | ||
colorByGene={colorBy.colorByGene} | ||
colorByPosition={colorBy.colorByPosition} | ||
config={config} | ||
/> | ||
<DeckButtons | ||
zoomReset={zoomReset} | ||
zoomIncrement={zoomIncrement} | ||
zoomAxis={zoomAxis} | ||
setZoomAxis={setZoomAxis} | ||
snapshot={snapshot} | ||
loading={data.status === "loading"} | ||
requestOpenSettings={() => setDeckSettingsOpen(true)} | ||
settings={settings} | ||
/> | ||
</View> | ||
</DeckGL> | ||
</div> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import JBrowsePanel from "./JBrowsePanel"; | ||
import { JBrowseErrorBoundary } from "./JBrowseErrorBoundary"; | ||
|
||
export default function TreenomeBrowser({ state, settings }) { | ||
return ( | ||
<JBrowseErrorBoundary> | ||
<JBrowsePanel treenomeState={state} settings={settings} /> | ||
</JBrowseErrorBoundary> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use yarn for taxonium - I think that means we can lose this file but let me know if there's a reason it's useful, I'm no expert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove! I'm used to NPM based projects, so this was just a force of habit.