This repository has been archived by the owner on Jul 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
37 lines (33 loc) · 1.6 KB
/
index.html
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
<!doctype html>
<html>
<head>
<title>prov-vis demo</title>
<!-- Get the CSS for the underlying react-workflow-viz: -->
<link href="https://unpkg.com/@hms-dbmi-bgm/react-workflow-viz/dist/react-workflow-viz.min.css" type="text/css" rel="stylesheet" />
</head>
<body>
<p>
This demonstrates how to use
<a href="https://github.com/hubmapconsortium/prov-vis/">prov-vis</a>
in static HTML.
</p>
<div id="prov-vis"></div>
<!-- External libraries listed in nwb.config.js need to be loaded first: -->
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<!-- Load prov-vis. (In production, add a version number!) -->
<script src="https://unpkg.com/@hubmap/prov-vis/umd/@hubmap/prov-vis.min.js"></script>
<!-- ... or "npm run build" to override the unpkg CDN and preview it locally.
(If not built, this will 404, and the CDN will still be used.) -->
<script src="./umd/@hubmap/prov-vis.js"></script>
<script type="module">
// This import might be replaced with an AJAX call, or JSON templated into the page on the server.
// Module loading is subject to CORS restrictions, so this demo needs a static file server.
import prov from './tests/fixtures/simple-prov.js';
hubmapProvVis.renderProvVis('prov-vis', prov, {
getNameForActivity: (id, details) => `Act ID: ${id} ${Object.keys(details)}`,
getNameForEntity: (id, details) => `Ent ID: ${id}`,
renderDetailPane: (details) => React.createElement('pre', null, JSON.stringify(details))
});
</script>
</body>
</html>