@abi-software/map-side-bar 2.14.1-simulation.8 → 2.14.2-demo.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/map-side-bar.js +14961 -19518
- package/dist/map-side-bar.umd.cjs +75 -84
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/App.vue +0 -6
- package/src/components/BadgesGroup.vue +18 -48
- package/src/components/ConnectivityInfo.vue +126 -29
- package/src/components/DatasetCard.vue +8 -433
- package/src/components/DatasetExplorer.vue +138 -255
- package/src/components/ImageGallery.vue +359 -11
- package/src/components/SideBar.vue +0 -8
- package/src/components.d.ts +0 -5
- package/src/components/FileBrowser.vue +0 -252
- package/src/components/scripts/utilities.js +0 -50
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
const resolveURL = (relative, base) => {
|
|
2
|
-
const resolved = new URL(relative, base);
|
|
3
|
-
return resolved.href;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
const readProtocolData = async (item, baseUrl) => {
|
|
7
|
-
if (item && item.resource?.url) {
|
|
8
|
-
const resolvedUrl = resolveURL(item.resource.url, baseUrl)
|
|
9
|
-
const response = await fetch(resolvedUrl)
|
|
10
|
-
const data = await response.json()
|
|
11
|
-
//convert url
|
|
12
|
-
const fields = ["csv_file", "protocol", "thumbnail"]
|
|
13
|
-
data.forEach((protocol) => {
|
|
14
|
-
fields.forEach((field) => {
|
|
15
|
-
if (field in protocol) {
|
|
16
|
-
protocol[field] = resolveURL(protocol[field], resolvedUrl)
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
})
|
|
20
|
-
return data
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const updateProtocolData = async (entry, baseUrl) => {
|
|
27
|
-
if (entry["simulation-protocols"]) {
|
|
28
|
-
const processedData = []
|
|
29
|
-
for (const item of entry["simulation-protocols"]) {
|
|
30
|
-
const data = await readProtocolData(item, baseUrl)
|
|
31
|
-
if (data) {
|
|
32
|
-
processedData.push(...data)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return processedData
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const processProtocolsData = async (results, data, baseUrl) => {
|
|
40
|
-
for (const entry of data) {
|
|
41
|
-
const protocolData = await updateProtocolData(entry, baseUrl)
|
|
42
|
-
entry["protocol-data"] = protocolData
|
|
43
|
-
}
|
|
44
|
-
results.unshift(...data)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export {
|
|
48
|
-
processProtocolsData,
|
|
49
|
-
resolveURL,
|
|
50
|
-
}
|