Skip to content
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 regions outside CONUS to the map! #43

Merged
merged 8 commits into from
Dec 17, 2021

Conversation

lindsayplatt
Copy link
Contributor

This Fixes #29.

In #32, I added the data to our big pull. This PR makes sure those points are included in the map itself. My computer seems to have this weird issue where it connects the SVG lines, even when I use M to "move to". Might be missing one other trick to get it to work, but @ceenell is going to try to build it locally and see what happens.

Here is what I see (at least the shapes & their sites are in the correct spots!):

image

To get this locally:

  1. Run scmake("public/gw-conditions-site-coords.csv").
  2. Change L115 of GWL.vue to be self.d3.csv(self.publicPath + "gw-conditions-site-coords.csv", this.d3.autotype),.
  3. Run npm run serve
  4. Open http://localhost:8080/

@lindsayplatt
Copy link
Contributor Author

Identified and fixed two issues to resolve those problems with lines connecting:

  1. Had to split out the new OCONUS MULTIPOLYGON sf objects into POLYGON sf objects with unique IDs so that they could be drawn individually and not connected.
  2. Downscaled & simplified to decrease size (see Peaks map - optimize SVG #18, the anomaly_peaks.svg file is now 315kb) and remove some points that were causing weird connections to be drawn in Hawaii, Puerto Rico, and the Virgin Islands.

Now following those steps outlined above gets you this map:

image

Copy link
Member

@cnell-usgs cnell-usgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for doing this. We should be thinking about adding this to the svg-maps repo when we are ready.

Comment on lines +11 to +25
get_shift <- function(region_abbr){
switch(
region_abbr,
AK = list(scale = 0.75, shift = c(-30,-200), rotation_deg = -40),
HI = list(scale = 1.75, shift = c(300, 0), rotation_deg = -35),
PR = list(scale = 3.15, shift = c(-95,75), rotation_deg=20),
VI = list(scale = 4, shift = c(-115,110), rotation_deg=20),
GU = list(scale = 5, shift = c(725, -575), rotation_deg=-90),
AS = list(scale = 5, shift = c(675, -30), rotation_deg=-45),
MP = list(scale = 1.5, shift = c(815,-600), rotation_deg=0),
# If there is no match, default to doing nothing to the object
list(scale = 1, shift = c(0,0), rotation_deg=0)
)
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

Copy link
Member

@cnell-usgs cnell-usgs Dec 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

long-term it would be cool to have a pre-defined layout options for common use basemaps. For example, if there are data to show on any of the islands, we might want them to be bigger and more visible, whereas when no data are present we might not need them to take up as much space and could scale accordingly

Comment on lines +81 to +90
# Might need to treat PR & VI as one
region_abbr_list <- list(
"AK",
"HI",
"PR",
"VI",
"GU",
"AS",
"MP"
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relatedly, this function and the one above could take a list of territories to include

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree! Would be easy to change that - I wrote all the helper functions to handle different combos of this list

@cnell-usgs cnell-usgs merged commit db3d9bd into DOI-USGS:main Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add PR, HI, AK to map
2 participants