-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set up storybook pages for each query; pending resolution of CORS issues
- Loading branch information
1 parent
0943a71
commit 634352a
Showing
22 changed files
with
694 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
context/app/static/js/api/scfind/useCellTypeMarkers.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import React, { useState } from 'react'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Typography, Stack, FormControl, TextField } from '@mui/material'; | ||
import { cellTypes } from 'js/components/genes/constants'; | ||
import { http, passthrough } from 'msw'; | ||
import useCellTypeMarkers, { CellTypeMarkersParams } from './useCellTypeMarkers'; | ||
|
||
import { SCFIND_BASE } from './utils'; | ||
|
||
function CellTypeMarkersControl(params: CellTypeMarkersParams) { | ||
const result = useCellTypeMarkers(params); | ||
return ( | ||
<Stack> | ||
<Typography variant="h6">Cell Type Markers</Typography> | ||
<Typography variant="body1">Params:</Typography> | ||
<pre>{JSON.stringify(params, null, 2)}</pre> | ||
<Typography variant="body1">Results:</Typography> | ||
<pre>{JSON.stringify(result, null, 2)}</pre> | ||
</Stack> | ||
); | ||
} | ||
|
||
const meta: Meta = { | ||
title: 'SCFind/CellTypeMarkers', | ||
component: CellTypeMarkersControl, | ||
parameters: { | ||
msw: { | ||
handlers: [ | ||
http.get(`${SCFIND_BASE}/*`, () => { | ||
return passthrough(); | ||
}), | ||
], | ||
}, | ||
}, | ||
argTypes: { | ||
cellTypes: { | ||
control: { | ||
type: 'text', | ||
defaultValue: 'immature B cell', | ||
}, | ||
}, | ||
annotationNames: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
backgroundCellTypes: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
backgroundAnnotationNames: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
topK: { | ||
control: { | ||
type: 'number', | ||
defaultValue: 10, | ||
}, | ||
}, | ||
sortField: { | ||
control: { | ||
type: 'text', | ||
defaultValue: 'f1', | ||
}, | ||
}, | ||
includePrefix: { | ||
control: { | ||
type: 'boolean', | ||
defaultValue: true, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
type Story = StoryObj<typeof CellTypeMarkersControl>; | ||
|
||
export const CellTypeMarkers: Story = { | ||
args: { | ||
cellTypes: 'immature B cell', | ||
}, | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
context/app/static/js/api/scfind/useCellTypeNames.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Typography, Stack } from '@mui/material'; | ||
import { http, passthrough } from 'msw'; | ||
import useCellTypeNames, { CellTypeNamesParams } from './useCellTypeNames'; | ||
|
||
import { SCFIND_BASE } from './utils'; | ||
|
||
function CellTypeNamesControl(params: CellTypeNamesParams) { | ||
const result = useCellTypeNames(params); | ||
return ( | ||
<Stack> | ||
<Typography variant="h6">Cell Type Names</Typography> | ||
<Typography variant="body1">Params:</Typography> | ||
<pre>{JSON.stringify(params, null, 2)}</pre> | ||
<Typography variant="body1">Results:</Typography> | ||
<pre>{JSON.stringify(result, null, 2)}</pre> | ||
</Stack> | ||
); | ||
} | ||
|
||
const meta: Meta = { | ||
title: 'SCFind/CellTypeNames', | ||
component: CellTypeNamesControl, | ||
parameters: { | ||
msw: { | ||
handlers: [ | ||
http.get(`${SCFIND_BASE}/*`, () => { | ||
return passthrough(); | ||
}), | ||
], | ||
}, | ||
}, | ||
argTypes: { | ||
annotationNames: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
type Story = StoryObj<typeof CellTypeNamesControl>; | ||
|
||
export const CellTypeNames: Story = { | ||
args: {}, | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
context/app/static/js/api/scfind/useEvaluateMarkers.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import React from 'react'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Typography, Stack } from '@mui/material'; | ||
import { http, passthrough } from 'msw'; | ||
import useEvaluateMarkers, { EvaluateMarkersParams } from './useEvaluateMarkers'; | ||
|
||
import { SCFIND_BASE } from './utils'; | ||
|
||
function EvaluateMarkersControl(params: EvaluateMarkersParams) { | ||
const result = useEvaluateMarkers(params); | ||
return ( | ||
<Stack> | ||
<Typography variant="h6">Cell Type Names</Typography> | ||
<Typography variant="body1">Params:</Typography> | ||
<pre>{JSON.stringify(params, null, 2)}</pre> | ||
<Typography variant="body1">Results:</Typography> | ||
<pre>{JSON.stringify(result, null, 2)}</pre> | ||
</Stack> | ||
); | ||
} | ||
|
||
const meta: Meta = { | ||
title: 'SCFind/EvaluateMarkers', | ||
component: EvaluateMarkersControl, | ||
parameters: { | ||
msw: { | ||
handlers: [ | ||
http.get(`${SCFIND_BASE}/*`, () => { | ||
return passthrough(); | ||
}), | ||
], | ||
}, | ||
}, | ||
argTypes: { | ||
geneList: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
cellTypes: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
annotationNames: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
backgroundCellTypes: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
backgroundAnnotationNames: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
sortField: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
includePrefix: { | ||
control: { | ||
type: 'boolean', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
type Story = StoryObj<typeof EvaluateMarkersControl>; | ||
|
||
export const EvaluateMarkers: Story = { | ||
args: {}, | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
context/app/static/js/api/scfind/useFindCellTypeSpecificities.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import React from 'react'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Typography, Stack } from '@mui/material'; | ||
import { http, passthrough } from 'msw'; | ||
import useFindCellTypeSpecificities, { FindCellTypeSpecificitiesParams } from './useFindCellTypeSpecificities'; | ||
|
||
import { SCFIND_BASE } from './utils'; | ||
|
||
function FindCellTypeSpecificitiesControl(params: FindCellTypeSpecificitiesParams) { | ||
const result = useFindCellTypeSpecificities(params); | ||
return ( | ||
<Stack> | ||
<Typography variant="h6">Cell Type Names</Typography> | ||
<Typography variant="body1">Params:</Typography> | ||
<pre>{JSON.stringify(params, null, 2)}</pre> | ||
<Typography variant="body1">Results:</Typography> | ||
<pre>{JSON.stringify(result, null, 2)}</pre> | ||
</Stack> | ||
); | ||
} | ||
|
||
const meta: Meta = { | ||
title: 'SCFind/FindCellTypeSpecificities', | ||
component: FindCellTypeSpecificitiesControl, | ||
parameters: { | ||
msw: { | ||
handlers: [ | ||
http.get(`${SCFIND_BASE}/*`, () => { | ||
return passthrough(); | ||
}), | ||
], | ||
}, | ||
}, | ||
argTypes: { | ||
geneList: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
cellTypes: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
annotationNames: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
backgroundCellTypes: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
backgroundAnnotationNames: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
sortField: { | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
includePrefix: { | ||
control: { | ||
type: 'boolean', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
type Story = StoryObj<typeof FindCellTypeSpecificitiesControl>; | ||
|
||
export const EvaluateMarkers: Story = { | ||
args: {}, | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.