Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding StrucvarGeneListCard #44

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .storybook/HomeStorybook.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<script setup lang="ts"></script>

<template></template>
5 changes: 3 additions & 2 deletions .storybook/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { App } from 'vue'

import vuetify from './vuetify'
import { router } from './router'
import { vuetify } from './vuetify'

export async function registerPlugins(app: App) {
app.use(vuetify)
app.use(vuetify).use(router)
}
21 changes: 21 additions & 0 deletions .storybook/plugins/router.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { createRouter, createWebHistory } from 'vue-router'

import HomeStorybook from '../HomeStorybook.vue'

const routes = [
{
path: '/',
name: 'home',
component: HomeStorybook
},
{
path: '/gene-details/:gene',
name: 'gene-details',
component: HomeStorybook
}
]

export const router = createRouter({
history: createWebHistory(),
routes
})
2 changes: 1 addition & 1 deletion .storybook/plugins/vuetify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const customLightTheme: ThemeDefinition = {
}

// https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides
export default createVuetify({
export const vuetify = createVuetify({
blueprint: md3,
components: {
...components
Expand Down
19 changes: 16 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"vite-plugin-css-injected-by-js": "^3.3.1",
"vite-plugin-static-copy": "^1.0.1",
"vue": "^3.4.15",
"vue-router": "^4.2.5",
"vuetify": "^3.5.1"
},
"devDependencies": {
Expand Down
10 changes: 10 additions & 0 deletions src/api/mehari/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/** Mapping from transcript effect to label. */
export const TX_EFFECT_LABELS: { [key: string]: string } = {
transcript_variant: 'whole tx',
exon_variant: 'exonic',
splice_region_variant: 'splicing',
intron_variant: 'intronic',
upstream_variant: 'upstream',
downstream_variant: 'downstream',
other: 'other'
}
1 change: 1 addition & 0 deletions src/api/mehari/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './types'
export * from './client'
export * from './constants'
43 changes: 43 additions & 0 deletions src/components/StrucvarGeneListCard/GeneDosage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<script setup lang="ts">
import { ClingenDosageScore } from '../../pbs/annonars/genes/base'
import { CLINGEN_DOSAGE_COLOR, CLINGEN_DOSAGE_SCORES } from '../GenePathogenicityCard/constants'

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const props = defineProps<{
dosage?: ClingenDosageScore
geneSymbol?: string
}>()
</script>

<template>
<template v-if="dosage === ClingenDosageScore.CLINGEN_DOSAGE_SCORE_RECESSIVE">
<a
:href="`https://search.clinicalgenome.org/kb/gene-dosage/${geneSymbol ?? ''}`"
target="_blank"
>
<v-chip density="compact" rounded="xl" :class="`bg-${CLINGEN_DOSAGE_COLOR[dosage]}`">
AR
</v-chip>
<small class="pl-1"><v-icon>mdi-launch</v-icon></small>
</a>
</template>
<template
v-else-if="dosage === undefined || dosage === ClingenDosageScore.CLINGEN_DOSAGE_SCORE_UNKNOWN"
>
<v-chip density="compact" rounded="xl" :class="`bg-grey-lighten-5`"> N/A </v-chip>
<small class="pl-1">
<v-icon><!--spacer only--></v-icon>
</small>
</template>
<template v-else>
<a
:href="`https://search.clinicalgenome.org/kb/gene-dosage/${geneSymbol ?? ''}`"
target="_blank"
>
<v-chip density="compact" rounded="xl" :class="`bg-${CLINGEN_DOSAGE_COLOR[dosage]}`">
{{ CLINGEN_DOSAGE_SCORES[dosage] }}
</v-chip>
<small class="pl-1"><v-icon>mdi-launch</v-icon></small>
</a>
</template>
</template>
Loading
Loading