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
Last active September 8, 2022 13:37
Installing cartopy inside of a pipenv virtual environment using GEOS/GDAL/PROJ from Homebrew

Install all of your "real" geo dependencies using homebrew

brew install proj
brew install geos
brew install gdal

Create your pipenv

@jsoma
jsoma / README.md
Last active October 10, 2019 23:57
Working with ai2html and sawhorse

Using ai2html and sawhorse: A walkthrough

So, you need to add an ai2html graphic to your sawhorse-driven page. Let's do it!

First, start with your .ai Illustrator file. You can start with something you exported already, but you can run into a lot of problems, so let's just start from the .ai.

Exporting from Illustrator

Open your Illustrator file up in Illustrator.

@jsoma
jsoma / README.md
Last active October 10, 2019 14:33
Using d3-tip and d3-annotation when you aren't just using a script tag

Since we live in a future that involves cool modern JavaScript and build systems like webpack and Parcel, you might sometimes have a little trouble installing or using JavaScript or D3 libraries. Let's take a look at two, and how we adapt them for our code (specifically with sawhorse).

d3-tip

d3-tip has been around since the earth was formed.

Installing d3-tip

To use d3-tip, we first install it. It's easy.

@jsoma
jsoma / README.md
Created September 23, 2019 20:05
How to set up a project for eslint and prettier to catch bugs and be beautiful

Using eslint and prettier to make your code perfect and beautiful and help you catch bugs while you're writing it

Setting up a node project

This doesn't work that well if we don't set up a node project first.

First, open up the homework folder in your text editor, not just the files individually. This is just because it makes life a lot easier, not necessarily because you need to (although... maybe you do?)

On the command line, cd into the folder that your work is in. Or try using View > Terminal from the upper menu to make a terminal open up in VSCode.

@jsoma
jsoma / README.md
Last active February 20, 2024 03:22
How to understand the margin convention and axes in d3+svg

How to understand the margin convention and axes in d3+svg

This walkthrough uses Homework 5: Question 10 as a base, but if you're just a random person from the internet it might still make sense

Let's say we do the totally normal height = and width = thing, and the totally normal svg = d3.select thing.

var height = 400
var width = 400
@jsoma
jsoma / README.md
Last active September 12, 2019 12:14
Putting multiple ai2html exports onto the same HTML page

Putting multiple ai2html exports onto the same HTML page

In the template we've been using, I used @media CSS queries to tell the page which to use at which size. This won't work for larger numbers of graphics (at least without effort), so we're going back to using the JavaScript I used in the YouTube walkthrough.

Step 1: Make your 3 files

Each graphic should be in a different file. Keep them in the same folder, though.

ai files in the same folder

@jsoma
jsoma / README.md
Last active June 30, 2023 02:01
Fixing text/font issues on ai2html exports

Fixing text/font issues on ai2html exports

Using ai2html-config.json to specify fonts

Sometimes when you're working on a graphic with ai2html, your exported graphic might have issues with text.

For example, this one has text that runs off the side of the page:

Broken page

@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