Skip to content

Commit fcdda46

Browse files
committed
1 parent 6afefa6 commit fcdda46

1,219 files changed

Lines changed: 6311 additions & 6326 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
1-
d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2011_us_ag_exports.csv')
2-
.then((rows) => {
3-
const unpack = (rows, key) => rows.map((row) => row[key]);
1+
d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2011_us_ag_exports.csv', (err, rows) => {
2+
const unpack = (rows, key) => rows.map((row) => row[key]);
43

5-
const data = [{
6-
type: 'choropleth',
7-
locationmode: 'USA-states',
8-
locations: unpack(rows, 'code'),
9-
z: unpack(rows, 'total exports'),
10-
text: unpack(rows, 'state'),
11-
zmin: 0,
12-
zmax: 17000,
13-
colorscale: [
14-
[0, 'rgb(242,240,247)'], [0.2, 'rgb(218,218,235)'],
15-
[0.4, 'rgb(188,189,220)'], [0.6, 'rgb(158,154,200)'],
16-
[0.8, 'rgb(117,107,177)'], [1, 'rgb(84,39,143)']
17-
],
18-
colorbar: {
19-
title: {text: 'Millions USD'},
20-
thickness: 0.2
21-
},
22-
marker: {
23-
line:{
24-
color: 'rgb(255,255,255)',
25-
width: 2
26-
}
4+
const data = [{
5+
type: 'choropleth',
6+
locationmode: 'USA-states',
7+
locations: unpack(rows, 'code'),
8+
z: unpack(rows, 'total exports'),
9+
text: unpack(rows, 'state'),
10+
zmin: 0,
11+
zmax: 17000,
12+
colorscale: [
13+
[0, 'rgb(242,240,247)'], [0.2, 'rgb(218,218,235)'],
14+
[0.4, 'rgb(188,189,220)'], [0.6, 'rgb(158,154,200)'],
15+
[0.8, 'rgb(117,107,177)'], [1, 'rgb(84,39,143)']
16+
],
17+
colorbar: {
18+
title: {text: 'Millions USD'},
19+
thickness: 0.2
20+
},
21+
marker: {
22+
line:{
23+
color: 'rgb(255,255,255)',
24+
width: 2
2725
}
28-
}];
26+
}
27+
}];
2928

30-
const layout = {
31-
title: {text: '2011 US Agriculture Exports by State'},
32-
geo:{
33-
scope: 'usa',
34-
showlakes: true,
35-
lakecolor: 'rgb(255,255,255)'
36-
}
37-
};
29+
const layout = {
30+
title: {text: '2011 US Agriculture Exports by State'},
31+
geo:{
32+
scope: 'usa',
33+
showlakes: true,
34+
lakecolor: 'rgb(255,255,255)'
35+
}
36+
};
3837

39-
Plotly.newPlot("myDiv", data, layout, {showLink: false});
40-
});
38+
Plotly.newPlot("myDiv", data, layout, {showLink: false});
39+
});
Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2010_alcohol_consumption_by_country.csv')
2-
.then((rows) => {
3-
const unpack = (rows, key) => rows.map((row) => row[key]);
1+
d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2010_alcohol_consumption_by_country.csv', (err, rows) => {
2+
const unpack = (rows, key) => rows.map((row) => row[key]);
43

5-
const data = [{
6-
type: 'choropleth',
7-
locationmode: 'country names',
8-
locations: unpack(rows, 'location'),
9-
z: unpack(rows, 'alcohol'),
10-
text: unpack(rows, 'location'),
11-
autocolorscale: true
12-
}];
4+
const data = [{
5+
type: 'choropleth',
6+
locationmode: 'country names',
7+
locations: unpack(rows, 'location'),
8+
z: unpack(rows, 'alcohol'),
9+
text: unpack(rows, 'location'),
10+
autocolorscale: true
11+
}];
1312

14-
const layout = {
15-
title: {text: 'Pure alcohol consumption<br>among adults (age 15+) in 2010'},
16-
geo: {
17-
projection: {
18-
type: 'robinson'
19-
}
13+
const layout = {
14+
title: {text: 'Pure alcohol consumption<br>among adults (age 15+) in 2010'},
15+
geo: {
16+
projection: {
17+
type: 'robinson'
2018
}
21-
};
19+
}
20+
};
2221

23-
Plotly.newPlot("myDiv", data, layout, {showLink: false});
24-
});
22+
Plotly.newPlot("myDiv", data, layout, {showLink: false});
23+
});
Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
1-
d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_world_gdp_with_codes.csv')
2-
.then((rows) => {
3-
const unpack = (rows, key) => rows.map((row) => row[key]);
1+
d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_world_gdp_with_codes.csv', (err, rows) => {
2+
const unpack = (rows, key) => rows.map((row) => row[key]);
43

5-
const data = [{
6-
type: 'choropleth',
7-
locations: unpack(rows, 'CODE'),
8-
z: unpack(rows, 'GDP (BILLIONS)'),
9-
text: unpack(rows, 'COUNTRY'),
10-
colorscale: [
11-
[0,'rgb(5, 10, 172)'],[0.35,'rgb(40, 60, 190)'],
12-
[0.5,'rgb(70, 100, 245)'], [0.6,'rgb(90, 120, 245)'],
13-
[0.7,'rgb(106, 137, 247)'],[1,'rgb(220, 220, 220)']],
14-
autocolorscale: false,
15-
reversescale: true,
16-
marker: {
17-
line: {
18-
color: 'rgb(180,180,180)',
19-
width: 0.5
20-
}
21-
},
22-
tick0: 0,
23-
zmin: 0,
24-
dtick: 1000,
25-
colorbar: {
26-
tickmode: 'linear',
27-
tickprefix: '$',
28-
title: {text: 'GDP<br>Billions US$'}
4+
const data = [{
5+
type: 'choropleth',
6+
locations: unpack(rows, 'CODE'),
7+
z: unpack(rows, 'GDP (BILLIONS)'),
8+
text: unpack(rows, 'COUNTRY'),
9+
colorscale: [
10+
[0,'rgb(5, 10, 172)'],[0.35,'rgb(40, 60, 190)'],
11+
[0.5,'rgb(70, 100, 245)'], [0.6,'rgb(90, 120, 245)'],
12+
[0.7,'rgb(106, 137, 247)'],[1,'rgb(220, 220, 220)']],
13+
autocolorscale: false,
14+
reversescale: true,
15+
marker: {
16+
line: {
17+
color: 'rgb(180,180,180)',
18+
width: 0.5
2919
}
30-
}];
20+
},
21+
tick0: 0,
22+
zmin: 0,
23+
dtick: 1000,
24+
colorbar: {
25+
tickmode: 'linear',
26+
tickprefix: '$',
27+
title: {text: 'GDP<br>Billions US$'}
28+
}
29+
}];
3130

32-
const layout = {
33-
title: {text: '2014 Global GDP<br>Source: <a href="https://www.cia.gov/library/publications/the-world-factbook/fields/2195.html"> CIA World Factbook</a>'},
34-
geo:{
35-
showframe: false,
36-
showcoastlines: false,
37-
projection:{
38-
type: 'mercator'
39-
}
31+
const layout = {
32+
title: {text: '2014 Global GDP<br>Source: <a href="https://www.cia.gov/library/publications/the-world-factbook/fields/2195.html"> CIA World Factbook</a>'},
33+
geo:{
34+
showframe: false,
35+
showcoastlines: false,
36+
projection:{
37+
type: 'mercator'
4038
}
41-
};
39+
}
40+
};
4241

43-
Plotly.newPlot("myDiv", data, layout, {showLink: false});
44-
});
42+
Plotly.newPlot("myDiv", data, layout, {showLink: false});
43+
});
Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1-
d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_usa_states.csv')
2-
.then((rows) => {
3-
const unpack = (rows, key) => rows.map((row) => row[key]);
1+
d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_usa_states.csv', (err, rows) => {
2+
const unpack = (rows, key) => rows.map((row) => row[key]);
43

5-
const data = [{
6-
type: 'choropleth',
7-
locationmode: 'USA-states',
8-
locations: unpack(rows, 'Postal'),
9-
z: unpack(rows, 'Population'),
10-
text: unpack(rows, 'State'),
11-
autocolorscale: true
12-
}];
4+
const data = [{
5+
type: 'choropleth',
6+
locationmode: 'USA-states',
7+
locations: unpack(rows, 'Postal'),
8+
z: unpack(rows, 'Population'),
9+
text: unpack(rows, 'State'),
10+
autocolorscale: true
11+
}];
1312

14-
const layout = {
15-
title: {text: '2014 US Population by State'},
16-
geo:{
17-
scope: 'usa',
18-
countrycolor: 'rgb(255, 255, 255)',
19-
showland: true,
20-
landcolor: 'rgb(217, 217, 217)',
21-
showlakes: true,
22-
lakecolor: 'rgb(255, 255, 255)',
23-
subunitcolor: 'rgb(255, 255, 255)',
24-
lonaxis: {},
25-
lataxis: {}
26-
}
27-
};
13+
const layout = {
14+
title: {text: '2014 US Population by State'},
15+
geo:{
16+
scope: 'usa',
17+
countrycolor: 'rgb(255, 255, 255)',
18+
showland: true,
19+
landcolor: 'rgb(217, 217, 217)',
20+
showlakes: true,
21+
lakecolor: 'rgb(255, 255, 255)',
22+
subunitcolor: 'rgb(255, 255, 255)',
23+
lonaxis: {},
24+
lataxis: {}
25+
}
26+
};
2827

29-
Plotly.newPlot("myDiv", data, layout, {showLink: false});
30-
});
28+
Plotly.newPlot("myDiv", data, layout, {showLink: false});
29+
});

2016/08/04/florida-counties.html

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
1-
Promise.all([
2-
d3.json('https://raw.githubusercontent.com/plotly/datasets/master/florida-red-data.json'),
3-
d3.json('https://raw.githubusercontent.com/plotly/datasets/master/florida-blue-data.json')
4-
]).then(([redjson, bluejson]) => {
5-
Plotly.newPlot('myDiv', [{
6-
type: 'scattermap',
7-
lat: [46],
8-
lon: [-74]
9-
}], {
10-
title: {text: "Florida Counties"},
11-
height: 600,
12-
width: 600,
13-
map: {
14-
center: {
15-
lat: 28,
16-
lon: -84
17-
},
18-
style: 'light',
19-
zoom: 4.8,
20-
layers: [
21-
{
22-
sourcetype: 'geojson',
23-
source: redjson,
24-
type: 'fill',
25-
color: 'rgba(163,22,19,0.8)'
1+
d3.json('https://raw.githubusercontent.com/plotly/datasets/master/florida-red-data.json', (redjson) => {
2+
d3.json('https://raw.githubusercontent.com/plotly/datasets/master/florida-blue-data.json', (bluejson) => {
3+
Plotly.newPlot('myDiv', [{
4+
type: 'scattermap',
5+
lat: [46],
6+
lon: [-74]
7+
}], {
8+
title: {text: "Florida Counties"},
9+
height: 600,
10+
width: 600,
11+
map: {
12+
center: {
13+
lat: 28,
14+
lon: -84
2615
},
27-
{
28-
sourcetype: 'geojson',
29-
source: bluejson,
30-
type: 'fill',
31-
color: 'rgba(40,0,113,0.8)'
32-
},
33-
]
34-
}
16+
style: 'light',
17+
zoom: 4.8,
18+
layers: [
19+
{
20+
sourcetype: 'geojson',
21+
source: redjson,
22+
type: 'fill',
23+
color: 'rgba(163,22,19,0.8)'
24+
},
25+
{
26+
sourcetype: 'geojson',
27+
source: bluejson,
28+
type: 'fill',
29+
color: 'rgba(40,0,113,0.8)'
30+
},
31+
]
32+
}
33+
});
3534
});
3635
});

2019/08/16/basic_density_mapbox.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<!-- This page was last built at 2026-05-19 21:47 -->
4+
<!-- This page was last built at 2026-05-20 21:08 -->
55

66
<meta charset="utf-8" />
77

@@ -58,7 +58,7 @@
5858

5959
<!-- Main Stylesheets -->
6060
<link rel="stylesheet" type="text/css" href="/all_static/css/main.css?version=6a0d63a7ef" />
61-
<link rel="stylesheet" type="text/css" href="/all_static/css/improve.css?version=2026-05-19-21-47">
61+
<link rel="stylesheet" type="text/css" href="/all_static/css/improve.css?version=2026-05-20-21-08">
6262

6363
<!-- LOCAL DEV STYLESHEET -->
6464
<!--<link rel="stylesheet" type="text/css" href="http://api.plotly.dev/all_static/css/main.css">-->
@@ -8012,7 +8012,7 @@ <h6 style="color:#EF553B" class="--footer-heading">Support</h6>&#x9;&#x9;&#x9;
80128012
<script src="/all_static//javascripts/hash_offset.js"></script>
80138013
<!-- Image Hover Script -->
80148014
<script src="/all_static/javascripts/imghover.js"></script>
8015-
<script src="/all_static/javascripts/improve.js?version=2026-05-19-21-47"></script>
8015+
<script src="/all_static/javascripts/improve.js?version=2026-05-20-21-08"></script>
80168016
<!-- code highlighting -->
80178017

80188018
<!--<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/highlight.min.js"></script>

2019/08/16/earthquack_density.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<!-- This page was last built at 2026-05-19 21:47 -->
4+
<!-- This page was last built at 2026-05-20 21:08 -->
55

66
<meta charset="utf-8" />
77

@@ -58,7 +58,7 @@
5858

5959
<!-- Main Stylesheets -->
6060
<link rel="stylesheet" type="text/css" href="/all_static/css/main.css?version=6a0d63a7ef" />
61-
<link rel="stylesheet" type="text/css" href="/all_static/css/improve.css?version=2026-05-19-21-47">
61+
<link rel="stylesheet" type="text/css" href="/all_static/css/improve.css?version=2026-05-20-21-08">
6262

6363
<!-- LOCAL DEV STYLESHEET -->
6464
<!--<link rel="stylesheet" type="text/css" href="http://api.plotly.dev/all_static/css/main.css">-->
@@ -8023,7 +8023,7 @@ <h6 style="color:#EF553B" class="--footer-heading">Support</h6>&#x9;&#x9;&#x9;
80238023
<script src="/all_static//javascripts/hash_offset.js"></script>
80248024
<!-- Image Hover Script -->
80258025
<script src="/all_static/javascripts/imghover.js"></script>
8026-
<script src="/all_static/javascripts/improve.js?version=2026-05-19-21-47"></script>
8026+
<script src="/all_static/javascripts/improve.js?version=2026-05-20-21-08"></script>
80278027
<!-- code highlighting -->
80288028

80298029
<!--<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/highlight.min.js"></script>

0 commit comments

Comments
 (0)