Skip to content

Commit fb5a740

Browse files
committed
v1.0.2
1 parent 1a24621 commit fb5a740

File tree

3 files changed

+38
-16
lines changed

3 files changed

+38
-16
lines changed

README.md

+25-10
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@
77
[npm-badge]: https://img.shields.io/npm/v/genomefeatures.png?style=flat-square
88
[npm]: https://www.npmjs.com/package/genomefeatures
99

10-
# Instructions
11-
12-
```bash
13-
git clone [email protected]:GMOD/genomefeatures
14-
yarn
15-
yarn dev # vite demo
16-
yarn storybook # storybook examples
17-
```
18-
1910
# Screenshot
2011

2112
![Example 1](images/ExampleIsoform1.png)
@@ -26,6 +17,17 @@ Demo https://gmod.org/genomefeatures/
2617

2718
Storybook https://gmod.org/genomefeatures/storybook
2819

20+
# Instructions
21+
22+
Install from NPM
23+
24+
```bash
25+
yarn add genomefeatures
26+
```
27+
28+
Or see see [example/index.html](example/index.html) for CDN import style usage,
29+
e.g.
30+
2931
## Loading data
3032

3133
### Legacy access pattern - Apollo REST API
@@ -141,6 +143,19 @@ And then in your HTML
141143
<svg id="svgelement"></svg>
142144
```
143145

146+
## Developers
147+
148+
```bash
149+
git clone [email protected]:GMOD/genomefeatures
150+
yarn dev # vite demo
151+
yarn storybook # storybook examples
152+
```
153+
144154
## Notes
145155

146-
Can be run in ReactJS, VueJS, VanillaJS
156+
Originally called https://github.com/GMOD/GenomeFeatureComponent
157+
158+
Created by Nathan Dunn (@nathandunn), used by Alliance of Genome Resources
159+
160+
Updated in 2025 by Colin Diesh (@cmdcolin) to add ability to fetch from static
161+
files

example/index.html

+11-4
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,28 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Genome Feature Component Example</title>
7-
<!-- Import the UMD bundle from unpkg -->
8-
<script src="https://unpkg.com/genomefeatures/dist/genomefeatures.umd.cjs"></script>
7+
<link
8+
rel="stylesheet"
9+
href="https://unpkg.com/genomefeatures/dist/genomefeatures.css"
10+
/>
911
</head>
1012
<body>
1113
<svg id="svgelement"></svg>
1214

1315
<script>
1416
async function initializeViewer() {
17+
// note the CSS import in the header as well
18+
19+
// we use esm import here. alternatively, you can import as script tag with
20+
// https://unpkg.com/genomefeatures/dist/genomefeatures.umd.cjs and access window.GenomeFeatureViewer
1521
const {
1622
parseLocString,
1723
fetchNCListData,
1824
fetchTabixVcfData,
1925
GenomeFeatureViewer,
20-
} = window.GenomeFeatureViewer
26+
} = await import(
27+
'https://unpkg.com/genomefeatures/dist/genomefeatures.js'
28+
)
2129

2230
const locString = '2L:130639..135911'
2331
const genome = 'fly'
@@ -56,7 +64,6 @@
5664
)
5765
}
5866

59-
// Initialize when the page loads
6067
window.addEventListener('load', initializeViewer)
6168
</script>
6269
</body>

index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ <h1>Genome features</h1>
1414
>https://github.com/GMOD/genomefeatures</a
1515
>
1616
for more info. See also our storybook at
17-
<a href="https://gmod.org/genomefeatures/storybook-static"
18-
>https://gmod.org/genomefeatures/storybook-static</a
17+
<a href="https://gmod.org/genomefeatures/storybook"
18+
>https://gmod.org/genomefeatures/storybook</a
1919
>
2020
</p>
2121
<div class="viewer-border">

0 commit comments

Comments
 (0)