Public
Edited
Sep 6, 2023
Fork of Heat map
1 fork
Insert cell
# Heat map
Insert cell
data = FileAttachment("combined_transformed@1.csv").csv()
Insert cell
Select a data source…
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
source_countries = Array.from(new Set(data.map(d => d.source_country)))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

colorScales = {};
Insert cell
// Create the heatmap plot
heatmap1 = vl.markRect()
.data(data)
.encode(
vl.y().fieldN("source_as").title("Source ASN"),
vl.x().fieldO("destination_as").title("Destination ASN"),
vl.color().fieldN("indirect_path_countries")
)

Insert cell
embed = require("vega-embed@6")
Insert cell
import {Table} from "@observablehq/table"
Insert cell
Table(data, {WIDTH: 660})
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