|
2 | 2 | <html> |
3 | 3 | <head> |
4 | 4 | <title>Sinopia Linked Data - Graph Explorer</title> |
5 | | - <link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" /> |
| 5 | + <link rel="stylesheet" href="https://pyscript.net/releases/2024.11.1/core.css" /> |
6 | 6 | <link href="static/css/main.css" rel="stylesheet" /> |
7 | 7 | <link href="static/css/header.css" rel="stylesheet" /> |
8 | 8 | <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css"> |
9 | 9 | <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script> |
10 | | - <script defer src="https://pyscript.net/latest/pyscript.js"></script> |
| 10 | + <script type="module" src="https://pyscript.net/releases/2024.11.1/core.js"></script> |
11 | 11 | <style> |
12 | 12 | strong { |
13 | 13 | font-weight: 800; |
14 | 14 | } |
15 | 15 | </style> |
16 | | - <py-config type="toml"> |
17 | | - packages = ["pandas", "markdown", "Jinja2", "./static/wheels/rdflib-7.1.1-py3-none-any.whl"] |
18 | | - |
19 | | - [[fetch]] |
20 | | - from = "src" |
21 | | - files = ["helpers.py", "load_rdf.py", "query_rdf.py", "sinopia_api.py", "state.py"] |
22 | | - |
23 | | - </py-config> |
24 | | - <py-script> |
25 | | - __version__ = "1.0.5" |
26 | | - import asyncio |
27 | | - import sys |
28 | | - import js |
29 | | - # Hack to load rdflib |
30 | | - # setattr(sys.stderr, 'isatty', lambda : True) |
31 | | - |
32 | | - from pyodide.ffi import create_proxy |
33 | | - |
34 | | - import helpers |
35 | | - |
36 | | - import rdflib |
37 | | - |
38 | | - |
39 | | - BIBFRAME = rdflib.Namespace("http://id.loc.gov/ontologies/bibframe/") |
40 | | - SINOPIA = rdflib.Namespace("http://sinopia.io/vocabulary/") |
41 | | - |
42 | | - from sinopia_api import show_groups |
43 | | - from load_rdf import bibframe_sparql as bf_sparql_widget, build_graph, download_graph |
44 | | - from query_rdf import download_query_results, run_query |
45 | | - |
46 | | - |
47 | | - |
48 | | - async def load_content(): |
49 | | - for element_id in ['intro', |
50 | | - 'retrieve-rdf', |
51 | | - 'bf-work-instance-item-rdf', |
52 | | - 'sparql-summary' |
53 | | - ]: |
54 | | - await helpers.render_markdown(element_id) |
55 | | - |
56 | | - |
57 | | - asyncio.ensure_future(load_content()) |
58 | | - |
59 | | - bf_sparql_widget("bf-sparql-query") |
60 | | - |
61 | | - helpers.set_versions(__version__) |
62 | | - |
63 | | - </py-script> |
64 | 16 | </head> |
65 | 17 | <body> |
66 | 18 | <div class="editor-navbar"> |
@@ -116,21 +68,21 @@ <h4>Version <span id="version" ></span></h4> |
116 | 68 | <div class="row"> |
117 | 69 | <div class="col"> |
118 | 70 | <div class="form-check"> |
119 | | - <input type="radio" py-click="asyncio.ensure_future(show_groups('Development'))" name="sinopia_env" value="Development" class="form-check-input"> |
| 71 | + <input type="radio" py-click="show_groups" name="sinopia_env" value="Development" class="form-check-input"> |
120 | 72 | <label for="https://api.development.sinopia.io/" class="form-check-label">Development</label> |
121 | 73 | </input> |
122 | 74 | </div> |
123 | 75 | <div class="form-check"> |
124 | | - <input type="radio" py-click="asyncio.ensure_future(show_groups('Stage'))" value="Stage" name="sinopia_env" class="form-check-input"> |
| 76 | + <input type="radio" py-click="show_groups" value="Stage" name="sinopia_env" class="form-check-input"> |
125 | 77 | <label for="https://api.stage.sinopia.io/" class="form-check-label">Stage</label> |
126 | 78 | </input> |
127 | 79 | </div> |
128 | 80 | <div class="form-check"> |
129 | | - <input type="radio" py-click="asyncio.ensure_future(show_groups('Production'))" value="Production" name="sinopia_env" class="form-check-input"> |
| 81 | + <input type="radio" py-click="show_groups" value="Production" name="sinopia_env" class="form-check-input"> |
130 | 82 | <label for="https://api.sinopia.io/" class="form-check-label">Production</label> |
131 | 83 | </input> |
132 | 84 | </div> |
133 | | - <button class="btn btn-primary btn-lg" py-click="asyncio.ensure_future(build_graph())"> |
| 85 | + <button class="btn btn-primary btn-lg" py-click="build_graph"> |
134 | 86 | <i class="spinner-border d-none" id="graph-loading-status"></i> |
135 | 87 | Build Graph |
136 | 88 | </button> |
@@ -220,5 +172,30 @@ <h5 class="modal-title" id="graph-repl-modal-title">Graph Explorer - Python REPL |
220 | 172 | </div> |
221 | 173 | </div> |
222 | 174 |
|
| 175 | + <!-- Load modal --> |
| 176 | + <div class="modal fade" tabindex="-1" id="splashModal"> |
| 177 | + <div class="modal-dialog modal-fullscreen-sm-down"> |
| 178 | + <div class="modal-content"> |
| 179 | + <div class="modal-header"> |
| 180 | + <h5 class="modal-title">Graph Explorer Initialization</h5> |
| 181 | + <button type="button" id="splashModalCloseBtn" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
| 182 | + </div> |
| 183 | + <div class="modal-body"> |
| 184 | + Loading... |
| 185 | + <div class="spinner-border text-secondary" role="status"> |
| 186 | + <span class="visually-hidden">Loading...</span> |
| 187 | + </div> |
| 188 | + </div> |
| 189 | + </div> |
| 190 | + </div> |
| 191 | +</div> |
| 192 | + |
| 193 | + <script> |
| 194 | + document.addEventListener('DOMContentLoaded', function () { |
| 195 | + var myModal = new bootstrap.Modal('#splashModal', {}); |
| 196 | + myModal.show(); |
| 197 | + }); |
| 198 | + </script> |
| 199 | + <script type="py" src="./main.py" config="./pyconfig.json"></script> |
223 | 200 | </body> |
224 | 201 | </html> |
0 commit comments