Skip to content

Instantly share code, notes, and snippets.

View josecorella's full-sized avatar
🥐
Working from home

José Corella josecorella

🥐
Working from home
View GitHub Profile
@josecorella
josecorella / classics.csv
Created March 23, 2021 06:53
A7: Sequential Bar Graph
We can't make this file beautiful and searchable because it's too large.
"bibliography.congress classifications","bibliography.languages","bibliography.subjects","bibliography.title","bibliography.type","metadata.downloads","metadata.id","metadata.rank","metadata.url","bibliography.author.birth","bibliography.author.death","bibliography.author.name","bibliography.publication.day","bibliography.publication.full","bibliography.publication.month","bibliography.publication.month name","bibliography.publication.year","metadata.formats.total","metadata.formats.types","metrics.difficulty.automated readability index","metrics.difficulty.coleman liau index","metrics.difficulty.dale chall readability score","metrics.difficulty.difficult words","metrics.difficulty.flesch kincaid grade","metrics.difficulty.flesch reading ease","metrics.difficulty.gunning fog","metrics.difficulty.linsear write formula","metrics.difficulty.smog index","metrics.sentiments.polarity","metrics.sentiments.subjectivity","metrics.statistics.average letter per word","metrics.statistics.average sentence length","metrics
@josecorella
josecorella / bubble-chart.js
Created March 9, 2021 08:09
A6: Bubble Chart
const country = "Country";
const lexp = "Data.Health.Life Expectancy at Birth, Total";
const pop = "Data.Health.Total Population";
const popGrowth = "Data.Health.Population Growth";
const year = 2013;
let margin = { top: 20, right: 30, bottom: 120, left: 40 };
const width = 800 - margin.left - margin.right;
const height = 800 - margin.top - margin.bottom;
We can't make this file beautiful and searchable because it's too large.
"Country","Year","Data.Health.Birth Rate","Data.Health.Death Rate","Data.Health.Fertility Rate","Data.Health.Life Expectancy at Birth, Female","Data.Health.Life Expectancy at Birth, Male","Data.Health.Life Expectancy at Birth, Total","Data.Health.Population Growth","Data.Health.Total Population","Data.Infrastructure.Mobile Cellular Subscriptions","Data.Infrastructure.Mobile Cellular Subscriptions per 100 People","Data.Infrastructure.Telephone Lines","Data.Infrastructure.Telephone Lines per 100 People","Data.Rural Development.Agricultural Land","Data.Rural Development.Agricultural Land Percent","Data.Rural Development.Arable Land","Data.Rural Development.Arable Land Percent","Data.Rural Development.Land Area","Data.Rural Development.Rural Population","Data.Rural Development.Rural Population Growth","Data.Rural Development.Surface Area","Data.Urban Development.Population Density","Data.Urban Development.Urban Population Percent","Data.Urban Development.Urban Population Percent Growth"
"Canada","1980","15.4","7.
// inspiration taken from
// https://www.d3-graph-gallery.com/graph/boxplot_basic.html
const book_name = "bibliography.title";
const book_downloads = "metadata.downloads";
const book_author = "bibliography.author.name";
const author = "Shakespeare, William";
let downloads = [];
d3.csv("classics.csv", function (data) {
@josecorella
josecorella / classics.csv
Created March 2, 2021 07:08
Scatter Plot D3
We can't make this file beautiful and searchable because it's too large.
"bibliography.congress classifications","bibliography.languages","bibliography.subjects","bibliography.title","bibliography.type","metadata.downloads","metadata.id","metadata.rank","metadata.url","bibliography.author.birth","bibliography.author.death","bibliography.author.name","bibliography.publication.day","bibliography.publication.full","bibliography.publication.month","bibliography.publication.month name","bibliography.publication.year","metadata.formats.total","metadata.formats.types","metrics.difficulty.automated readability index","metrics.difficulty.coleman liau index","metrics.difficulty.dale chall readability score","metrics.difficulty.difficult words","metrics.difficulty.flesch kincaid grade","metrics.difficulty.flesch reading ease","metrics.difficulty.gunning fog","metrics.difficulty.linsear write formula","metrics.difficulty.smog index","metrics.sentiments.polarity","metrics.sentiments.subjectivity","metrics.statistics.average letter per word","metrics.statistics.average sentence length","metrics
//axis code taken from http://using-d3js.com/04_03_axis.html
var authors = [
"Austen, Jane",
"Twain, Mark",
"Dickens, Charles",
"Doyle, Arthur Conan",
"Shakespeare, William",
"Dostoyevsky, Fyodor",
"Douglass, Frederick",
"Vonnegut, Kurt",
@josecorella
josecorella / bar-chart-race.js
Created February 23, 2021 04:21
Bar-Chart Race
let rectX2 = 100;
let rectSpeed1 = 5, rectSpeed2 = 1;
let max_year = 23;
let curr_year = 0;
let hrs = 0;
let diff = 0;
let y = 100;
let data;
@josecorella
josecorella / classics.csv
Created February 15, 2021 06:15
Strip Chart
We can't make this file beautiful and searchable because it's too large.
"bibliography.congress classifications","bibliography.languages","bibliography.subjects","bibliography.title","bibliography.type","metadata.downloads","metadata.id","metadata.rank","metadata.url","bibliography.author.birth","bibliography.author.death","bibliography.author.name","bibliography.publication.day","bibliography.publication.full","bibliography.publication.month","bibliography.publication.month name","bibliography.publication.year","metadata.formats.total","metadata.formats.types","metrics.difficulty.automated readability index","metrics.difficulty.coleman liau index","metrics.difficulty.dale chall readability score","metrics.difficulty.difficult words","metrics.difficulty.flesch kincaid grade","metrics.difficulty.flesch reading ease","metrics.difficulty.gunning fog","metrics.difficulty.linsear write formula","metrics.difficulty.smog index","metrics.sentiments.polarity","metrics.sentiments.subjectivity","metrics.statistics.average letter per word","metrics.statistics.average sentence length","metrics
@josecorella
josecorella / box-plot.js
Last active February 14, 2021 19:51
Box-Plot
let data;
let keys;
// preload table data
function preload() {
data = loadTable(
'classics.csv',
'csv',
'header');
}
@josecorella
josecorella / classics.csv
Created February 14, 2021 04:27
Histogram
We can't make this file beautiful and searchable because it's too large.
"bibliography.congress classifications","bibliography.languages","bibliography.subjects","bibliography.title","bibliography.type","metadata.downloads","metadata.id","metadata.rank","metadata.url","bibliography.author.birth","bibliography.author.death","bibliography.author.name","bibliography.publication.day","bibliography.publication.full","bibliography.publication.month","bibliography.publication.month name","bibliography.publication.year","metadata.formats.total","metadata.formats.types","metrics.difficulty.automated readability index","metrics.difficulty.coleman liau index","metrics.difficulty.dale chall readability score","metrics.difficulty.difficult words","metrics.difficulty.flesch kincaid grade","metrics.difficulty.flesch reading ease","metrics.difficulty.gunning fog","metrics.difficulty.linsear write formula","metrics.difficulty.smog index","metrics.sentiments.polarity","metrics.sentiments.subjectivity","metrics.statistics.average letter per word","metrics.statistics.average sentence length","metrics