Commit 75eec23 1 parent 1a24621 commit 75eec23 Copy full SHA for 75eec23
File tree 3 files changed +39
-16
lines changed
3 files changed +39
-16
lines changed Original file line number Diff line number Diff line change 7
7
[ npm-badge ] : https://img.shields.io/npm/v/genomefeatures.png?style=flat-square
8
8
[ npm ] : https://www.npmjs.com/package/genomefeatures
9
9
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
-
19
10
# Screenshot
20
11
21
12
![ Example 1] ( images/ExampleIsoform1.png )
@@ -26,6 +17,17 @@ Demo https://gmod.org/genomefeatures/
26
17
27
18
Storybook https://gmod.org/genomefeatures/storybook
28
19
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
+
29
31
## Loading data
30
32
31
33
### Legacy access pattern - Apollo REST API
@@ -141,6 +143,20 @@ And then in your HTML
141
143
<svg id =" svgelement" ></svg >
142
144
```
143
145
146
+ ## Developers
147
+
148
+ ``` bash
149
+ git clone
[email protected] :GMOD/genomefeatures
150
+ yarn add genomefeatures
151
+ yarn dev # vite demo
152
+ yarn storybook # storybook examples
153
+ ```
154
+
144
155
## Notes
145
156
146
- Can be run in ReactJS, VueJS, VanillaJS
157
+ Originally called https://github.com/GMOD/GenomeFeatureComponent
158
+
159
+ Created by Nathan Dunn (@nathandunn ), used by Alliance of Genome Resources
160
+
161
+ Updated in 2025 by Colin Diesh (@cmdcolin ) to add ability to fetch from static
162
+ files
Original file line number Diff line number Diff line change 4
4
< meta charset ="UTF-8 " />
5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6
6
< 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
+ />
9
11
</ head >
10
12
< body >
11
13
< svg id ="svgelement "> </ svg >
12
14
13
15
< script >
14
16
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
15
21
const {
16
22
parseLocString,
17
23
fetchNCListData,
18
24
fetchTabixVcfData,
19
25
GenomeFeatureViewer,
20
- } = window . GenomeFeatureViewer
26
+ } = await import (
27
+ 'https://unpkg.com/genomefeatures/dist/genomefeatures.js'
28
+ )
21
29
22
30
const locString = '2L:130639..135911'
23
31
const genome = 'fly'
56
64
)
57
65
}
58
66
59
- // Initialize when the page loads
60
67
window . addEventListener ( 'load' , initializeViewer )
61
68
</ script >
62
69
</ body >
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ <h1>Genome features</h1>
14
14
> https://github.com/GMOD/genomefeatures</ a
15
15
>
16
16
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
19
19
>
20
20
</ p >
21
21
< div class ="viewer-border ">
You can’t perform that action at this time.
0 commit comments