Skip to content

Instantly share code, notes, and snippets.

@jchakko
jchakko / index.html
Last active May 25, 2019 20:44
D3 v5 Line chart with mouseover interaction effects
<!DOCTYPE html>
<html lang="en-US">
<meta charset="utf-8">
<head>
<!-- Load in the d3 library -->
<script src="https://d3js.org/d3.v5.min.js"></script>
<style>
div.tooltip {
position: absolute;
text-align: center;
@jchakko
jchakko / index.html
Last active May 27, 2019 19:25
Interactive Pictogram with D3
<html>
<header>
<title>Pictograph</title>
</header>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v5.min.js"></script>
<style>
html {
font: normal 100%/1.4 Georgia,serif;
@jchakko
jchakko / consumption.csv
Created May 21, 2019 19:50
India Choropleth with tooltip D3
state rice_total wheat_total total rice_percent wheat_percent team
Andhra Pradesh 19.781 0.966 20.747 95.34390514 4.656094857 rice
Arunachal Pradesh 22.414 1.031 23.445 95.60247388 4.397526125 rice
Assam 21.443 1.304 22.747 94.26737592 5.732624082 rice
Bihar 11.41 11.096 22.506 50.69759175 49.30240825 rice
Chhattisgarh 19.949 3.01 22.959 86.8896729 13.1103271 rice
Delhi 3.524 11.551 15.075 23.37645108 76.62354892 roti
Goa 12.413 3.35 15.763 78.74770031 21.25229969 rice
Gujarat 3.877 8.692 12.569 30.84573156 69.15426844 roti
Haryana 1.776 15.75 17.526 10.13351592 89.86648408 roti
We can't make this file beautiful and searchable because it's too large.
p_year,xlong,ylat
1981,-116.578186,33.889793
1981,-116.597656,33.898495
1981,-116.565689,33.894394
1981,-116.576591,33.890694
1981,-116.599091,33.900295
1981,-116.579689,33.890095
1981,-116.566292,33.892197
1981,-116.577385,33.892994
1981,-116.601891,33.899494