-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversation
Identified and fixed two issues to resolve those problems with lines connecting:
Now following those steps outlined above gets you this map: |
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.
Great, thanks for doing this. We should be thinking about adding this to the svg-maps
repo when we are ready.
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) | ||
) | ||
} | ||
|
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.
👍🏼
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.
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
# Might need to treat PR & VI as one | ||
region_abbr_list <- list( | ||
"AK", | ||
"HI", | ||
"PR", | ||
"VI", | ||
"GU", | ||
"AS", | ||
"MP" | ||
) |
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.
Relatedly, this function and the one above could take a list of territories to include
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.
agree! Would be easy to change that - I wrote all the helper functions to handle different combos of this list
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!):
To get this locally:
scmake("public/gw-conditions-site-coords.csv")
.self.d3.csv(self.publicPath + "gw-conditions-site-coords.csv", this.d3.autotype),
.npm run serve