JBrowse 2 · Build Your Own examples

Build your own genome browser

JBrowse's engine — assemblies, adapters, workers, coordinates — with your own UI around it. Drag to pan, wheel to zoom, drag the scalebar to zoom to a range.

That is the scalebar example, running its own source. Every page below is one file like it.

Only one of them renders any Material UI: Multiple tracks is left stock, so you can see a display before you swap anything. Everywhere else a track's chrome — its loading, error and too-large states, the controls in its corner — comes from @jbrowse/display-ui, which is 38 KB gzipped and depends on no UI toolkit at all.

That redirects what JBrowse's own displays draw; it does not unship what they import, so Material UI is still in the bundle on every page here —140 KB of chrome that no longer renders. Writing your own display component over DisplayChromeBase is what removes it: 39 KB gzipped for the same five states. The pages below take the first route, which is the one that needs no display of your own.

Most examples import three published packages, all on the same version:@jbrowse/react-linear-genome-view2 for the engine, @jbrowse/core for the hooks and the palette, and @jbrowse/display-ui for the display seams. The three that reach further say why they do:Track settings takes its colour-scheme labels from @jbrowse/plugin-alignments, Search by name calls the search helpers in @jbrowse/plugin-linear-genome-view, and Comparing two genomes needs a session whose views are an array, which is @jbrowse/react-app2.