-
Notifications
You must be signed in to change notification settings - Fork 5
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
Equity maps; various other UI enhancements #141
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
2c0c09a
add heat equity layer to default map. #113
davemfish ba83e4c
style the equity layer. #113
davemfish 69a69af
Merge remote-tracking branch 'upstream/develop' into feature/113-equi…
davemfish 7bd7993
added component for legend to equity layers. #113
davemfish e162646
styling equity layer legend. #113.
davemfish 3d21038
use a layer group for the equity layer and lulc. #113
davemfish 567fbec
fixing visibility of legends. 113.
davemfish 1f45247
added zoom to default extent control. #113
davemfish 7a54ff0
debugging legend visibility. #113
davemfish aa74baf
new landing tab for first-time users. #113
davemfish 1171f4a
different behavior for start button when a study area already exists.…
davemfish dcf7e35
add multiple equity layers to the map. #113.
davemfish 4d7f15a
add borders to census blocks. #113
davemfish 767370e
cleaning up legends. #113
davemfish dd2c5ca
fix the legend for heat-income equity. #113.
davemfish dd1f15b
debugging. #113
davemfish 1829198
make sure first-time visitors cannot switch to scenario tab with usin…
davemfish 3cf8d05
remove study area layer from map when it is has no features. #113
davemfish 2183ace
parcel deleted from study area should lose hover-style. #113
davemfish e191bf4
add gif to demonstrate selecting a parcel
davemfish 0a203e2
some cleanup in stylesheet. #113
davemfish 8493152
cleanup layout in scenario builder panel. #113
davemfish c995946
changed a heading
davemfish 34ce792
some code cleanup. #113
davemfish 94b239d
move the colormap into the js file. #113
davemfish 42adfba
update tests. #113
davemfish 140b9b5
some comments and cleanup. #113
davemfish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,11 @@ export default function App() { | |
const [patternSamplingMode, setPatternSamplingMode] = useState(false); | ||
const [patternSampleWKT, setPatternSampleWKT] = useState(null); | ||
const [selectedScenario, setSelectedScenario] = useState(null); | ||
const [selectedEquityLayer, setSelectedEquityLayer] = useState(null); | ||
const [servicesheds, setServicesheds] = useState({}); | ||
const [activeTab, setActiveTab] = useState('explore'); | ||
const [start, setStart] = useState(0); | ||
const [firstVisit, setFirstVisit] = useState(true); | ||
|
||
const switchStudyArea = async (id) => { | ||
let area; | ||
|
@@ -67,10 +71,21 @@ export default function App() { | |
setPatternSamplingMode((mode) => !mode); | ||
}; | ||
|
||
const startBuilding = () => { | ||
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. Could be useful to have a docstring / comment for the purpose of this function. |
||
// If the session already contains a study area | ||
// it means the user already knows how to use the app | ||
// and we should skip the starting map scene. | ||
if (!studyArea.parcels.length) { | ||
setStart((start) => start + 1); | ||
} | ||
setActiveTab('scenarios'); | ||
}; | ||
|
||
useEffect(() => { | ||
(async () => { | ||
let SID = localStorage.getItem('sessionID'); | ||
if (SID) { | ||
setFirstVisit(false); | ||
const session = await getSession(SID); | ||
if (session && session.id) { | ||
setSessionID(SID); | ||
|
@@ -91,6 +106,7 @@ export default function App() { | |
area.parcels.length > 0 | ||
)); | ||
if (areas.length) { | ||
setActiveTab('scenarios'); | ||
setSavedStudyAreas(areas); | ||
await switchStudyArea(areas[0].id); // TODO: switch to most recently created | ||
} else { | ||
|
@@ -120,9 +136,14 @@ export default function App() { | |
setPatternSampleWKT={setPatternSampleWKT} | ||
scenarios={scenarios} | ||
selectedScenario={selectedScenario} | ||
setSelectedEquityLayer={setSelectedEquityLayer} | ||
selectedEquityLayer={selectedEquityLayer} | ||
servicesheds={servicesheds} | ||
activeTab={activeTab} | ||
start={start} | ||
/> | ||
<EditMenu | ||
firstVisit={firstVisit} | ||
key={studyArea.id} | ||
sessionID={sessionID} | ||
studyArea={studyArea} | ||
|
@@ -138,6 +159,10 @@ export default function App() { | |
patternSampleWKT={patternSampleWKT} | ||
setSelectedScenario={setSelectedScenario} | ||
setServicesheds={setServicesheds} | ||
selectedEquityLayer={selectedEquityLayer} | ||
setActiveTab={setActiveTab} | ||
activeTab={activeTab} | ||
startBuilding={startBuilding} | ||
/> | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
|
||
import { | ||
Button, | ||
Section, | ||
SectionCard, | ||
} from '@blueprintjs/core'; | ||
|
||
import EquityLegend from '../map/equityLegend'; | ||
|
||
const INTRO_TEXT = ` | ||
San Antonio, TX faces the challenge of staying cool in its hot climate, | ||
but not all neighborhoods receive equal help from nature. Some areas benefit | ||
more from natural cooling than others, highlighting environmental inequities, | ||
especially in neighborhoods with higher concentrations of Black, Indigenous, | ||
and People of Color (BIPOC) and lower income levels. Explore how these | ||
disparities affect the city’s ability to cope with rising temperatures.`; | ||
|
||
const ECO_TEXT = ` | ||
Characteristics of the natural and built environment influence | ||
the urban heat island. Buildings and dark-colored pavement absorb heat. | ||
Trees provide shade, and vegetation provides some natural air-conditioning | ||
through the cooling effect of evapotranspiration.`; | ||
|
||
const SCENARIO_TEXT = ` | ||
This tool is designed to let you build scenarios of different | ||
landcover, tree-cover, and landuse management. And then evaluate | ||
how these scenarios impact urban heating, access to nature, and | ||
carbon sequestration.`; | ||
|
||
export default function Explore(props) { | ||
const { | ||
startBuilding, | ||
equityLayerTitle, | ||
} = props; | ||
return ( | ||
<div id="explore" data-testid="explore"> | ||
<Section> | ||
<SectionCard>{INTRO_TEXT}</SectionCard> | ||
<SectionCard> | ||
<EquityLegend | ||
show={true} | ||
equityLayerTitle={equityLayerTitle} | ||
/> | ||
</SectionCard> | ||
<SectionCard>{ECO_TEXT}</SectionCard> | ||
<SectionCard> | ||
{SCENARIO_TEXT} | ||
</SectionCard> | ||
<SectionCard> | ||
<Button onClick={startBuilding}>Start building scenarios</Button> | ||
</SectionCard> | ||
</Section> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What's
start
tracking?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.
Tracking if the "Get Started" button was clicked.