-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
79 lines (70 loc) · 2.53 KB
/
index.html
File metadata and controls
79 lines (70 loc) · 2.53 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Saskatchewan Ag Export Dashboard</title>
<script src="https://cdn.plot.ly/plotly-2.27.0.min.js"></script>
<style>
/* --- Dark Mode MVP Framework --- */
:root {
--bg-color: #121212; /* 极深灰背景 */
--card-bg: #1e1e1e; /* 卡片背景 */
--text-main: #e0e0e0; /* 主文字色 */
--text-sub: #a0a0a0; /* 副文字色 */
--accent: #00d2ff; /* 科技蓝点缀 */
}
body {
font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
background-color: var(--bg-color);
color: var(--text-main);
margin: 0;
padding: 40px;
display: flex;
justify-content: center;
}
.card {
background-color: var(--card-bg);
width: 100%;
max-width: 1400px; /* 宽屏视野 */
padding: 30px;
border-radius: 12px;
box-shadow: 0 10px 30px rgba(0,0,0,0.5); /* 深邃阴影 */
border: 1px solid #333; /* 微妙的边框 */
}
h1 {
color: var(--text-main);
font-weight: 300;
border-bottom: 2px solid var(--accent);
display: inline-block;
padding-bottom: 10px;
margin-bottom: 5px;
}
p { color: var(--text-sub); margin-bottom: 30px; }
#chart-box {
width: 100%;
height: 700px; /* 稍微加高一点 */
border-radius: 4px;
/* 这里的背景色留白,等待 Plotly 图表填充 */
}
</style>
</style>
</head>
<body>
<div class="card">
<h1>🌾 Saskatchewan Agricultural Export Dashboard (2024–2025Oct)</h1>
<p>Data‑Driven Trade Insights · Automatically Generated</p>
<div id="chart-box"></div>
</div>
<script>
// 读取刚才生成的 JSON 文件
fetch('export_data.json')
.then(response => response.json())
.then(data => {
// 把图画在 id="chart-box" 的格子里
Plotly.newPlot('chart-box', data.data, data.layout, {responsive: true});
})
.catch(err => alert("加载失败!请确保你启动了 python server。错误信息:" + err));
</script>
</body>
</html>