JBrowse 2 · Linear Genome View examples

Disable the add-track UI

Hide the "add track" UI for a locked-down embed.

The track list opens on load here so you can see what is missing: it has no add-track button. disableAddTracks also turns off sequence search and multi-wiggle track creation, and removes the File menu that menuBar would add.

View source — 26 lines
import { LinearGenomeView } from '@jbrowse/react-linear-genome-view2'

export default function DisableAddTrack() {
  return (
    <LinearGenomeView
      assembly={{
        name: 'volvox',
        uri: 'https://jbrowse.org/genomes/volvox/volvox.2bit',
      }}
      tracks={[
        {
          trackId: 'volvox_gff3',
          name: 'Volvox genes',
          uri: 'https://jbrowse.org/code/jb2/main/test_data/volvox/volvox.sort.gff3.gz',
        },
      ]}
      height="400px"
      view={{
        loc: 'ctgA:1105..1221',
        tracks: ['volvox_gff3'],
        tracklist: true,
      }}
      disableAddTracks
    />
  )
}