Skip to content
Snippets Groups Projects
Commit 536ac400 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Fix bug several molstar plugin

parent bc40e59e
No related branches found
No related tags found
No related merge requests found
Pipeline #127799 waiting for manual action with stages
in 6 minutes and 42 seconds
<script setup lang="ts"> <script setup lang="ts">
import { withTrailingSlash, withLeadingSlash, joinURL } from 'ufo' import { computed, toValue } from '#imports'
import { useRuntimeConfig, computed, toValue } from '#imports'
import { useDisplay } from "vuetify"; import { useDisplay } from "vuetify";
import type { MaybeRef } from "vue"
import FoldseekDialog from '../FoldseekDialog.vue'
const { mobile, width, height } = useDisplay() const { mobile, width, height } = useDisplay()
...@@ -85,8 +82,10 @@ function closeStructure() { ...@@ -85,8 +82,10 @@ function closeStructure() {
dialog.value = false dialog.value = false
} }
watch(selectedPdb, (newSelectedPdb, prevSelectPdb) => { watch(selectedPdb, (newSelectedPdb, prevSelectPdb) => {
viewPdb(newSelectedPdb) if (newSelectedPdb !== prevSelectPdb) {
structureToDownload.value = newSelectedPdb viewPdb(newSelectedPdb)
structureToDownload.value = newSelectedPdb
}
}) })
watchEffect(() => { watchEffect(() => {
......
...@@ -18,7 +18,7 @@ const filterBase = ref<string[]>([ ...@@ -18,7 +18,7 @@ const filterBase = ref<string[]>([
"completed='true'" "completed='true'"
]) ])
const structureTitle = ref("Structure") const structureTitle = ref("Structure")
const stuctureUrls = ref<string[] | undefined>(undefined) const structureUrls = ref<string[] | undefined>(undefined)
export interface PlotMargin { export interface PlotMargin {
marginTop: number, marginTop: number,
...@@ -151,7 +151,7 @@ function on(mark) { ...@@ -151,7 +151,7 @@ function on(mark) {
// 🌶 since a point or band scale doesn't have an inverse, create one from its domain and range // 🌶 since a point or band scale doesn't have an inverse, create one from its domain and range
const g = render.apply(this, arguments); const g = render.apply(this, arguments);
const r = d3.select(g).selectChildren(); const r = d3.select(g).selectChildren();
r.on("click", function (event, i) { r.on("click", function (event) {
const index = d3.select(event.srcElement).data()[0] const index = d3.select(event.srcElement).data()[0]
displayStructure(data[index]) displayStructure(data[index])
}) })
...@@ -179,7 +179,7 @@ function buildStructureUrl(item) { ...@@ -179,7 +179,7 @@ function buildStructureUrl(item) {
} }
function displayStructure(item) { function displayStructure(item) {
stuctureUrls.value = buildStructureUrl(item).map(url => { structureUrls.value = buildStructureUrl(item).map(url => {
return toValue(useRefinedUrl(url).refinedUrl) return toValue(useRefinedUrl(url).refinedUrl)
}) })
structureTitle.value = item.proteins_in_the_prediction.join(" / ") structureTitle.value = item.proteins_in_the_prediction.join(" / ")
...@@ -194,9 +194,9 @@ function displayStructure(item) { ...@@ -194,9 +194,9 @@ function displayStructure(item) {
<PlotFigure ref="matrixPlot" :options="unref(option)" defer class="pdockq-plot" <PlotFigure ref="matrixPlot" :options="unref(option)" defer class="pdockq-plot"
:data-label="option.legend.label"></PlotFigure> :data-label="option.legend.label"></PlotFigure>
</v-card-text> </v-card-text>
<PdbeMolstarPlugin v-model="stuctureUrls" v-model:title="structureTitle" />
</v-card>
</v-card>
<PdbeMolstarPlugin v-model="structureUrls" v-model:title="structureTitle" />
</v-row> </v-row>
<v-card v-else flat color="transparent"> <v-card v-else flat color="transparent">
<v-card-text> <v-card-text>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment