Public
Edited
Mar 23, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
rawData = FileAttachment("acquisitions_update_2021.csv").csv()
Insert cell
// filter out the record between 2000 and 2021
// since Disney is not a tech company, I deleted all its records as well
filteredData = rawData.filter(row => row["Acquisition Year"] >= 2000 && row["Acquisition Year"] <= 2021
&& row["Parent Company"] !== "Disney")
Insert cell
// construct the list of acquirers
acquirers = [...new Set(filteredData.map(item => item["Parent Company"]))].map(item => ({id: item, year: 2000}));
Insert cell
// some tech giant companies hadn't established in 2000
acquirers.forEach(item => {
if (item.id == "Twitter") {item.year = 2006};
if (item.id == "Facebook") {item.year = 2004};
});
Insert cell
// construct the list of the acquired
acquired = [...new Set(filteredData.map(item => ({id: item["Acquired Company"], year: Number(item["Acquisition Year"])})))];
Insert cell
// construct nodes by combining the acquirers and the acquired
nodes = acquirers.concat(acquired)
Insert cell
Insert cell
// combine nodes and links for D3 usage
data = ({nodes, links})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
colorScale = d3.scaleOrdinal(["Apple", "Twitter", "Amazon", "Hp", "Google", "Microsoft", "Blackberry", "Ebay", "Ibm", "Adobe", "Facebook", "Redhat", "Citrix"], d3.schemeCategory10).unknown("lightgrey");
Insert cell
color = d => colorScale(d.id)
Insert cell
Insert cell
Insert cell
import {Swatches} from "@d3/color-legend"
Insert cell
d3 = require("d3@7")
Insert cell
import {Scrubber} from "@mbostock/scrubber"
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