Skip to content

Commit

Permalink
#39 - add jbrowse circular (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
samrichca authored Sep 15, 2023
1 parent 071b2a9 commit c9b5434
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 16 deletions.
43 changes: 27 additions & 16 deletions components/pages/explorer/Jbrowse/JbrowseWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,30 @@
*
*/

import { useEffect, useState } from 'react';
import ErrorNotification from '@/components/ErrorNotification';
import { OverlayLoader } from '@/components/Loader';
import createArrangerFetcher from '@/components/utils/arrangerFetcher';
import { getConfig } from '@/global/config';
import { SCORE_API_DOWNLOAD_PATH } from '@/global/utils/constants';
import { css, useTheme } from '@emotion/react';
import urlJoin from 'url-join';
import { find } from 'lodash';
import { useTableContext } from '@overture-stack/arranger-components';
import { JbrowseLinear } from '@overture-stack/dms-jbrowse-components';
import { JbrowseCircular, JbrowseLinear } from '@overture-stack/dms-jbrowse-components';
import SQON from '@overture-stack/sqon-builder';
import { getConfig } from '@/global/config';
import { SCORE_API_DOWNLOAD_PATH } from '@/global/utils/constants';
import createArrangerFetcher from '@/components/utils/arrangerFetcher';
import ErrorNotification from '@/components/ErrorNotification';
import { find } from 'lodash';
import { useEffect, useState } from 'react';
import urlJoin from 'url-join';
import { jbrowseAssemblyObject } from './assembly';
import { jbrowseCircularDefaultSession, jbrowseLinearDefaultSession } from './defaultSession';
import JbrowseSelectedFilesTable from './JbrowseSelectedFilesTable';
import {
JbrowseQueryNode,
JbrowseCompatibleFile,
JbrowseInput,
ScoreDownloadResult,
JbrowseQueryNode,
ScoreDownloadParams,
ScoreDownloadResult,
} from './types';
import { checkJbrowseCompatibility, jbrowseErrors } from './utils';
import JbrowseSelectedFilesTable from './JbrowseSelectedFilesTable';
import { jbrowseAssemblyName } from './utils';
import { jbrowseAssemblyObject } from './assembly';
import { jbrowseLinearDefaultSession } from './defaultSession';
import useJbrowseCompatibility from './useJbrowseCompatibility';
import { OverlayLoader } from '@/components/Loader';
import { checkJbrowseCompatibility, jbrowseAssemblyName, jbrowseErrors } from './utils';

const { NEXT_PUBLIC_SCORE_API_URL } = getConfig();
const arrangerFetcher = createArrangerFetcher({});
Expand Down Expand Up @@ -207,6 +206,18 @@ const JbrowseEl = () => {
<ErrorNotification size="sm">{error}</ErrorNotification>
) : (
<>
<JbrowseCircular
assembly={jbrowseAssemblyObject}
assemblyName={jbrowseAssemblyName}
configuration={{
theme: {
elevation: 0,
palette: { secondary: { main: theme.colors.accent } },
},
}}
defaultSession={jbrowseCircularDefaultSession}
selectedFiles={inputFiles}
/>
<JbrowseLinear
assembly={jbrowseAssemblyObject}
assemblyName={jbrowseAssemblyName}
Expand Down
8 changes: 8 additions & 0 deletions components/pages/explorer/Jbrowse/defaultSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@

import { jbrowseAssemblyAlias } from './utils';

export const jbrowseCircularDefaultSession = {
name: 'New Session',
view: {
id: 'circularView',
type: 'CircularView',
},
};

export const jbrowseLinearDefaultSession = {
name: 'New Session',
view: {
Expand Down

0 comments on commit c9b5434

Please sign in to comment.