Skip to content

Instantly share code, notes, and snippets.

View jsoma's full-sized avatar

Jonathan Soma jsoma

View GitHub Profile
@jsoma
jsoma / README.md
Created August 12, 2019 18:55
Design Critique

You can make a design critique request using this Google form

Critique: Ministers leaving under Theresa May (line chart)

@jsoma
jsoma / .gitignore
Last active March 13, 2023 23:08
Tutorial on how to build a most-popular-thing-in-a-grid map in QGIS and pandas
.DS_Store
@jsoma
jsoma / README.md
Created August 3, 2019 12:12
Design checklist

Data Studio Charting Checklist

You can see a few suggestions at http://designingviz.com/ which may or may not be reasonable. I also really recommend The Wall Street Journal Guide to Information Graphics, a pretty tiny book that is remarkably helpful at helping you not screw things up.

Micro-tutorials for Illustrator can be found at http://jonathansoma.com/lede/data-studio/, including how to open your Python files in Illustrator. Longer, detailed Illustrator tutorials can be found on Lynda.com, accessed for free through the Columbia portal.

Communicating successfully

Story

@jsoma
jsoma / README.md
Last active November 13, 2022 07:15
Publishing your site on GitHub Pages

Hosting your site on GitHub Pages

We're going to start by creating a new repository using GitHub Pages.

Create a new repository

And we're going to name is after ourselves! My github username is jsoma, so I'm going to call my repository jsoma.gitub.io.

Name your repository YOURUSERNAME.github.io. Double-check what your GitHub username is. If you do this part wrong, you'll be sad!

@jsoma
jsoma / README.md
Last active June 5, 2019 22:13
A few styling tips for the MapBox GL map

Setting the style for the MapBox GL map template

Using a color scale

If you have a property called rating that goes from 0-10, this code will fill in your shape based on it. 1 will be a very light blue, 5 will be a slightly darker blue, and 10 will be even more dark. Numbers in between will be estimated (interpolated). Note that including the 5 level was not necessary - if rating were 5, MapBox GL would have guessed a color in between the 1 color and the 10 color.

'fill-color': [
      'interpolate', ['linear'],
 ["to-number", ["get", "rating"]], 
@jsoma
jsoma / stylebot.json
Created March 19, 2019 12:27
Stylebot custom CSS to make multiple-inboxes Gmail look more like Inbox (RIP)
{"mail.google.com":{"_enabled":true,"_rules":{".Cp":{"margin":"0 50px"},".aeJ, .no, .gb_7d.gb_Ce.gb_fe":{"background":"#f2f2f2"},".aia":{"margin":"0 auto","max-width":"840px"},".nK .byN":{"box-shadow":"none"},".oZ-jc.T-Jo.J-J5-Ji":{"margin-left":"0","padding-left":"0"},".oZ-x3::before":{"display":"none"},".zA":{"background":"#fff"},".zt":{"box-shadow":"0 -1px 0 #e0e0e0, 0 0 2px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.24)"},"body":{"font-family":"'Helvetica Neue',Helvetica,Arial,sans-serif"},"comment0":{"comment":"/* Background and general styles */"},"comment1":{"comment":"/* Spacing and groups */"},"comment2":{"comment":"/* Checkbox */"},"comment3":{"comment":"/* View All */"},"comment4":{"comment":"/* Date */"},"comment5":{"comment":"/* click-all/settings bar etc thingies */"},"div > div:nth-child(6) > div:nth-child(1) > .BltHke.nK .byN":{"display":"none"},"div.D.E.G-atb:not(.bP)":{"comment6":{"comment":"/*display: none; */"}},"div.nJ.A2":{"border-color":"#616161","font-size":"100%","font-weight":"normal","m
@jsoma
jsoma / chart.py
Last active July 27, 2021 10:04
A perfect easy beautiful simple way to label a stacked bar chart in Python using pandas/matplotlib. Put this in your Jupyter notebook!
#
# WAIT!!!
# WAIT!!!
# You probably don't need this any more! Newer versions of matplotlib
# can do this with built-in magic. See these StackOverflow answers:
#
# https://stackoverflow.com/questions/41296313/stacked-bar-chart-with-centered-labels/60895640#60895640
# https://stackoverflow.com/questions/28931224/adding-value-labels-on-a-matplotlib-bar-chart/67561982#67561982
#
# Big thanks to @trenton3983 for keeping us all up to date!
@jsoma
jsoma / README.md
Last active October 20, 2024 19:58
Installing tweego and story-formats on OS X.

Installing tweego is a little more complicated than (I think) it should be, so here's a script to do it for you. If you'd like to one-line it, you can just cut and paste this in Terminal:

/bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/jsoma/5ef3045b2004a610455f371479a6f0cf/raw/b6c9224faa18fd52f3e1bf7120af17eed6da8ec1/tweego.sh)"

Once it's installed, tweego docs are here. You'll probably want to read these twee docs, too.

@jsoma
jsoma / index.html
Last active November 16, 2018 23:36
voronoi map
<!DOCTYPE html>
<style>
.states :hover {
fill: red;
}
.state-borders {
fill: none;
stroke: #fff;
@jsoma
jsoma / matplotlibrc
Created July 12, 2018 14:45
Shortened list of matplotlibrc settings, maybe only the stuff that's important, maybe?
### MATPLOTLIBRC FORMAT
#
# See http://matplotlib.org/users/customizing.html#the-matplotlibrc-file for
# more details on the paths which are checked for the configuration file.
#
### LINES
# See http://matplotlib.org/api/artist_api.html#module-matplotlib.lines for more
# information on line properties.