Skip to content

Instantly share code, notes, and snippets.

View codetricity's full-sized avatar

Craig Oda codetricity

View GitHub Profile
@codetricity
codetricity / rainfall-01.03.js
Last active November 1, 2018 13:19
d3 rainfall lessons
d3.csv('data/rainfall-by-state.csv').then(data => {
data.forEach(stateData => {
stateData.rainfall = +stateData.rainfall;
const checkChar = /^[A-Z]/;
for (let i = 0; i < 5; i++) {
if (checkChar.test(stateData.state)) {
console.log('found capital letter');
break;
} else {
stateData.state = stateData.state.substring(1);
@codetricity
codetricity / 00-civilwar-data-join.rst
Last active October 22, 2018 15:23
Data join example using Civil War data

Learn Data Join Pattern

Goal

Learn pattern to change data on the same chart. For example, change data from Union to Confederate.

Pattern: Data Doesn't Change

  1. selectAll( thing to draw such as circle )
@codetricity
codetricity / bts-profile-4.rst
Last active October 22, 2018 12:35
BTS Member Profile Part 4

BTS Profile Height Analysis

image

Use the previous projects on temperature and BTS member height as a reference to create a chart that uses a graphic as data point marker instead of the previous circle.

@codetricity
codetricity / bts-profiles-3.rst
Last active October 21, 2018 00:11
d3 BTS part 3 - Show Data
@codetricity
codetricity / bts-profiles-2.rst
Last active October 20, 2018 13:42
BTS Profiles Part 2

BTS Profiles Part 2 - Show Image

Use Data Update Pattern

  1. select
  2. data
  3. exit
  4. update
@codetricity
codetricity / bts-profile.rst
Last active October 20, 2018 05:08
BTS Profile

BTS Profiles

Setup

Create folders for

  1. css
  2. assets
@codetricity
codetricity / bitmap-image.rst
Last active October 18, 2018 13:06
Add Bitmap Images to SVG
@codetricity
codetricity / 00-civil-war-facts.rst
Last active October 17, 2018 13:32
Civil War Facts
@codetricity
codetricity / civilwar2.rst
Last active October 14, 2018 13:55
Civil War Part 2 - Adding Confederate and Border States