-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-dashboard.html
More file actions
205 lines (193 loc) · 10.8 KB
/
example-dashboard.html
File metadata and controls
205 lines (193 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Example dashboard | Namaste Framework</title>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preload" as="style" href="./_observablehq/theme-air,near-midnight,alt,wide.css">
<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" crossorigin>
<link rel="stylesheet" type="text/css" href="./_observablehq/theme-air,near-midnight,alt,wide.css">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" crossorigin>
<link rel="modulepreload" href="./_observablehq/client.js">
<link rel="modulepreload" href="./_observablehq/runtime.js">
<link rel="modulepreload" href="./_observablehq/stdlib.js">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/@observablehq/plot@0.6.13/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/binary-search-bounds@2.0.5/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-array@3.2.4/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-axis@3.0.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-brush@3.0.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-chord@3.0.1/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-color@3.1.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-contour@4.0.2/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-delaunay@6.0.4/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-dispatch@3.0.1/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-drag@3.0.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-dsv@3.0.1/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-ease@3.0.1/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-fetch@3.0.1/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-force@3.0.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-format@3.1.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-geo@3.1.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-hierarchy@3.1.2/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-interpolate@3.0.1/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-path@3.1.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-polygon@3.0.1/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-quadtree@3.0.1/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-random@3.0.1/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-scale-chromatic@3.0.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-scale@4.0.2/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-selection@3.0.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-shape@3.2.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-time-format@4.1.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-time@3.1.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-timer@3.0.1/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-transition@3.0.1/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3-zoom@3.0.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/d3@7.8.5/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/delaunator@5.0.0/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/internmap@2.0.3/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/interval-tree-1d@1.0.4/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/isoformat@0.2.1/+esm">
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/robust-predicates@3.0.2/+esm">
<script type="module">
import {define} from "./_observablehq/client.js";
define({id: "7a66a2dd", inputs: ["FileAttachment"], outputs: ["launches"], files: [{"name":"./data/launches.csv","mimeType":"text/csv","path":"./_file/data/launches.csv"}], body: (FileAttachment) => {
const launches = FileAttachment("data/launches.csv").csv({typed: true});
return {launches};
}});
define({id: "fdf7eadc", inputs: ["Plot","d3","launches"], outputs: ["color"], body: (Plot,d3,launches) => {
const color = Plot.scale({
color: {
type: "categorical",
domain: d3.groupSort(launches, (D) => -D.length, (d) => d.state).filter((d) => d !== "Other"),
unknown: "var(--theme-foreground-muted)"
}
});
return {color};
}});
define({id: "92cac4f1", inline: true, inputs: ["launches","display"], body: async (launches,display) => {
display(await(
launches.filter((d) => d.stateId === "US").length.toLocaleString("en-US")
))
}});
define({id: "f84e9749", inline: true, inputs: ["launches","display"], body: async (launches,display) => {
display(await(
launches.filter((d) => d.stateId === "SU" || d.stateId === "RU").length.toLocaleString("en-US")
))
}});
define({id: "3f89d55f", inline: true, inputs: ["launches","display"], body: async (launches,display) => {
display(await(
launches.filter((d) => d.stateId === "CN").length.toLocaleString("en-US")
))
}});
define({id: "d55bddad", inline: true, inputs: ["launches","display"], body: async (launches,display) => {
display(await(
launches.filter((d) => d.stateId !== "US" && d.stateId !== "SU" && d.stateId !== "RU" && d.stateId !== "CN").length.toLocaleString("en-US")
))
}});
define({id: "a6446d56", inputs: ["Plot","color"], outputs: ["launchTimeline"], body: (Plot,color) => {
function launchTimeline(data, {width} = {}) {
return Plot.plot({
title: "Launches over the years",
width,
height: 300,
y: {grid: true, label: "Launches"},
color: {...color, legend: true},
marks: [
Plot.rectY(data, Plot.binX({y: "count"}, {x: "date", fill: "state", interval: "year", tip: true})),
Plot.ruleY([0])
]
});
}
return {launchTimeline};
}});
define({id: "da415336", inline: true, inputs: ["resize","launchTimeline","launches","display"], body: async (resize,launchTimeline,launches,display) => {
display(await(
resize((width) => launchTimeline(launches, {width}))
))
}});
define({id: "bdc917ac", inputs: ["Plot","color"], outputs: ["vehicleChart"], body: (Plot,color) => {
function vehicleChart(data, {width}) {
return Plot.plot({
title: "Popular launch vehicles",
width,
height: 300,
marginTop: 0,
marginLeft: 50,
x: {grid: true, label: "Launches"},
y: {label: null},
color: {...color, legend: true},
marks: [
Plot.rectX(data, Plot.groupY({x: "count"}, {y: "family", fill: "state", tip: true, sort: {y: "-x"}})),
Plot.ruleX([0])
]
});
}
return {vehicleChart};
}});
define({id: "87987196", inline: true, inputs: ["resize","vehicleChart","launches","display"], body: async (resize,vehicleChart,launches,display) => {
display(await(
resize((width) => vehicleChart(launches, {width}))
))
}});
</script>
<input id="observablehq-sidebar-toggle" type="checkbox" title="Toggle sidebar">
<label id="observablehq-sidebar-backdrop" for="observablehq-sidebar-toggle"></label>
<nav id="observablehq-sidebar">
<ol>
<label id="observablehq-sidebar-close" for="observablehq-sidebar-toggle"></label>
<li class="observablehq-link"><a href="./">Namaste Framework</a></li>
</ol>
<ol>
<li class="observablehq-link observablehq-link-active"><a href="./example-dashboard">Example dashboard</a></li>
<li class="observablehq-link"><a href="./example-report">Example report</a></li>
<li class="observablehq-link"><a href="./weather">Weather report</a></li>
</ol>
</nav>
<script>{Object.assign(document.createElement("a"),{href:""}).password&&location.replace(location.href);const e=document.querySelector("#observablehq-sidebar"),o=document.querySelector("#observablehq-sidebar-toggle"),r=sessionStorage.getItem("observablehq-sidebar");r?o.checked=r==="true":o.indeterminate=!0;for(const t of document.querySelectorAll("#observablehq-sidebar summary")){const s=t.parentElement;switch(sessionStorage.getItem(`observablehq-sidebar:${t.textContent}`)){case"true":s.open=!0;break;case"false":s.classList.contains("observablehq-section-active")||(s.open=!1);break}}addEventListener("beforeunload",()=>sessionStorage.setItem("observablehq-sidebar-scrolly",`${e.scrollTop}`));const a=sessionStorage.getItem("observablehq-sidebar-scrolly");a!=null&&(e.style.cssText="overflow: hidden;",e.scrollTop=+a,e.style.cssText="");}</script>
<div id="observablehq-center">
<main id="observablehq-main" class="observablehq">
<h1 id="rocket-launches-%F0%9F%9A%80" tabindex="-1"><a class="observablehq-header-anchor" href="#rocket-launches-%F0%9F%9A%80">Rocket launches 🚀</a></h1>
<span><!-- Load and transform the data -->
</span><div id="cell-7a66a2dd" class="observablehq observablehq--block"></div>
<span><!-- A shared color scale for consistency, sorted by the number of launches -->
</span><div id="cell-fdf7eadc" class="observablehq observablehq--block"></div>
<span><!-- Cards with big numbers -->
</span><div class="grid grid-cols-4">
<div class="card">
<h2>United States 🇺🇸</h2>
<span class="big"><span id="cell-92cac4f1" class="observablehq--loading"></span></span>
</div>
<div class="card">
<h2>Russia 🇷🇺 <span class="muted">/ Soviet Union</span></h2>
<span class="big"><span id="cell-f84e9749" class="observablehq--loading"></span></span>
</div>
<div class="card">
<h2>China 🇨🇳</h2>
<span class="big"><span id="cell-3f89d55f" class="observablehq--loading"></span></span>
</div>
<div class="card">
<h2>Other</h2>
<span class="big"><span id="cell-d55bddad" class="observablehq--loading"></span></span>
</div>
</div>
<span><!-- Plot of launch history -->
</span><div id="cell-a6446d56" class="observablehq observablehq--block"></div>
<div class="grid grid-cols-1">
<div class="card">
<span id="cell-da415336" class="observablehq--loading"></span>
</div>
</div>
<span><!-- Plot of launch vehicles -->
</span><div id="cell-bdc917ac" class="observablehq observablehq--block"></div>
<div class="grid grid-cols-1">
<div class="card">
<span id="cell-87987196" class="observablehq--loading"></span>
</div>
</div>
<p>Data: Jonathan C. McDowell, <a href="https://planet4589.org/space/gcat">General Catalog of Artificial Space Objects</a></p>
</main>
<footer id="observablehq-footer">
<nav><a rel="prev" href="./"><span>Namaste Framework</span></a><a rel="next" href="./example-report"><span>Example report</span></a></nav>
<div>Built with <a href="https://observablehq.com/" target="_blank">Observable</a> on <a title="2024-02-18T08:27:57">Feb 18, 2024</a>.</div>
</footer>
</div>