Skip to content

Instantly share code, notes, and snippets.

View codetricity's full-sized avatar

Craig Oda codetricity

  • Oppkey
  • Palo Alto
View GitHub Profile
@codetricity
codetricity / 2018-09-14-interval-part-4.md
Last active September 14, 2018 14:22
part 4 of interval timer
@codetricity
codetricity / 2018-09-12-interval-2.md
Last active September 12, 2018 14:17
part2 of d3 interval

d3 interval part 2 - Using complex data from an array of objects

Review how color is temperature is pulled from array of objects.

Questions

What does this line do?

    var rowOfData = temperatureData[index];

Temperature by Month Pt 1 - Overview and Project Setup

Imgur

Project Goal

Show 12 months of data for each city.

Imgur

@codetricity
codetricity / 2018-09-13.md
Last active September 13, 2018 14:16
d3 interval loop part 3

D3 Interval Loop Part 3

Set Radius in update function

Use the anonymous function used to set the color of the circle as an example and edit the radius of the circle.

Example Using Color

You can't copy and paste this in. You must modify the code below and use a similar concept to change the radius of the circle.

@codetricity
codetricity / 2018-09-16-city-temperature-pt-4.md
Last active September 16, 2018 17:59
Part of Interval Timer Series

City Temperature Part 4

Learning Objectives

  • Use data from public web site on Internet
  • Use data in Excel spreadsheet, which is similar to Google Sheets
  • Convert CSV data to array of JavaScript objects
  • Use position transition
  • Use opacity transition
@codetricity
codetricity / temp-by-month-2.md
Last active September 16, 2018 16:55
use d3.csv to get data from file

Temp by Month 2 - Get Data from File

Section Goal

Read in data from csv file and make it usable in your program.

Learning Objectives

  • Understand CSV format
  • Understand array format
@codetricity
codetricity / temp-by-month-3.md
Last active September 16, 2018 21:23
temp by month pt 3. Use of JavaScript arrays

temp by month pt 3. Use of JavaScript arrays

Section Goal

Read in data and create an array of cities.

array of cities

Learning Objectives

@codetricity
codetricity / temp-by-month-4.md
Last active September 19, 2018 00:54
create SVG Viewport

Temperature by Month 4 - svg viewport

Learning Objectives

  • use keyword const instead of variable if the variable for WIDTH and HEIGHT do not change
  • use ALL_CAPS convention for the const name wich as WIDTH
  • review SVG Viewport margin conventions
  • review chart area position translation to get X and Y axis aligned properly

Steps

@codetricity
codetricity / temp-by-month-5.md
Last active September 17, 2018 12:53
Temperature by Month 5 - scales and axis

Temperature by Month 5 - scales and axis

Imgur

Goal

Create X and Y axis

Learning Objectives

Temperature by Month 6

bind data to circle elements

Inside the d3.csv promise function.

d3.csv("city-month.csv").then(function(dataInFunction){

    var circles = svg.selectAll("circle")

.data(dataInFunction)