Insert cell
Insert cell
Insert cell
data = FileAttachment("investors@3.json").json()
Insert cell
Insert cell
Insert cell
data_investments = data.flatMap((d) => {
return d.investments.map((investment) => ({
...investment,
investorName: d.name,
investorType: d.type,
investorHqCountry: d.hqCountry,
numInvestments: d.numInvestments,
totalInvested: d.totalInvested,
investorId: d._id,
solutionSegments: d.solutionSegments,
marketSegments: d.marketSegments
}));
})
Insert cell
Insert cell
data_investments2 = aq
.from(data_investments)
.select(
"investorId",
"investorName",
"investorType",
"investorHqCountry",
"entityName",
"entity",
"roundSizeUsd",
"round",
"totalInvested"
)
.orderby(aq.desc("roundSizeUsd"))
.filter((d) => d.roundSizeUsd < 1400000000)
.objects()
Insert cell
Insert cell
data_sankey_all = aq
.from(data_investments)
.select(
"investorName",
"investorType",
"entityName",
"roundSizeUsd",
"round",
"totalInvested"
)
.orderby(aq.desc("roundSizeUsd"))
.filter((d) => d.roundSizeUsd < 1400000000)
.filter((d) => d.totalInvested > 30000000)
.objects()
Insert cell
Insert cell
data_sankey_entity = aq
.from(data_investments)
.select(
"investorName",
"investorType",
"entityName",
"roundSizeUsd",
"round",
"totalInvested"
)
.orderby(aq.desc("roundSizeUsd"))
.filter((d) => d.roundSizeUsd < 1400000000)
.filter((d) => d.totalInvested > 30000000)
.filter((d) => d.investorType == "entity")
.objects()
Insert cell
Insert cell
data_sankey_person = aq
.from(data_investments)
.select(
"investorName",
"investorType",
"entityName",
"roundSizeUsd",
"round",
"totalInvested"
)
.orderby(aq.desc("roundSizeUsd"))
.filter((d) => d.roundSizeUsd < 1400000000)
.filter((d) => d.investorType == "person")
.objects()
Insert cell
Insert cell
Insert cell
Insert cell
data_clean = aq
.from(data)
.select("name", "totalInvested", "solutionSegments")
.filter((d) => d.solutionSegments !== null)
.objects()
Insert cell
data_sankey2 = data_clean
.flatMap((d) => {
return d.solutionSegments.map((solutionSegments) => ({
...solutionSegments,
investorName: d.name,
totalInvested: d.totalInvested
}));
})
.filter((d) => (d.totalInvested > 30000000) & (d.totalInvested < 14000000000))
.sort((a, b) => b.totalInvested - a.totalInvested)
Insert cell
Insert cell
Insert cell
Insert cell
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