@@ -29,22 +29,24 @@ <h1>Gene Leads Lite<small>Minimal <a href="https://github.com/eweitz/ideogram/bl
2929 < div id ="ideogram-container " style ="visibility: hidden; "> </ div >
3030 < div >
3131 < pre >
32- /** Upon clicking a triangular annotation or tooltip, plot that gene */
32+ // Setup
33+ npm install ideogram
34+
35+ // Either use a modern import statement
36+ import Ideogram from 'ideogram'
37+
38+ // or use a classic HTML script tag
39+ <script src="https://cdn.jsdelivr.net/npm/ideogram@1.50.0/dist/js/ideogram.min.js"></script>
40+
41+ // Upon clicking a triangular annotation, plot that gene
3342 function onClickAnnot(annot) {
3443 ideogram.plotRelatedGenes(annot.name);
3544 }
3645
37- // Ideogram configuration object
38- config = {
39- organism: 'homo-sapiens',
46+ const ideogram = Ideogram.initGeneLeads({
4047 container: '#ideogram-container',
41- legendName: 'Gene leads',
42- showGeneStructureInTooltip: true,
43- showProteinInTooltip: true,
4448 onClickAnnot
45- }
46-
47- const ideogram = Ideogram.initGeneLeads(config);
49+ });
4850 </ pre >
4951 </ div >
5052 </ div >
@@ -54,17 +56,12 @@ <h1>Gene Leads Lite<small>Minimal <a href="https://github.com/eweitz/ideogram/bl
5456 ideogram . plotRelatedGenes ( annot . name ) ;
5557 }
5658
57- // Ideogram configuration object
58- config = {
59+ // Instantiate Gene Leads ideogram
60+ const ideogram = Ideogram . initGeneLeads ( {
5961 organism : 'homo-sapiens' ,
6062 container : '#ideogram-container' ,
61- legendName : 'Gene leads' ,
62- showGeneStructureInTooltip : true ,
63- showProteinInTooltip : true ,
6463 onClickAnnot
65- }
66-
67- const ideogram = Ideogram . initGeneLeads ( config ) ;
64+ } ) ;
6865 </ script >
6966</ body >
7067</ html >
0 commit comments