Platform
Solutions
Resources
Pricing
Sign in
Sign up
Zhenyu Chen
Workspace
Fork
Public
CS7295
By
Zhenyu Chen
Edited
Mar 23, 2023
1
CS7295
Texas and Bay Area both had 3 cities where employers filed 10k+ H1B petitions in 2022
A Company Can Be Acquired Twice by Different Big Tech Companies
There Are 2 Waves of ChatGPT Hypes according to Tweet Data
More funding money / funding rounds doesn't necessarily bring success for startups, even in the best state for startups
Cancer-Causing Air Pollution in the US
Ethereum Has Never Taken the Place of Bitcoin by Market Capitalization in the Last Decade
Top 5 Job Categories of Vocational Rehabilitation Successful Closures in California from 2014 to 2017
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
// construct links
links
=
filteredData
.
map
(
row
=>
{
const
newRow
=
{
}
;
newRow
.
source
=
row
[
"Parent Company"
]
;
newRow
.
target
=
row
[
"Acquired Company"
]
;
newRow
.
year
=
row
[
"Acquisition Year"
]
;
return
newRow
;
}
)
.
filter
(
row
=>
row
.
year
!==
'-'
)
// delete undated acquisition
;
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.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
time
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
chart
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
rawData
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
filteredData
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
acquirers
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
acquired
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
nodes
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
links
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
update
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
times
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
contains
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
height
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
colorScale
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
color
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
drag
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
d3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML