Published
Edited
Sep 18, 2020
1 star
Insert cell
md`# Largest Shipping Ports


### Data Source
The Journal of Commerce annual Top 50 World Container Ports, Lloyd's List annual Top 100 Ports, AAPA World Port Rankings, Drewry World Container Traffic Port Handling and individual port websites, American Journal of Transportation Top 100 ports (Retrieved at: https://www.ajot.com/premium/ajot-ajots-top-100-containerports-a-to-z/P0)


`
Insert cell
drawTable(await getShippingPortData())
Insert cell
d3 = require('d3@6')
Insert cell
import { drawTable } from '@nuuuwan/table-utils'
Insert cell
import { drawDorlingCartogram2 } from '@nuuuwan/dorling-cartogram-world'
Insert cell
async function getShippingPortData() {
return await d3.csv(
'https://raw.githubusercontent.com/nuuuwan/misc-sl-data/master/shipping.world_ports.csv'
);
}
Insert cell
async function drawDorlingCartogramShippingPorts(year) {
const data = await getShippingPortData();
const infoList = data
.sort((a, b) => b[year] - a[year])
.slice(0, 30)
.map((x, i) =>
Object({
label: i + 1,
value: x[year],
latLng: [x.lat, x.lng]
})
);
const options = Object({
maxRadius: 20
});
return drawDorlingCartogram2(infoList, options);
}
Insert cell
drawDorlingCartogramShippingPorts(2018)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more