Saving custom color palettes to a variable, then using them in a ggplot chart
saving the palette
palette <- c(‘#d2848c”, “#fa807s”, “#ee9a00”, “#e0ffff”)
select { | |
display: inline-block; | |
font-weight: 400; | |
padding: .5rem 1.5rem .5rem .5rem; | |
border: 1px solid rgb(175,175,175); | |
box-shadow: 0 1px 0 1px rgba(0,0,0,.04); | |
border-radius: .5em; | |
-moz-appearance: none; | |
-webkit-appearance: none; | |
appearance: none; |
Saving custom color palettes to a variable, then using them in a ggplot chart
saving the palette
palette <- c(‘#d2848c”, “#fa807s”, “#ee9a00”, “#e0ffff”)
[ | |
{ | |
"name": "Roslindale", | |
"latlong": [-71.1245, 42.2913] | |
}, | |
{ | |
"name": "Jamaica Plain", | |
"latlong": [-71.1202, 42.3098] | |
}, | |
{ |
// from purpleair.com | |
// original source: https://docs.google.com/document/d/15ijz94dXJ-YAZLi9iZ_RaBwrZ4KtYeCy08goGBwnbCU/edit# | |
function aqiFromPM(pm) { | |
if (isNaN(pm)) return "-"; | |
if (pm == undefined) return "-"; | |
if (pm < 0) return pm; | |
if (pm > 1000) return "-"; | |
/* |
export default function (values) { | |
// sort value strings alphabetically | |
values.sort((a, b) => { | |
if (a.toLowerCase() < b.toLowerCase()) return -1; | |
if (a.toLowerCase() > b.toLowerCase()) return 1; | |
return 0; | |
}); | |
// find select element/elements | |
const selects = document.querySelectorAll('<<selector name>>'); |
Early Oct. 2019, I ran into a problem on our Voter Guide where Circle Ci would fail before tests would even run. I could get a basic sense of what was happening via the Circle-Ci interface, but the problem wasn't immediately evident.
After consulting with Andrew Chavez, he pointed me to a page that explains how to SSH into a build running on Circle-Ci to run the commands step-by-step in an attempt to debug the problem.
After SSH-ing in, and cd-ing into the directory on the running build (in this case, cd voter-guide
), you're able to run the commands listed in the circle-ci/config.yaml file in the project and seeing the read-out within the terminal as you go along.
In this instance, part of the setup process of the circle ci box involves running this command, which pulls a setup file for Nodejs v 8.x and installs it:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
value | label | |
---|---|---|
920 | A.C. Green | |
1920 | A.J. Bramlett | |
2062 | A.J. Guyton | |
1627773 | AJ Hammons | |
201985 | AJ Price | |
201166 | Aaron Brooks | |
203932 | Aaron Gordon | |
201189 | Aaron Gray | |
1626151 | Aaron Harrison |
<!-- this small piece of html would be inside a larger template that's being used to draw something, such as a post --> | |
<ul> | |
{{#each pills}} <!-- your each function called on an array that's part of your data object --> | |
<li>{{getPillText this}}</li> <!-- passing the value of your array to a helper function (first argument in this template tag --> | |
{{#/each}} | |
</ul> |