'Display browser for the visualization denoted by id and add the datasets listed in `dataset_ids`.'

@web.expose
@web.require_login()
def trackster(self, trans, **kwargs):

    app = {'jscript': 'viz/trackster'}
    id = kwargs.get('id', None)
    new_dataset_id = kwargs.get('dataset_id', None)
    if (not id):
        dbkey = None
        if new_dataset_id:
            decoded_id = self.decode_id(new_dataset_id)
            hda = self.hda_manager.get_owned(decoded_id, trans.user, current_history=trans.user)
            dbkey = hda.dbkey
            if (dbkey == '?'):
                dbkey = kwargs.get('dbkey', None)
        app['default_dbkey'] = dbkey
    else:
        vis = self.get_visualization(trans, id, check_ownership=False, check_accessible=True)
        app['viz_config'] = self.get_visualization_config(trans, vis)
    app['id'] = id
    app['add_dataset'] = new_dataset_id
    gene_region = GenomeRegion.from_str(kwargs.get('gene_region', ''))
    if (gene_region.chrom is not None):
        app['gene_region'] = {'chrom': gene_region.chrom, 'start': gene_region.start, 'end': gene_region.end}
    return trans.fill_template('galaxy.panels.mako', config={'right_panel': True, 'app': app})
