Skip to content

Instantly share code, notes, and snippets.

View davegotz's full-sized avatar

David Gotz davegotz

View GitHub Profile
@davegotz
davegotz / index.html
Last active November 16, 2022 01:52
Coordinated Views with D3 Dispatch
<html>
<head>
<script src="https://d3js.org/d3.v7.min.js"></script>
<script src="iris_data.js"></script>
<title>Using D3 Dispatch to Link Charts</title>
</head>
<body>
<h1>
Iris Flower Data: Linked Bar Chart and Scatterplot
</h1>
@davegotz
davegotz / chapel_hill_25km_radius.geojson
Last active October 20, 2022 02:00
Street Map for Chapel Hill and 25km Radius
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davegotz
davegotz / chapel_hill_all_streets.geojson
Last active October 19, 2022 19:47
Chapel Hill, NC Street Map with Pan and Zoom
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davegotz
davegotz / concap.csv
Last active March 17, 2022 12:17
World Map
CountryName CapitalName CapitalLatitude CapitalLongitude CountryCode ContinentName
Somaliland Hargeisa 9.55 44.050000 NULL Africa
South Georgia and South Sandwich Islands King Edward Point -54.283333 -36.500000 GS Antarctica
French Southern and Antarctic Lands Port-aux-Français -49.35 70.216667 TF Antarctica
Palestine Jerusalem 31.766666666666666 35.233333 PS Asia
Aland Islands Mariehamn 60.116667 19.900000 AX Europe
Nauru Yaren -0.5477 166.920867 NR Australia
Saint Martin Marigot 18.0731 -63.082200 MF North America
Tokelau Atafu -9.166667 -171.833333 TK Australia
Western Sahara El-Aaiún 27.153611 -13.203333 EH Africa
@davegotz
davegotz / index.html
Last active March 4, 2022 23:58
Using D3 Dispatch to Link Multiple Views
<html>
<head>
<script src="https://d3js.org/d3.v7.min.js"></script>
<script src="iris_data.js"></script>
<title>Using D3 Dispatch to Link Charts</title>
</head>
<body>
<h1>
Iris Flower Data: Linked Bar Chart and Scatterplot
</h1>
@davegotz
davegotz / index.html
Created January 20, 2022 02:27
Let's Make a Bar Chart with SVG
<html>
<body>
<script src="https://d3js.org/d3.v7.min.js"></script>
<svg class="chart" height="300" width="500">
</svg>
<script>
// This is the data array which will be represented as a bar chart.
let data = [4, 8, 15, 16, 23, 42];
@davegotz
davegotz / index.html
Created January 20, 2022 02:24
Let's Make a Bar Chart with DIVs
<html>
<body>
<script src="https://d3js.org/d3.v7.min.js"></script>
<div class="chart">
</div>
<script>
// This is the data array which will be represented as a bar chart.
let data = [4, 8, 15, 16, 23, 42];
@davegotz
davegotz / index.html
Created January 19, 2022 21:41
Scatterplot with Selection Brush
<html>
<head>
<title>Example of D3 Scatterplot with Selection Brush</title>
<script src="https://d3js.org/d3.v7.min.js"></script>
<style>
/* Style information for axis labels */
.axis-label {
font-family: sans-serif;
font-size: 12px;
}
@davegotz
davegotz / index.html
Created January 12, 2022 14:05
Tippy Tooltips and D3 Example
<html>
<head>
<title>Example of Using Tippy Tooltips with D3</title>
<script src="https://d3js.org/d3.v7.min.js"></script>
<!-- Notice these two new scripts... tippy is the tooltip library and it depends on popper. -->
<!-- This leverages the tippyjs library. -->
<script src="https://unpkg.com/@popperjs/core@2/dist/umd/popper.min.js"></script>
<script src="https://unpkg.com/tippy.js@6/dist/tippy-bundle.umd.js"></script>
@davegotz
davegotz / index.html
Last active January 12, 2022 01:58
Basic Line Chart
<html>
<head>
<title>Basic Line Chart</title>
<script src="https://d3js.org/d3.v7.min.js"></script>
<style>
/* Style information for axis labels */
.axis-label {
font-family: sans-serif;
font-size: 12px;
}