Published
Edited
Apr 18, 2022
3 forks
14 stars
Insert cell
Insert cell
Insert cell
Insert cell
padding = 20
Insert cell
h_padding = 60
Insert cell
h_parts = 5
Insert cell
rows = Math.round(items / h_parts)
Insert cell
max_r = (width - margin.left -margin.right - (h_parts-1)* padding)/(h_parts) // widht - margins - total paddign devided by how many
Insert cell
Insert cell
Insert cell
Insert cell
---
Insert cell
Insert cell
Insert cell
r = d3.scaleSqrt()
.domain(d3.extent(data, d => d.Land_Area_sqkm))
.range([1,150])
Insert cell
rp = d3.scaleSqrt()
.domain(d3.extent(data, d => d.Population_2020))
.range([1,148])
Insert cell
data = d3.csvParse(await FileAttachment("countryareasqm@2.csv").text(), d3.autoType).sort((a, b) => d3.descending(a.Land_Area_sqkm, b.Land_Area_sqkm))
Insert cell
---
Insert cell
margin = ({top: 100, right: 30, bottom: 30, left: 30})
Insert cell
height = 400
Insert cell
width = 640
Insert cell
---
Insert cell
colors = ({background: "#E8F0F6", textcolor: "#1F1C1B", graphic: "#515971", area: "#A1BCD1", pop: "#D68248"})
Insert cell
Insert cell
import { slider } from "@jashkenas/inputs"
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