-
Notifications
You must be signed in to change notification settings - Fork 4
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
successfully inject map d3 into target/index.html (correct branch this time!) #35
Conversation
Merge branch 'master' of https://github.com/USGS-VIZLAB/vizstorm into d3 Conflicts: viz.yaml
Wasn't I already pulling in D3 in |
Hmm, not that I noticed. Where were you adding it? |
@lindsaycarr whoops, you are right, it isn't in here. But it is in https://github.com/USGS-VIZLAB/example/blob/master/viz.yaml#L190 and note that minified D3 is in the vizlab package, so you shouldn't need to commit that file. |
viz.yaml
Outdated
@@ -232,13 +232,22 @@ visualize: | |||
title: "SVG skeleton" | |||
alttext: "Beginning of the full storm SVG" | |||
publish: | |||
- | |||
mimetype: application/javascript |
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 this line for?
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.
whoops - forgot to delete it when I deleted the d3 library load
.attr( 'id', 'map' ); | ||
|
||
// Add map features | ||
d3.json('../cache/state_map.geojson', function(us_data){ |
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.
../cache
isn't going to be available on CHS
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.
.....WUT 🤦♀️ been operating under that assumption with this code.
Do you think I can push them to a target/data
directory?
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.
I think data that you want access to in target needs to be publish
or otherwise exported.
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.
see #37
Sweeeeet! |
scripts/process/as_svg.R
Outdated
@@ -1,266 +0,0 @@ | |||
|
|||
#' Sub mustache keys into text |
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.
i thought we still had uncertainty about whether the functions in this file can be used to keep the user experience speedy. if true, we may not be ready to remove this file already, though I know the functions are still on the other branch and in git history. what's your thinking on this now that you've been looking at vizstorm for a day, lindsay?
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.
I went the route of saving everything as geojson, and using that within the D3 code. To be honest, I didn't really understand what this was, just thought it was needed when we handrolled SVG. I see what you mean, though - although we haven't experienced any slowness yet (but probably will when we get working with more data). I can revert so that the file remains. I probably got a little heavy-handed with my cleanup.
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.
well...this gets at the question of where we draw the line between R and D3 - which is interesting. One thing, for example, is using R for the GIS side of things - I liked the original projection (and the flexibility that we can use whatever makes sense) over the one we'd need for d3.
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.
For what it's worth - D3 should be able to do any projection. I'm just struggling with that right now.
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.
yes, i think the R-D3 question is still open. makes sense to me to keep this file in here for now and think about how to optimize our use of the tools. i agree with lindsay that d3 projections should give us all the flexibility we'd need, but am also curious to eventually learn how much doing the projection in R might speed us up (or not). this may or may not be a question we answer in the next few weeks.
Not particularly happy with how I had to hack my way through getting JSON to be in |
Via Slack:
Please see #37. |
Please see #34 for comments.