Skip to content

Commit 6afefa6

Browse files
committed
1 parent 12cb940 commit 6afefa6

1,219 files changed

Lines changed: 6273 additions & 6294 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: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,40 @@
1-
d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2011_us_ag_exports.csv', function(err, rows){
2-
function unpack(rows, key) {
3-
return rows.map(function(row) { return row[key]; });
4-
}
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]);
54

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

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+
};
3138

32-
var layout = {
33-
title: {text: '2011 US Agriculture Exports by State'},
34-
geo:{
35-
scope: 'usa',
36-
showlakes: true,
37-
lakecolor: 'rgb(255,255,255)'
38-
}
39-
};
40-
41-
Plotly.newPlot("myDiv", data, layout, {showLink: false});
42-
});
39+
Plotly.newPlot("myDiv", data, layout, {showLink: false});
40+
});
Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2010_alcohol_consumption_by_country.csv', function(err, rows){
2-
function unpack(rows, key) {
3-
return rows.map(function(row) { return row[key]; });
4-
}
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]);
54

6-
var data = [{
7-
type: 'choropleth',
8-
locationmode: 'country names',
9-
locations: unpack(rows, 'location'),
10-
z: unpack(rows, 'alcohol'),
11-
text: unpack(rows, 'location'),
12-
autocolorscale: true
13-
}];
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+
}];
1413

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

24-
Plotly.newPlot("myDiv", data, layout, {showLink: false});
25-
26-
});
23+
Plotly.newPlot("myDiv", data, layout, {showLink: false});
24+
});
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_world_gdp_with_codes.csv', function(err, rows){
2-
function unpack(rows, key) {
3-
return rows.map(function(row) { return row[key]; });
4-
}
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]);
54

6-
var data = [{
5+
const data = [{
76
type: 'choropleth',
87
locations: unpack(rows, 'CODE'),
98
z: unpack(rows, 'GDP (BILLIONS)'),
@@ -24,21 +23,22 @@
2423
zmin: 0,
2524
dtick: 1000,
2625
colorbar: {
27-
autotic: false,
26+
tickmode: 'linear',
2827
tickprefix: '$',
2928
title: {text: 'GDP<br>Billions US$'}
3029
}
31-
}];
30+
}];
3231

33-
var layout = {
34-
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>'},
35-
geo:{
36-
showframe: false,
37-
showcoastlines: false,
38-
projection:{
39-
type: 'mercator'
40-
}
41-
}
42-
};
43-
Plotly.newPlot("myDiv", data, layout, {showLink: false});
44-
});
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+
}
40+
}
41+
};
42+
43+
Plotly.newPlot("myDiv", data, layout, {showLink: false});
44+
});
Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
1-
d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_usa_states.csv', function(err, rows){
2-
function unpack(rows, key) {
3-
return rows.map(function(row) { return row[key]; });
4-
}
5-
var 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-
}];
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]);
134

14-
var layout = {
15-
title: {text: '2014 US Popultaion 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-
};
28-
Plotly.newPlot("myDiv", data, layout, {showLink: false});
29-
});
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+
}];
13+
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+
};
28+
29+
Plotly.newPlot("myDiv", data, layout, {showLink: false});
30+
});

2016/08/04/florida-counties.html

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,36 @@
1-
d3.json('https://raw.githubusercontent.com/plotly/datasets/master/florida-red-data.json', function(redjson) {
2-
3-
d3.json('https://raw.githubusercontent.com/plotly/datasets/master/florida-blue-data.json', function(bluejson) {
4-
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]) => {
55
Plotly.newPlot('myDiv', [{
6-
type: 'scattermap',
7-
lat: [46],
8-
lon: [-74]
6+
type: 'scattermap',
7+
lat: [46],
8+
lon: [-74]
99
}], {
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)'
26-
},
27-
{
28-
sourcetype: 'geojson',
29-
source: bluejson,
30-
type: 'fill',
31-
color: 'rgba(40,0,113,0.8)'
32-
},
33-
]
34-
}
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)'
26+
},
27+
{
28+
sourcetype: 'geojson',
29+
source: bluejson,
30+
type: 'fill',
31+
color: 'rgba(40,0,113,0.8)'
32+
},
33+
]
34+
}
3535
});
36-
37-
38-
});
39-
4036
});

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:19 -->
4+
<!-- This page was last built at 2026-05-19 21:47 -->
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-19">
61+
<link rel="stylesheet" type="text/css" href="/all_static/css/improve.css?version=2026-05-19-21-47">
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-19"></script>
8015+
<script src="/all_static/javascripts/improve.js?version=2026-05-19-21-47"></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:19 -->
4+
<!-- This page was last built at 2026-05-19 21:47 -->
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-19">
61+
<link rel="stylesheet" type="text/css" href="/all_static/css/improve.css?version=2026-05-19-21-47">
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-19"></script>
8026+
<script src="/all_static/javascripts/improve.js?version=2026-05-19-21-47"></script>
80278027
<!-- code highlighting -->
80288028

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

2019/08/16/light-tile-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:19 -->
4+
<!-- This page was last built at 2026-05-19 21:47 -->
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-19">
61+
<link rel="stylesheet" type="text/css" href="/all_static/css/improve.css?version=2026-05-19-21-47">
6262

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

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

0 commit comments

Comments
 (0)