Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wiki
Manage
Activity
Members
Labels
Plan
Issues
53
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MDM Lab
Wiki
Commits
36321986
Commit
36321986
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
clean
parent
09753981
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/content/pdockqMatrix.vue
+1
-70
1 addition, 70 deletions
components/content/pdockqMatrix.vue
with
1 addition
and
70 deletions
components/content/pdockqMatrix.vue
+
1
−
70
View file @
36321986
...
@@ -55,7 +55,6 @@ onMounted(async () => {
...
@@ -55,7 +55,6 @@ onMounted(async () => {
}
}
// attachEventHandler()
})
})
...
@@ -140,33 +139,6 @@ const computedPDocksMatrixPlotOptions = computed(() => {
...
@@ -140,33 +139,6 @@ const computedPDocksMatrixPlotOptions = computed(() => {
}
}
})
})
})
})
function
getDataLabelFromCell
(
elem
)
{
const
parent
=
elem
.
parentNode
.
parentNode
.
parentNode
.
parentNode
return
parent
.
dataset
.
label
}
function
attachEventHandler
()
{
const
cells
=
d3
.
selectAll
(
"
.pdockq-plot
"
).
selectAll
(
"
rect
"
)
console
.
log
(
"
cells rect on watch
"
)
console
.
log
(
cells
)
cells
.
on
(
"
click
"
,
function
(
event
)
{
console
.
log
(
"
click on cells
"
)
const
key
=
getDataLabelFromCell
(
this
)
console
.
log
(
key
)
const
toValGroupedPdock
=
toValue
(
groupedPdocks
)
console
.
log
(
toValGroupedPdock
)
const
index
=
d3
.
select
(
event
.
srcElement
).
data
()[
0
]
const
data
=
toValGroupedPdock
.
find
(
d
=>
{
console
.
log
(
d
)
return
d
[
0
]
===
key
})
if
(
data
)
{
displayStructure
(
data
[
1
][
index
])
}
else
{
console
.
log
(
"
no data found
"
)
}
})
}
// this function is adapted from https://observablehq.com/@fil/plot-onclick-experimental-plugin (@Fil)
// this function is adapted from https://observablehq.com/@fil/plot-onclick-experimental-plugin (@Fil)
...
@@ -186,57 +158,16 @@ function on(mark) {
...
@@ -186,57 +158,16 @@ 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
();
console
.
log
(
r
)
r
.
on
(
"
click
"
,
function
(
event
,
i
)
{
r
.
on
(
"
click
"
,
function
(
event
,
i
)
{
const
index
=
d3
.
select
(
event
.
srcElement
).
data
()[
0
]
const
index
=
d3
.
select
(
event
.
srcElement
).
data
()[
0
]
displayStructure
(
data
[
index
])
displayStructure
(
data
[
index
])
})
})
// for (const [type, callback] of Object.entries(listeners)) {
// r.on(type, function (event, i) {
// const p = d3.pointer(event, g);
// callback(event, {
// type,
// p,
// datum: data[i],
// i,
// facet,
// data,
// ...(x && { x: x.invert(p[0]) }),
// ...(y && { y: y.invert(p[1]) }),
// ...(x && channels.x2 && { x2: x.invert(channels.x2[i]) }),
// ...(y && channels.y2 && { y2: y.invert(channels.y2[i]) })
// });
// });
// }
return
g
;
return
g
;
};
};
return
mark
;
return
mark
;
}
}
// watchEffect(() => {
// const cells = d3.selectAll(".pdockq-plot").selectAll("rect")
// console.log("cells rect on watch")
// console.log(cells)
// cells.on("click", function (event) {
// console.log("click on cells")
// const key = getDataLabelFromCell(this)
// console.log(key)
// const toValGroupedPdock = toValue(groupedPdocks)
// console.log(toValGroupedPdock)
// const index = d3.select(event.srcElement).data()[0]
// const data = toValGroupedPdock.find(d => {
// console.log(d)
// return d[0] === key
// })
// if (data) {
// displayStructure(data[1][index])
// }
// else { console.log("no data found") }
// })
// })
// watch(matrixPlot, () => {
// attachEventHandler()
// })
function
pdbNameToCif
(
pdbPath
:
string
)
{
function
pdbNameToCif
(
pdbPath
:
string
)
{
const
cifPath
=
pdbPath
.
split
(
"
.
"
).
slice
(
0
,
-
1
).
join
(
"
.
"
)
const
cifPath
=
pdbPath
.
split
(
"
.
"
).
slice
(
0
,
-
1
).
join
(
"
.
"
)
return
`
${
cifPath
}
.cif`
return
`
${
cifPath
}
.cif`
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment