Skip to content

Commit 4c667ca

Browse files
committed
initial commit
0 parents  commit 4c667ca

16 files changed

+5148
-0
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.DS_Store
2+
dist/
3+
docs/.observablehq/cache/
4+
node_modules/
5+
yarn-error.log

README.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# BeyondMoore
2+
3+
This is an [Observable Framework](https://observablehq.com/framework) project. To start the local preview server, run:
4+
5+
```
6+
npm run dev
7+
```
8+
9+
Then visit <http://localhost:3000> to preview your project.
10+
11+
For more, see <https://observablehq.com/framework/getting-started>.
12+
13+
## Project structure
14+
15+
A typical Framework project looks like this:
16+
17+
```ini
18+
.
19+
├─ docs
20+
│ ├─ components
21+
│ │ └─ timeline.js # an importable module
22+
│ ├─ data
23+
│ │ ├─ launches.csv.js # a data loader
24+
│ │ └─ events.json # a static data file
25+
│ ├─ example-dashboard.md # a page
26+
│ ├─ example-report.md # another page
27+
│ └─ index.md # the home page
28+
├─ .gitignore
29+
├─ observablehq.config.ts # the project config file
30+
├─ package.json
31+
└─ README.md
32+
```
33+
34+
**`docs`** - This is the “source root” — where your source files live. Pages go here. Each page is a Markdown file. Observable Framework uses [file-based routing](https://observablehq.com/framework/routing), which means that the name of the file controls where the page is served. You can create as many pages as you like. Use folders to organize your pages.
35+
36+
**`docs/index.md`** - This is the home page for your site. You can have as many additional pages as you’d like, but you should always have a home page, too.
37+
38+
**`docs/data`** - You can put [data loaders](https://observablehq.com/framework/loaders) or static data files anywhere in your source root, but we recommend putting them here.
39+
40+
**`docs/components`** - You can put shared [JavaScript modules](https://observablehq.com/framework/javascript/imports) anywhere in your source root, but we recommend putting them here. This helps you pull code out of Markdown files and into JavaScript modules, making it easier to reuse code across pages, write tests and run linters, and even share code with vanilla web applications.
41+
42+
**`observablehq.config.ts`** - This is the [project configuration](https://observablehq.com/framework/config) file, such as the pages and sections in the sidebar navigation, and the project’s title.
43+
44+
## Command reference
45+
46+
| Command | Description |
47+
| ----------------- | -------------------------------------------------------- |
48+
| `npm install` | Install or reinstall dependencies |
49+
| `npm run dev` | Start local preview server |
50+
| `npm run build` | Build your static site, generating `./dist` |
51+
| `npm run deploy` | Deploy your project to Observable |
52+
| `npm run clean` | Clear the local data loader cache |
53+
| `npm run observable` | Run commands like `observable help` |

docs/aapl.csv

+1,261
Large diffs are not rendered by default.

docs/assets/beyondmoore-logo.svg

+619
Loading

docs/components/timeline.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as Plot from "npm:@observablehq/plot";
2+
3+
export function timeline(events, {width, height} = {}) {
4+
return Plot.plot({
5+
width,
6+
height,
7+
marginTop: 30,
8+
x: {nice: true, label: null, tickFormat: ""},
9+
y: {axis: null},
10+
marks: [
11+
Plot.ruleX(events, {x: "year", y: "y", markerEnd: "dot", strokeWidth: 2.5}),
12+
Plot.ruleY([0]),
13+
Plot.text(events, {x: "year", y: "y", text: "name", lineAnchor: "bottom", dy: -10, lineWidth: 10, fontSize: 12})
14+
]
15+
});
16+
}

docs/data/events.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{"name": "Sputnik 1", "year": 1957, "y": 10},
3+
{"name": "Apollo 11", "year": 1969, "y": 20},
4+
{"name": "Viking 1 and 2", "year": 1975, "y": 30},
5+
{"name": "Space Shuttle Columbia", "year": 1981, "y": 40},
6+
{"name": "Hubble Space Telescope", "year": 1990, "y": 50},
7+
{"name": "ISS Construction", "year": 1998, "y": 60}
8+
]

docs/data/launches.csv.js

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import {csvFormat, tsvParse} from "d3-dsv";
2+
import {utcParse} from "d3-time-format";
3+
4+
async function text(url) {
5+
const response = await fetch(url);
6+
if (!response.ok) throw new Error(`fetch failed: ${response.status}`);
7+
return response.text();
8+
}
9+
10+
// “Top” vehicles
11+
const TOP_LAUNCH_VEHICLES = new Set([
12+
"Falcon9",
13+
"R-7",
14+
"R-14",
15+
"Thor",
16+
"DF5",
17+
"R-36",
18+
"Proton",
19+
"Titan",
20+
"Zenit",
21+
"Atlas"
22+
]);
23+
24+
// “Top” launching states
25+
const TOP_STATES_MAP = new Map([
26+
["US", "United States"],
27+
["SU", "Soviet Union"],
28+
["RU", "Russia"],
29+
["CN", "China"]
30+
]);
31+
32+
// Load and parse launch vehicles.
33+
const launchVehicles = tsvParse(await text("https://planet4589.org/space/gcat/tsv/tables/lv.tsv"));
34+
35+
// Construct map to lookup vehicle family from name.
36+
const launchVehicleFamilyMap = new Map(launchVehicles.map((d) => [d["#LV_Name"], d.LV_Family.trim()]));
37+
38+
// Reduce cardinality by mapping smaller states to “Other”.
39+
function normalizeState(d) {
40+
return TOP_STATES_MAP.get(d) ?? "Other";
41+
}
42+
43+
// Reduce cardinality by mapping smaller launch families to “Other”.
44+
function normalizeFamily(d) {
45+
const family = launchVehicleFamilyMap.get(d);
46+
return TOP_LAUNCH_VEHICLES.has(family) ? family : "Other";
47+
}
48+
49+
// Parse dates!
50+
const parseDate = utcParse("%Y %b %_d");
51+
52+
// Load and parse launch-log and trim down to smaller size.
53+
const launchHistory = tsvParse(await text("https://planet4589.org/space/gcat/tsv/derived/launchlog.tsv"), (d) => ({
54+
date: parseDate(d.Launch_Date.slice(0, 11)),
55+
state: normalizeState(d.LVState),
56+
stateId: d.LVState,
57+
family: normalizeFamily(d.LV_Type)
58+
})).filter((d) => d.date != null);
59+
60+
// Write out csv formatted data.
61+
process.stdout.write(csvFormat(launchHistory));

docs/example-dashboard.md

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
theme: dashboard
3+
title: Example dashboard
4+
toc: false
5+
---
6+
7+
# Rocket launches 🚀
8+
9+
<!-- Load and transform the data -->
10+
11+
```js
12+
const launches = FileAttachment("data/launches.csv").csv({typed: true});
13+
```
14+
15+
<!-- A shared color scale for consistency, sorted by the number of launches -->
16+
17+
```js
18+
const color = Plot.scale({
19+
color: {
20+
type: "categorical",
21+
domain: d3.groupSort(launches, (D) => -D.length, (d) => d.state).filter((d) => d !== "Other"),
22+
unknown: "var(--theme-foreground-muted)"
23+
}
24+
});
25+
```
26+
27+
<!-- Cards with big numbers -->
28+
29+
<div class="grid grid-cols-4">
30+
<div class="card">
31+
<h2>United States 🇺🇸</h2>
32+
<span class="big">${launches.filter((d) => d.stateId === "US").length.toLocaleString("en-US")}</span>
33+
</div>
34+
<div class="card">
35+
<h2>Russia 🇷🇺 <span class="muted">/ Soviet Union</span></h2>
36+
<span class="big">${launches.filter((d) => d.stateId === "SU" || d.stateId === "RU").length.toLocaleString("en-US")}</span>
37+
</div>
38+
<div class="card">
39+
<h2>China 🇨🇳</h2>
40+
<span class="big">${launches.filter((d) => d.stateId === "CN").length.toLocaleString("en-US")}</span>
41+
</div>
42+
<div class="card">
43+
<h2>Other</h2>
44+
<span class="big">${launches.filter((d) => d.stateId !== "US" && d.stateId !== "SU" && d.stateId !== "RU" && d.stateId !== "CN").length.toLocaleString("en-US")}</span>
45+
</div>
46+
</div>
47+
48+
<!-- Plot of launch history -->
49+
50+
```js
51+
function launchTimeline(data, {width} = {}) {
52+
return Plot.plot({
53+
title: "Launches over the years",
54+
width,
55+
height: 300,
56+
y: {grid: true, label: "Launches"},
57+
color: {...color, legend: true},
58+
marks: [
59+
Plot.rectY(data, Plot.binX({y: "count"}, {x: "date", fill: "state", interval: "year", tip: true})),
60+
Plot.ruleY([0])
61+
]
62+
});
63+
}
64+
```
65+
66+
<div class="grid grid-cols-1">
67+
<div class="card">
68+
${resize((width) => launchTimeline(launches, {width}))}
69+
</div>
70+
</div>
71+
72+
<!-- Plot of launch vehicles -->
73+
74+
```js
75+
function vehicleChart(data, {width}) {
76+
return Plot.plot({
77+
title: "Popular launch vehicles",
78+
width,
79+
height: 300,
80+
marginTop: 0,
81+
marginLeft: 50,
82+
x: {grid: true, label: "Launches"},
83+
y: {label: null},
84+
color: {...color, legend: true},
85+
marks: [
86+
Plot.rectX(data, Plot.groupY({x: "count"}, {y: "family", fill: "state", tip: true, sort: {y: "-x"}})),
87+
Plot.ruleX([0])
88+
]
89+
});
90+
}
91+
```
92+
93+
<div class="grid grid-cols-1">
94+
<div class="card">
95+
${resize((width) => vehicleChart(launches, {width}))}
96+
</div>
97+
</div>
98+
99+
Data: Jonathan C. McDowell, [General Catalog of Artificial Space Objects](https://planet4589.org/space/gcat)

docs/example-report.md

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: Example report
3+
---
4+
5+
# A brief history of space exploration
6+
7+
This report is a brief overview of the history and current state of rocket launches and space exploration.
8+
9+
## Background
10+
11+
The history of rocket launches dates back to ancient China, where gunpowder-filled tubes were used as primitive forms of propulsion.
12+
13+
Fast-forward to the 20th century during the Cold War era, the United States and the Soviet Union embarked on a space race, a competition to innovate and explore beyond Earth.
14+
15+
This led to the launch of the first artificial satellite, Sputnik 1, and the crewed moon landing by Apollo 11. As technology advanced, rocket launches became synonymous with space exploration and satellite deployment.
16+
17+
## The Space Shuttle era
18+
19+
```js
20+
import {timeline} from "./components/timeline.js";
21+
```
22+
23+
```js
24+
const events = FileAttachment("./data/events.json").json();
25+
```
26+
27+
```js
28+
timeline(events, {height: 300})
29+
```
30+
31+
### Sputnik 1 (1957)
32+
33+
This was the first artificial satellite. Launched by the Soviet Union, it marked the beginning of the space age.
34+
35+
### Apollo 11 (1969)
36+
37+
The historic Apollo 11 mission, led by NASA, marked the first successful human landing on the Moon. Astronauts Neil Armstrong and Buzz Aldrin became the first humans to set foot on the lunar surface.
38+
39+
### Viking 1 and 2 (1975)
40+
41+
NASA’s Viking program successfully launched two spacecraft, Viking 1 and Viking 2, to Mars. These missions were the first to successfully land and operate on the Martian surface, conducting experiments to search for signs of life.
42+
43+
### Space Shuttle Columbia (1981)
44+
45+
The first orbital space shuttle mission, STS-1, launched the Space Shuttle Columbia on April 12, 1981. The shuttle program revolutionized space travel, providing a reusable spacecraft for a variety of missions.
46+
47+
### Hubble Space Telescope (1990)
48+
49+
The Hubble Space Telescope has provided unparalleled images and data, revolutionizing our understanding of the universe and contributing to countless astronomical discoveries.
50+
51+
### International Space Station (ISS) construction (1998—2011)
52+
53+
The ISS, a collaborative effort involving multiple space agencies, began construction with the launch of its first module, Zarya, in 1998. Over the following years, various modules were added, making the ISS a symbol of international cooperation in space exploration.
54+
55+
## Commercial spaceflight
56+
57+
After the Space Shuttle program, a new era emerged with a shift towards commercial spaceflight.
58+
59+
Private companies like Blue Origin, founded by Jeff Bezos in 2000, and SpaceX, founded by Elon Musk in 2002, entered the scene. These companies focused on developing reusable rocket technologies, significantly reducing launch costs.
60+
61+
SpaceX, in particular, achieved milestones like the first privately developed spacecraft to reach orbit (Dragon in 2010) and the first privately funded spacecraft to dock with the ISS (Dragon in 2012).
62+
63+
## Recent launch activity
64+
65+
The proliferation of commercial space companies has driven a surge in global launch activity within the last few years.
66+
67+
SpaceX’s Falcon 9 and Falcon Heavy, along with other vehicles from companies like Rocket Lab, have become workhorses for deploying satellites, conducting scientific missions, and ferrying crew to the ISS.
68+
69+
The advent of small satellite constellations, such as Starlink by SpaceX, has further fueled this increase in launches. The push for lunar exploration has added momentum to launch activities, with initiatives like NASA’s Artemis program and plans for crewed missions to the Moon and Mars.
70+
71+
## Looking forward
72+
73+
As technology continues to advance and global interest in space exploration grows, the future promises even more exciting developments in the realm of rocket launches and space travel.
74+
75+
Exploration will not only be limited to the Moon or Mars, but extend to other parts of our solar system such as Jupiter and Saturn’s moons, and beyond.

0 commit comments

Comments
 (0)