-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflow.html
More file actions
270 lines (241 loc) · 8.08 KB
/
flow.html
File metadata and controls
270 lines (241 loc) · 8.08 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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IPCC Data Processing Flow</title>
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
background-color: #f5f5f5;
height: 100vh;
overflow: hidden;
}
.container {
width: 100%;
height: 100%;
background-color: white;
display: flex;
flex-direction: column;
}
.header {
padding: 12px 20px;
border-bottom: 1px solid #ddd;
background-color: #f9f9f9;
display: flex;
justify-content: space-between;
align-items: center;
}
.header h1 {
font-size: 24px;
color: #333;
}
.controls {
display: flex;
gap: 10px;
align-items: center;
}
.controls button {
padding: 8px 16px;
border: 1px solid #ddd;
background-color: #fff;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.3s;
}
.controls button:hover {
background-color: #e9e9e9;
}
.controls button:active {
background-color: #d0d0d0;
}
.zoom-level {
min-width: 50px;
text-align: center;
font-size: 14px;
color: #666;
}
.diagram-container {
flex: 1;
overflow: auto;
position: relative;
touch-action: manipulation;
}
.diagram-wrapper {
display: inline-block;
transform-origin: 0 0;
padding: 40px;
cursor: grab;
}
.diagram-wrapper.grabbing {
cursor: grabbing;
}
.mermaid {
min-width: max-content;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>IPCC Data Processing Flow</h1>
<div class="controls">
<button id="zoomInBtn" title="Zoom in (Ctrl++)">🔍+</button>
<button id="zoomOutBtn" title="Zoom out (Ctrl+-)">🔍−</button>
<button id="fitBtn" title="Fit to view">Fit</button>
<button id="resetBtn" title="Reset view">Reset</button>
<span class="zoom-level"><span id="zoomPercent">100</span>%</span>
</div>
</div>
<div class="diagram-container" id="diagramContainer">
<div class="diagram-wrapper" id="diagramWrapper">
<div class="mermaid">
flowchart LR
IPCC[IPCC Website]
SCRAPE[Scraped repository HTML]
SCRAPEASSETS[Scraped assets]
CLEANSCRAPE[Cleaned repository HTML]
CLEANWIKI[Cleaned repository Wikitext]
MAIN[Main version HTML + RDFa + Pandoc]
MW[MediaWiki]
WB[Wikibase]
BB[Data model: Minimum chapter information]
ASSETUID[UID for assets]
CROSSREF[Crossref doi data]
AUTHORS[Authors data]
IPCCGLOSS[IPCC glossary]
DICTIONARY[#sc Dictionary]
IPCCRICH[IPCC enrichment]
OTHERRICH[Other enrichment]
QUERY[Query / API / Data access]
API[API/Query]
IPCC -->|scrape| SCRAPE
IPCC -->|scrape| SCRAPEASSETS
SCRAPE -->|clean| CLEANSCRAPE
CLEANSCRAPE -->|clean & convert| CLEANWIKI
CLEANWIKI -->|import text| MW
MW -->|store| MAIN
CLEANWIKI -->|generate| BB
BB -->|import data record| WB
ASSETUID -->|generate| SCRAPEASSETS
SCRAPEASSETS -->|import assets| MW
CROSSREF -->|add| IPCCRICH
AUTHORS -->|add| IPCCRICH
IPCCGLOSS -->|add| IPCCRICH
DICTIONARY -->|add| OTHERRICH
OTHERRICH --> API
IPCCRICH --> API
MW <--> API
API <--> WB
API --> QUERY
WB -->|has urls, provides information, enrichment| MW
</div>
</div>
</div>
</div>
<script>
mermaid.initialize({
startOnLoad: true,
theme: 'default',
securityLevel: 'loose',
flowchart: { useMaxWidth: false }
});
mermaid.contentLoaded();
const container = document.getElementById('diagramContainer');
const wrapper = document.getElementById('diagramWrapper');
const zoomInBtn = document.getElementById('zoomInBtn');
const zoomOutBtn = document.getElementById('zoomOutBtn');
const fitBtn = document.getElementById('fitBtn');
const resetBtn = document.getElementById('resetBtn');
const zoomPercent = document.getElementById('zoomPercent');
let currentZoom = 1;
let isDragging = false;
let dragStartX = 0;
let dragStartY = 0;
let scrollStartX = 0;
let scrollStartY = 0;
// Zoom functions
function setZoom(zoom) {
currentZoom = Math.max(0.1, Math.min(3, zoom));
wrapper.style.transform = `scale(${currentZoom})`;
zoomPercent.textContent = Math.round(currentZoom * 100);
}
zoomInBtn.addEventListener('click', () => {
setZoom(currentZoom + 0.2);
});
zoomOutBtn.addEventListener('click', () => {
setZoom(currentZoom - 0.2);
});
fitBtn.addEventListener('click', () => {
const containerWidth = container.clientWidth;
const containerHeight = container.clientHeight;
const wrapperWidth = wrapper.scrollWidth;
const wrapperHeight = wrapper.scrollHeight;
const scaleWidth = containerWidth / wrapperWidth;
const scaleHeight = containerHeight / wrapperHeight;
const scale = Math.min(scaleWidth, scaleHeight) * 0.95;
setZoom(scale);
container.scrollLeft = (wrapper.scrollWidth * currentZoom - containerWidth) / 2;
container.scrollTop = (wrapper.scrollHeight * currentZoom - containerHeight) / 2;
});
resetBtn.addEventListener('click', () => {
setZoom(1);
container.scrollLeft = 0;
container.scrollTop = 0;
});
// Pan/drag functionality
container.addEventListener('mousedown', (e) => {
if (e.button === 0) { // Left mouse button
isDragging = true;
dragStartX = e.clientX;
dragStartY = e.clientY;
scrollStartX = container.scrollLeft;
scrollStartY = container.scrollTop;
wrapper.classList.add('grabbing');
}
});
document.addEventListener('mousemove', (e) => {
if (isDragging) {
const deltaX = e.clientX - dragStartX;
const deltaY = e.clientY - dragStartY;
container.scrollLeft = scrollStartX - deltaX;
container.scrollTop = scrollStartY - deltaY;
}
});
document.addEventListener('mouseup', () => {
isDragging = false;
wrapper.classList.remove('grabbing');
});
// Keyboard shortcuts
document.addEventListener('keydown', (e) => {
if (e.ctrlKey) {
if (e.key === '+' || e.key === '=') {
e.preventDefault();
setZoom(currentZoom + 0.2);
} else if (e.key === '-') {
e.preventDefault();
setZoom(currentZoom - 0.2);
} else if (e.key === '0') {
e.preventDefault();
resetBtn.click();
}
}
});
// Mouse wheel zoom
container.addEventListener('wheel', (e) => {
if (e.ctrlKey) {
e.preventDefault();
const delta = e.deltaY > 0 ? -0.1 : 0.1;
setZoom(currentZoom + delta);
}
}, { passive: false });
</script>
</body>
</html>