Public
Edited
Jun 15, 2023
Insert cell
Insert cell
Insert cell
dataset
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
screenshot20230402At112241 = FileAttachment("Screenshot 2023-04-02 at 11.22.41.png").image()
Insert cell
Insert cell
Insert cell
screenshot20230402At113410 = FileAttachment("Screenshot 2023-04-02 at 11.34.10.png").image()
Insert cell
Insert cell
screenshot20230402At113823 = FileAttachment("Screenshot 2023-04-02 at 11.38.23.png").image()
Insert cell
Insert cell
screenshot20230402At114116 = FileAttachment("Screenshot 2023-04-02 at 11.41.16.png").image()
Insert cell
Insert cell
Insert cell
Insert cell
screenshot20230402At114959 = FileAttachment("Screenshot 2023-04-02 at 11.49.59.png").image()
Insert cell
Insert cell
screenshot20230402At115456 = FileAttachment("Screenshot 2023-04-02 at 11.54.56.png").image()
Insert cell
Insert cell
Insert cell
Insert cell
screenshot20230402At115740 = FileAttachment("Screenshot 2023-04-02 at 11.57.40.png").image()
Insert cell
familyAsnTopology =FileAttachment("family-asn-topology@8.json").json()
Insert cell
//printTable(data)
Insert cell
d3 = require('d3@5')
Insert cell
margin = ({top: 30, right: 80, bottom: 5, left: 5});
Insert cell
width = 890 - margin.left - margin.right
Insert cell
height = 800 - margin.top - margin.bottom
Insert cell
//import {d3} from "https://cdn.skypack.dev/d3@7.0.0";
Insert cell
Insert cell
import {printTable} from "@uwdata/data-utilities"
Insert cell
colorScale = d3.scaleOrdinal() //=d3.scaleOrdinal(d3.schemeSet2)
.domain([ "Source/Destination","Transit"])
.range([ '#9e79db','#86cbff'])
Insert cell
colorScale1 = d3.scaleOrdinal(d3.schemeTableau10).domain(d3.set(dataset.nodes.map(d => d.cc)).values());
Insert cell
//create a simulation for an array of nodes, and compose the desired forces.
simulation = d3.forceSimulation()
.force("link", d3.forceLink() // This force provides links between nodes
.id(d => d.id) // This sets the node id accessor to the specified function. If not specified, will default to the index of a node.
.distance(120)
)
.force("charge", d3.forceManyBody().strength(-700)) // This adds repulsion (if it's negative) between nodes.
.force("center", d3.forceCenter(width / 2, height / 2)); // This force attracts nodes to the center of the svg area
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more