Skip to content

Commit

Permalink
Refine Gene Leads lite example code
Browse files Browse the repository at this point in the history
  • Loading branch information
eweitz committed Dec 17, 2024
1 parent b4aea9f commit 9254fcb
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions examples/vanilla/gene-leads-lite.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,24 @@ <h1>Gene Leads Lite<small>Minimal <a href="https://github.com/eweitz/ideogram/bl
<div id="ideogram-container" style="visibility: hidden;"></div>
<div>
<pre>
/** Upon clicking a triangular annotation or tooltip, plot that gene */
// Setup
npm install ideogram

// Either use a modern import statement
import Ideogram from 'ideogram'

// or use a classic HTML script tag
&lt;script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/ideogram.min.js"&gt;&lt;/script&gt;

// Upon clicking a triangular annotation, plot that gene
function onClickAnnot(annot) {
ideogram.plotRelatedGenes(annot.name);
}

// Ideogram configuration object
config = {
organism: 'homo-sapiens',
const ideogram = Ideogram.initGeneLeads({
container: '#ideogram-container',
legendName: 'Gene leads',
showGeneStructureInTooltip: true,
showProteinInTooltip: true,
onClickAnnot
}

const ideogram = Ideogram.initGeneLeads(config);
});
</pre>
</div>
</div>
Expand All @@ -54,17 +56,12 @@ <h1>Gene Leads Lite<small>Minimal <a href="https://github.com/eweitz/ideogram/bl
ideogram.plotRelatedGenes(annot.name);
}

// Ideogram configuration object
config = {
// Instantiate Gene Leads ideogram
const ideogram = Ideogram.initGeneLeads({
organism: 'homo-sapiens',
container: '#ideogram-container',
legendName: 'Gene leads',
showGeneStructureInTooltip: true,
showProteinInTooltip: true,
onClickAnnot
}

const ideogram = Ideogram.initGeneLeads(config);
});
</script>
</body>
</html>

0 comments on commit 9254fcb

Please sign in to comment.