This file contains hidden or 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
| text-shadow: 2px 2px 4px #ffffff, -2px -2px 4px #fff, -2px 2px 4px #fff, 2px -2px 4px #fff | |
| /* ai2html ... for gray backgrounds | |
| 1. In Illustrator move the "names" component to a new layer called "state-names" | |
| 2. Add the below to the ai2html css block | |
| */ | |
| .g-state-names { | |
| text-shadow: 2px 2px 4px #e6e6e6, -2px -2px 4px #e6e6e6, -2px 2px 4px #e6e6e6, 2px -2px 4px #e6e6e6 | |
| } |
This file contains hidden or 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
| // clear tile storage to ensure latest data is shown | |
| // (failure to do this could leave old data in browser for up to 12 hours) | |
| mapboxgl.clearStorage(); |
This file contains hidden or 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
| ffmpeg -i infile.mp4 -vf "select=eq(n\,0)" -q:v 3 outfile.jpg | |
| # from https://stackoverflow.com/questions/4425413/how-to-extract-the-1st-frame-and-restore-as-an-image-with-ffmpeg/4425466 |
This file contains hidden or 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
| // from https://css-tricks.com/snippets/css/prevent-superscripts-and-subscripts-from-affecting-line-height/ | |
| sup, sub { | |
| vertical-align: baseline; | |
| position: relative; | |
| top: -0.4em; | |
| } | |
| sub { | |
| top: 0.4em; | |
| } |
This file contains hidden or 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
| // assumes multiple lines on a graph | |
| // like: {id: 'category one', values: [ [0,0], [1,1] [2,2] ... ]} | |
| // define circles as markers for the line to use | |
| lines.append('defs') | |
| .append('marker') | |
| .attr('id', d => `v-dot-${d.id}`) | |
| .attr('viewBox', [0, 0, 10, 10]) | |
| .attr('refX', 5) |
This file contains hidden or 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
| hpgraphic: | |
| npx mapshaper -i ./src/data/latest-mercator.geojson ./src/data/states/us-state-innerlines.geojson combine-files \ | |
| --rename-layers counties,lines \ | |
| --style target=lines stroke='#a0a0a0' stroke-width=0.5 \ | |
| -proj albersusa \ | |
| -o target=counties,lines format=svg ./src/data/for_hp.svg |
This file contains hidden or 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
| /* Source: https://gist.github.com/daichan4649/8877801 */ | |
| /* and this blog post: https://www.labnol.org/code/20005-publish-json-google-spreadsheets */ | |
| // Note: To use... | |
| // - from your sheet, go to Tools > Script Editor | |
| // - delete the code that's there | |
| // - paste in this code | |
| // - change the sheetId to match that of your sheet. You'll find it in the url between /d/ and /edit | |
| // - click "run" and authorize the app | |
| // - click "Deploy" |
This file contains hidden or 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
| /// legend css /// | |
| .v-legend-hed { | |
| font-weight: bold; | |
| font-size: 16px; | |
| margin-bottom: 12px; | |
| width: 100%; | |
| text-align: center; | |
| margin-top: 20px; | |
| } |
This file contains hidden or 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
| #!/bin/sh | |
| # copied from https://github.com/truist/settings/blob/master/bin/git_export_all_file_versions | |
| # more details here: https://stackoverflow.com/questions/12850030/git-getting-all-previous-version-of-a-specific-file-folder | |
| # based on script provided by Dmitry Shevkoplyas at http://stackoverflow.com/questions/12850030/git-getting-all-previous-version-of-a-specific-file-folder | |
| set -e | |
| if ! git rev-parse --show-toplevel >/dev/null 2>&1 ; then | |
| echo "Error: you must run this from within a git working directory" >&2 |
This file contains hidden or 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
| # usage: make water STATE=06 | |
| water: | |
| # note that I've previously downloaded all county water files from ftp2.census.gov/geo/tiger/TIGER2020/AREAWATER | |
| # to /Volumes/jkeefe-data/2020_Census/AREAWATER on my computer | |
| mkdir -p ./tmp/water | |
| rm ./tmp/water/*.* | |
| cd /Volumes/jkeefe-data/2020_Census/AREAWATER; unzip -o "tl_2020_$(STATE)*.zip" -d /Users/keefe/cnnvis-census2020-dot-maps/tmp/water | |
| npx mapshaper -i './tmp/water/*.shp' combine-files \ | |
| -simplify 40% \ |